62

If I try to profile application, (which is prepared under Eclipse, but running from command line) with the help of VisualVM, I get the following error message

enter image description here

Simultaneously, the project folder is fouled with newly created class files. Although they are already existing in target/classes.

The project structure is Maven's, i.e. there is a foder target/classes in current directory and I us the following command to run the application

java -Xmx16g -cp target/classes tests.Runner01

How to fix?

UPDATE

The same occurs with conventional java project too.

Below it the picture of populated class files, which located where they should not

enter image description here

Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385

6 Answers6

89

Here https://netbeans.org/bugzilla/show_bug.cgi?id=191297 appears a workaround: run profiled application with -Xverify:none

rafalopez79
  • 2,046
  • 4
  • 27
  • 23
9

If you are using eclipse, then go to Run/Debug configuration. Select your application from left side and click on Arguments.

Here you will see two text boxes.

1. Program Arguments
2. VM Arguments

In VM arguments, enter below commands. -Xverify:none

Click on apply and then Run/Debug.

Pirate
  • 2,886
  • 4
  • 24
  • 42
7

According to this GitHub issue, it's been fixed. Updating to version 1.4 solved the problem for me.

Tomas Hurka
  • 6,723
  • 29
  • 38
shmosel
  • 49,289
  • 6
  • 73
  • 138
2

For IntelliJ, you can set -Xverify:none as follows:

Run > Edit Configurations... > Modify options (Alt + M) > Add VM options.

This should reveal a new field VM options, to which you can write -Xverify:none.

Spacha
  • 313
  • 4
  • 7
1

The workaround I found using IntelliJ is to compile to Java 1.6 byte code. The menu option to do so is: File - Project Structure, then set Project language level to 6.

This precludes you from using Java features only available with Java 7 or 8.

0

Just letting others know, adding the VM option -Xverify:none is the recommended way as per the official Troubleshooting Guide.

Yuri
  • 4,254
  • 1
  • 29
  • 46