diff options
Diffstat (limited to 'src/classes/com/sun')
-rwxr-xr-x | src/classes/com/sun/opengl/util/JOGLAppletLauncher.java | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/classes/com/sun/opengl/util/JOGLAppletLauncher.java b/src/classes/com/sun/opengl/util/JOGLAppletLauncher.java index 0af380255..7a9f8ab74 100755 --- a/src/classes/com/sun/opengl/util/JOGLAppletLauncher.java +++ b/src/classes/com/sun/opengl/util/JOGLAppletLauncher.java @@ -280,18 +280,31 @@ public class JOGLAppletLauncher extends Applet { if (firstStart) { firstStart = false; String userHome = System.getProperty("user.home"); - String installDirName = userHome + File.separator + ".jogl_ext" - + File.separator + installDirectory + File.separator + Version.getVersion(); - final File installDir = new File(installDirName); + try { + // We need to load in the jogl package so that we can query the version information + ClassLoader classloader = getClass().getClassLoader(); + classloader.loadClass("javax.media.opengl.GL"); + Package p = Package.getPackage("javax.media.opengl"); + + String installDirName = userHome + File.separator + ".jogl_ext" + + File.separator + installDirectory + File.separator + p.getImplementationVersion(); + + final File installDir = new File(installDirName); + + Thread refresher = new Thread() { + public void run() { + refreshJOGL(installDir); + } + }; + refresher.setPriority(Thread.NORM_PRIORITY - 1); + refresher.start(); + } + catch (ClassNotFoundException e) { + System.err.println("Unable to load javax.media.opengl package"); + System.exit(0); + } - Thread refresher = new Thread() { - public void run() { - refreshJOGL(installDir); - } - }; - refresher.setPriority(Thread.NORM_PRIORITY - 1); - refresher.start(); } else if (joglStarted) { // we have to start again the applet (start can be called multiple times, // e.g once per tabbed browsing |