4

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?

thanks

MalcomTucker
  • 7,407
  • 14
  • 72
  • 93

2 Answers2

8

As far as I know your own code is compiled with debug information. The Java runtime library, however, isn't.

Please double check that the location you see this message, is in your own code and not the runtime library.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • Hi, where is it and how can I check if it is in there or not ? Thanks – Cugomastik Nov 13 '14 at 15:23
  • @Thorbjorn Ravn Anderson, How can I see the runtime variables like I can with IntelliJ?? – cosbor11 May 11 '15 at 08:30
  • @cosbor11 please see http://stackoverflow.com/questions/18255474/debug-jdk-source-cant-watch-variable-what-it-is – Thorbjørn Ravn Andersen May 11 '15 at 10:02
  • Thanks. I have tried this texhnique. However, when I tried doing these steps for the javafxrt.jar many of the classes were missing, including the one I wanted to step through. – cosbor11 May 13 '15 at 21:51
  • @cosbor11 I do not know if Oracle has a developer specific JDK download which provide what you need. You may look into the OpenJFX project. You may consider opening a question with your actual problem. – Thorbjørn Ravn Andersen May 14 '15 at 10:51
5

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

        <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>
 ...

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