Received "Variable information not available, source compiled without -g option" error

After I created a new class in netbeans, I received "Variable information not available, source compiled without -g option" error trying to debug the new class. I deleted that class, and decided to use a different class, which was not anyway related to the previously deleted class, that worked perfectly with the debugger yesterday. I also receive this error, and it appears that this issue is permanent. I have gone through some related posts, but they do not appear to have the same issue. I have checked to make sure "generate Debugging info" was checked, and it was. What causes this error, and why is it now permanent regardless of the class I try to debug?

asked Oct 24, 2017 at 21:15 user7452271 user7452271

2 Answers 2

Take a look at the javac -g options, especially -g and -g:none .

If you use a build infrastructure like maven or gradle then there might be something wrong.

But for NetBeans itsef look at the compiler options. Go to the Project Properties (not global options), where the checkbox "Generate Debugging info" should be checked.

There also is a text field "Additional Compiler options" that should normally be empty.

Do a clean build.

I must admit, that the behaviour there almost looks like project garbage. But more to be expected from eclipse than NetBeans.

As the mention is of "Variable information not available," it seems the option -g:vars is wanted for some reason (some class manipulating library, documentation tool, annotation processing). Check whether you installed some NetBeans plugin in that area. By default debug information on variables is not added, as for exceptions the other two suffice.

Additional compiler options: -g:source,lines,vars