[Logo]
Forums Register Login
Won't load class from JAR
This problem is a continuation of a problem I submitted several days ago. I am using Java 1.1.x development evironment in particular I am using JBulider2. Anyhow, I am having an issue with an application I have just finished designing. I have made a jar that contains all the project files, but when I run the jre it fails. It issues the error "unable to load CAPExp.AppMain class". I have confirmed that all the classpath references are correct, and that they match in case. I have also opened up the JAR and confirmed that the class is in the archive. I don't know where to go from here any ideas?
Is your jar file declared explicitly by file name in the classpath?
[This message has been edited by Mark Savory (edited April 18, 2001).]
Yes I do have the jar explictly expressed in the classpath.
1. Try recompiling all your classes once again as there could be chances that one of ur main class is corrupted.
2. Check the main class whether it has a static main method for the jvm to load the main class.
3. Check the package name and class name for any typos.
Checked Checked and Checked. I tried disabling all but the absolute most essential code and it loaded. I now going through and reactivating it in parts. Do you have any idea why it would compile in my deevelopment environment and then not work once I put it in a jar?
After experimenting a bit more its seems it won't load because I am using a JFrame class to hold my application. When I change it too a normal Frame class it loads. There are compiling erros though when I use the Frame class implementation. Is there away to call them JFrame from the Frame class?
JFrame is part of the SWING stuff that came out with Java2. The 1.1.X versions had various amounts of beta classes for swing, but for the most part do not allow you to use it.
So you either need to upgrade the version of the SDK/JRE that you are using to at least 1.2 or use the AWT components exclusively.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 20, 2017 01:11:26.