There seems to be some incompatibility between JDK 1.7u2 and building inside Eclipse. It shows the following error building gluegen:
[javah] Exception in thread "main" java.lang.NullPointerException
[javah] at com.sun.tools.javah.JavahTask.run(JavahTask.java:509)
[javah] at com.sun.tools.javah.JavahTask.run(JavahTask.java:335)
[javah] at com.sun.tools.javah.Main.main(Main.java:46)
C:\Users\wwalker\Documents\jogl2\gluegen\make\build.xml:409: The following error occurred while executing this line:
C:\Users\wwalker\Documents\jogl2\gluegen\make\build.xml:416: compilation failed
I'm investigating now -- it's probably some conflict between Oracle's new tools.jar and Eclipse. We've already seen when fixing the build for JDK 1.7 that javah behaves a bit differently now than it did in JDK 1.6.
Can duplicate this on the command line:
> java -classpath "C:\Program Files\Java\jdk1.7.0_02\lib\tools.jar" com.sun.tools.javah.Main
Exception in thread "main" java.lang.NullPointerException
Not sure why it fails like this, but works when run inside Ant on the command line. There may be something else on the classpath that's not being put there in the Eclipse run.
Very strange. When I invoke javah like this, it fails:
jogl2\gluegen> java.exe -classpath "C:\Program Files\Java\jdk1.7.0_02\lib\tools.jar" com.sun.tools.javah.Main -d build\gensrc\native -classpath build\classes jogamp.common.os.MachineDescriptionRuntime
Doing it like this also fails (this is how ant -debug shows it being done inside Eclipse):
jogl2\gluegen> "C:\Program Files\Java\jre7\bin\java.exe" -classpath "C:\Program Files\Java\jdk1.7.0_02\lib\tools.jar" com.sun.tools.javah.Main -d build\gensrc\native -classpath build\classes jogamp.common.os.MachineDescriptionRuntime
But like this, it succeeds:
jogl2\gluegen> "C:\Program Files\Java\jdk1.7.0_02\bin\java.exe" -classpath "C:\Program Files\Java\jdk1.7.0_02\lib\tools.jar" com.sun.tools.javah.Main -d build\gensrc\native -classpath build\classes jogamp.common.os.MachineDescriptionRuntime
Continuing to investigate. The two java executables appear identical, so there must be some path dependency perhaps.
Found the problem. In Java 7, Ant needs to be launched with a Java executable from a JDK, not a JRE, or else the javah task won't work correctly, even if you set the Ant java.home property to the JDK directory.
Eclipse launches Ant with the workbench VM, which is not set from JAVA_HOME, so it ends up chosing C:\Program Files\Java\jre7\bin\javaw.exe instead of C:\Program Files\Java\jdk1.7.0_02\jre\bin\javaw.exe, which makes it unable to use tools.jar correctly (since it's only present in the JDK).
I changed the wiki at http://jogamp.org/wiki/index.php/Building_JOGL_in_Eclipse to give instructions on how to tell Eclipse to launch Ant with your JAVA_HOME JDK instead of the other JRE.