Search code examples
javaeclipsejvm-argumentsjdi

Eclipse: Unrecognized option: -g


I am trying to start an application in Eclipse with the JVM Option "-g", so that I would be able to view all thread info while debugging using the JDI.

However, on start, Eclipse is giving the following:

Unrecognized option: -g:
Could not create the Java virtual machine.

The full list of my JVM Options:

-g -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000

Other Info: I am using mac.

I would very much appreciate assistance to solve this problem, so that I could debug without getting the AbsentInformationException in JDI.

Thank you,

Dean


Solution

  • You have to compile with the -g option.

    For Eclipse configuration, see here: Where do you configure Eclipse Java compiler (javac) flags?