Mal*_*ker 4 java netbeans compilation
在调试时,我收到一条关于异常的警告消息'variable info not available - compiled without -g'
- 如何设置在netbeans中使用-g进行编译?
谢谢
小智 5
在我的Nb 7.4中,
项目属性上有一个"生成Debuging info"标志- > Build - > compile;
但如果你像我一样使用maven,你也必须检查pom.xml
让我举一个例子:
您可以生成一个生产配置文件,在该配置文件中,您可以将maven编译器插件的调试设置为false
<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>
...
Run Code Online (Sandbox Code Playgroud)
如果您的pom.xml上的类似设置没有显示,那么请参阅false设置.