Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons are greyed out. #14

Open
roberterdin opened this issue Jun 28, 2015 · 10 comments
Open

Icons are greyed out. #14

roberterdin opened this issue Jun 28, 2015 · 10 comments

Comments

@roberterdin
Copy link

The VisualVM icons are greyed out. I specified the executable (/usr/lib/jvm/java-8-oracle/bin/jvisualvm, that is on Ubuntu) but nothing happens.
I can run the VisualVM from the terminal without problems.

Any ideas where to start troubleshooting?

IDEA version: 14.1

@krasa
Copy link
Owner

krasa commented Jun 28, 2015

there is only this condition:

    public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
        return executorId.equals(RunVisualVMExecutor.RUN_WITH_VISUAL_VM)
                && profile instanceof ModuleRunProfile
                && !(profile instanceof RemoteConfiguration);
    }

What kind of Run Configuration are you using?

@roberterdin
Copy link
Author

I execute a gradle task as Run Configuration:
cleanTest test --tests SomeTest

I guess I need a JAR Applicatoin?

@krasa
Copy link
Owner

krasa commented Jun 28, 2015

Yep, JUnit/TestNG/Application...

I will look into it, but not even YourKit buttons are enabled for gradle...

@roberterdin
Copy link
Author

Ok thank you. Don't worry too much about Gradle support... if somebedy wants to profile something he will manage to make an according Run Configuration :)

@krasa
Copy link
Owner

krasa commented Jun 28, 2015

I just tried it, and it does not seem possible without some heavy hacks, since Gradle uses deamons.

@roberterdin
Copy link
Author

At least for Unit Tests, yes. AFAIK (have not veryfied this) it starts the application without a daemon.

@krasa
Copy link
Owner

krasa commented Jun 28, 2015

task execute(type:JavaExec) {
    main = mainClass
    classpath = sourceSets.main.runtimeClasspath
}

this uses the deamon too.

It is possible to run it as a Groovy task, then it will run in its own process with the visualvm.id correctly set and with working buttons, however that is a wrapper too (org.gradle.launcher.GradleMain) and forks another process in which the app is running, and it cannot be debugged this way - Maven does something similar and the process forking can be disabled, so perhaps this too can be configured...

There must be some way how to pass a VM parameter via the deamon to the forked processes...

@roberterdin
Copy link
Author

The gradle run task from the Application Plugin runs my application in a seperate process. It sais it uses the JavaExec function. This function also takes VM args.

Example:

// File: build.gradle
apply plugin: 'java'

task(runSimple, dependsOn: 'classes', type: JavaExec) {
    main = 'com.mrhaki.java.Simple'
    classpath = sourceSets.main.runtimeClasspath
    args 'mrhaki'
    jvmArgs "-DsomeArg=xx", "-Danother=yy"
    systemProperty 'simple.message', 'Hello '
}

Source: http://mrhaki.blogspot.com/2010/09/gradle-goodness-run-java-application.html

edit: did not read your answer correctly, discard what I just wrote

@IngeniousTom
Copy link

IngeniousTom commented Apr 6, 2022

I have the same issue!
After I installed and configured Visual VM Launcher and restarted the Intellij IDEA 2021.3.3 I can see that icons are greyed out as shown on the screenshot below.

VisualVM Launcer

Icons are also greyed out even in "Run" menu as you can see on the screenshot below:

VisualVM Launcer2

-My project uses the same jdk as shown in the plugin configuration;
-My project starts with gradle task (look at the screenshot below).

gradle_run_debug

Can you help me with this problem?

@igorwojda
Copy link

igorwojda commented May 5, 2023

@krasa I think I have found the root cause of this problem - it is all about configuration type:

Icons are grayed out for Gradle configurations:
image

Icons are active for JUnit configurations:
image

You can also observe similar behavior when launching tests from IntelliJ IDEA

No Icons for Gradle configurations:
image

Icons are visible for JUnit configurations:
image

Action
It looks like this Plugin needs some changes because the Gradle configuration is the default way of running tests nowadays:
image

Changing Default test configuration
This option allows us to determine which configuration will be created while running tests from the IntelliJ IDEA.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants