Reputation: 83
Sorry about the poor title, but essentially what I need to do is launch a jar in the form of an applet from another jar. Also for those of you familiar with Minecraft, I'm making a custom Minecraft launcher. (The stub in the source is a subclass of AppleStub and has some custom parameters, etc.)
applet.setStub(stub);
this.add(applet);
validate();
this.setVisible(true);
applet.init();
applet.setSize(getWidth(), getHeight());
applet.start();
Is my current code, which works, the only problem is I get this exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
org/lwjgl/LWJGLException
Which happens because the jar that I'm launching depends on LWJGL, which doesn't work. I've already done this:
System.setProperty("org.lwjgl.librarypath", natives.getAbsolutePath());
System.setProperty("net.java.games.input.librarypath", natives.getAbsolutePath());
Which should fix the error, but doesn't seem to (natives is just the file instance of the natives folder).
The vanilla Minecraft Launcher does this almost exactly the same and works fine, whereas this does not. Does anyone know what I'm doing wrong?
Upvotes: 0
Views: 950
Reputation: 35351
It looks like the JAR that contains the org.lwjgl
library is not part of your launcher's classpath. You probably need to specify the location of the org.lwjgl
JAR when you launch the launcher. Something like:
java -classpath "path/to/lwjgl.jar" com.foo.MyLauncher
Upvotes: 1