So that's where we misunderstood each other: when you were speaking about "fat JAR", I thought it means putting the library JARs into my app's JAR and loading them from there. Then, you're not creating a fat JAR, you're trying to apply the method called "Jar-in-Jar" So it seems that I cannot even run it with the class path set to my system libs :-/ What did I do wrong? Could not find the main class: texQuads.Main. at $AppClassLoader.loadClass(Launcher.java:294) Exception in thread "main" : javax/media/opengl/GLEventListener When I try to run the JAR file, it throws up: I can run the final app from the command line by using java -cp texQuads/main and it runs fine. Note that I deliberately set the Class-Path field in the manifest file to point to my system libs, because I wanted to test if it will run from the JAR at all before trying to package them into the JAR file itself.Ĭompilation goes without any errors. Here's my first attempt at writing the build file: (Thanks for the tutorial! It was very helpful). OK, so I decided to go with ant, since I already have it on my system. There are some softwares for that but they are a lot less flexible than the build tools like Ant. How can I supply the JOGL libraries within my JAR file?Įdit: Oh, and I don't use any IDE, just plain old text editor and command line on Linux. I tried to make a JAR file, but it doesn't seem to work: it prints an error about missing libraries: Exception in thread "main" : javax/media/opengl/GLEventListenerĪt 1(Native Method)Īt (ClassLoader.java:643)Īt (SecureClassLoader.java:142)Īt (URLClassLoader.java:277)Īt $000(URLClassLoader.java:73)Īt $1.run(URLClassLoader.java:212)Īt (Native Method)Īt (URLClassLoader.java:205)Īt (ClassLoader.java:323)Īt $AppClassLoader.loadClass(Launcher.java:294)Īt (ClassLoader.java:268)Ĭaused by: : Īt $1.run(URLClassLoader.java:217)Ĭould not find the main class: Main.
Is there any way to supply the JOGL libraries within the JAR file itself to make it a self-contained app? Now I want to make a JAR file out of it, so that I could put it on my website for download, and it needs to run even if the user doesn't have JOGL libraries installed on his machine.
I wrote an application using JOGL, compiled it and run, and everything works fine.