java 尝试分析应用程序时,重新定义失败并出现错误 62
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26834651/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Redefinition failed with error 62 while trying to profile an application
提问by Suzan Cioc
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
如果我尝试在 VisualVM 的帮助下分析应用程序(在 Eclipse 下准备,但从命令行运行),我会收到以下错误消息
Simultaneously, the project folder is fouled with newly created class files. Although they are already existing in target/classes
.
同时,项目文件夹被新创建的类文件弄脏了。虽然它们已经存在于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
项目结构是Maven的,即target/classes
当前目录中有一个foder ,我使用以下命令运行应用程序
java -Xmx16g -cp target/classes tests.Runner01
How to fix?
怎么修?
UPDATE
更新
The same occurs with conventional java project too.
传统的java项目也会发生同样的情况。
Below it the picture of populated class files, which located where they should not
在它下面是填充类文件的图片,这些文件位于它们不应该的位置
回答by rafalopez79
Here https://netbeans.org/bugzilla/show_bug.cgi?id=191297appears a workaround: run profiled application with -Xverify:none
这里https://netbeans.org/bugzilla/show_bug.cgi?id=191297出现了一种解决方法:使用 -Xverify:none 运行配置文件
回答by shmosel
According to this GitHub issue, it's been fixed. Updating to version 1.4solved the problem for me.
回答by Pirate
If you are using eclipse, then go to Run/Debugconfiguration. Select your application from left side and click on Arguments.
如果您使用的是 Eclipse,请转到运行/调试配置。从左侧选择您的应用程序,然后单击参数。
Here you will see two text boxes.
在这里您将看到两个文本框。
1. Program Arguments
2. VM Arguments
In VM arguments, enter below commands. -Xverify:none
在 VM 参数中,输入以下命令。 -Xverify:无
Click on apply and then Run/Debug.
单击应用,然后单击运行/调试。
回答by Stuart Hansen
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.
我发现使用 IntelliJ 的解决方法是编译为 Java 1.6 字节代码。这样做的菜单选项是:文件 - 项目结构,然后将项目语言级别设置为 6。
This precludes you from using Java features only available with Java 7 or 8.
这使您无法使用仅在 Java 7 或 8 中可用的 Java 功能。