I have so may JDKs, JOGL and LWJGL versions in my machine but following “my” principal makes it smooth using any version I like while testing this and that.
- Create RunForrestRun.bat batch to launch a program
- Set JOGL and CP env vars at the start of batch
- Set java.exe command to launch an app
Key is to give “-Djava.library.path=c:/jnidllfolder” so that virtual machine can find a native .dll files. Then use -classpath (or-cp) to give .jar files and classes folders.
I sort of create a temporary system32 path for each application launch. Now I can mix various JDKs and JOGL versions easily just creating a new testappJDK1.5.bat file.
This is how folders and files might look:
c:/projects/java/jogl/jogl-win32/jogl.dll
c:/projects/java/jogl/jogl-win32/jogl_cg.dll
c:/projects/java/jogl/jogl-win32/jogl.jar
c:/projects/java/testapp/RunMyApp.bat
c:/projects/java/testapp/lib/mytestapp.jar
c:/projects/java/testapp/lib/anotherLib.jar
c:/projects/java/testapp/src/.java
c:/projects/java/testapp/classes/.class
If you use some Java IDE then create a project and add jog.jar to a library list. dll files are not required for the compilation, just running the app needs it.
RunMyApp.bat
SET jogl=C:/projects/java/jogl/jogl-win32
SET cp=%jogl%/jogl.jar
SET jnilib=%jogl%;./otherJNIDLLfolder
SET cp=%cp%;./lib/myapp.jar;./lib/otherJavaLib.jar;c:/utils/classes
rem c:\j2sdk1.4.2_04\bin\java.exe -Djava.library.path=%jnilib% -cp %cp% AppDemo
java.exe -Djava.library.path=%jnilib% -cp %cp% AppDemo
pause