How do I compile with -g option in Netbeans?

后端 未结 2 2127
春和景丽
春和景丽 2020-12-11 08:36

When debugging I get an warning message on exception saying \'variable info not available - compiled without -g\' - how do I set to compile with -g in netbeans?

2条回答
  •  死守一世寂寞
    2020-12-11 08:38

    In my Nb 7.4 there is a "generate Debuging info" flag on
    project propertyes -> Build -> compile ;

    but if you, like me, are using maven, you have to check in pom.xml too

    let me show an example:
    you can ave a production profile and in that profile you can have the maven compiler plugin with debug setting to false

            
            production
            
                
                    
                        org.apache.maven.plugins
                        maven-compiler-plugin
                        2.5.1
                        
                            UTF-8
                            1.6
                            1.6
                            true
                            false
                            true
                        
                    
                
            
     ...
    

    see the false setting
    if you have a similar setting on your pom.xml local variable on debug are not show.

提交回复
热议问题