【发布时间】:2010-03-03 11:26:45
【问题描述】:
调试时我收到一条关于异常的警告消息'variable info not available - compiled without -g' - 如何设置在 netbeans 中使用 -g 进行编译?
谢谢
【问题讨论】:
标签: java netbeans compilation
调试时我收到一条关于异常的警告消息'variable info not available - compiled without -g' - 如何设置在 netbeans 中使用 -g 进行编译?
谢谢
【问题讨论】:
标签: java netbeans compilation
据我所知,您的自己的代码是使用调试信息编译的。然而,Java 运行时库不是。
请仔细检查您看到此消息的位置是否在您自己的代码中,而不是运行时库中。
【讨论】:
在我的 Nb 7.4 中有一个“生成调试信息”标志
项目属性->构建->编译;
但如果你和我一样使用 maven,你也必须检查 pom.xml
让我举个例子:
您可以保存生产配置文件,在该配置文件中,您可以将调试设置为 false 的 maven 编译器插件
<profile>
<id>production</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
<showWarnings>true</showWarnings>
<debug>false</debug>
<optimize>true</optimize>
</configuration>
</plugin>
</plugins>
</build>
...
查看错误设置
如果您在调试时对 pom.xml 局部变量有类似设置,则不会显示。
【讨论】: