This content has been marked as final. Show 10 replies
Ahhh ic, so lets say that I want to put my executable JAR and the external library JAR in the same folder and then run my JAR, how would i set that up? I have been using eclipse to export my program to a JAR and i don't think its doing it right =( Can you give me instructions on how to make the JAR or do you have a link?
Ahhh ic, so lets say that I want to put my executableNot sure what you're asking. You've got 3rd party JARs and your executable JAR in the same directory. Very good. What are you asking me?
JAR and the external library JAR in the same folder
and then run my JAR, how would i set that up?
I haveIt's only doing what you're telling it to do. What does "not right" look like?
been using eclipse to export my program to a JAR and
i don't think its doing it right =(
Does your executable JAR have a manifest? Does it spell out the main class and classpath? If not, make it do so.
>Can you give me
instructions on how to make the JAR or do you have aThe instructions on how to use the jar tool are in the Java tool docs:
Great =) one last thing, will it automatically put"It" being Eclipse? I doubt it. How will it know?
the correct entry into the manifest and .classpath?
Don't depend on anything being done without your knowledge. I think if you create a META-INF directory and put a proper manifest.mf file in it, Eclipse can be told to bundle it up with your JAR. You have to create it.
Also how do I tell my JAR to look for the externalYou can tell it to look in whatever path you wish when you specify the entries to Class-Path.
library in the same directory it was launched from?
Ok I was able to make my JAR and launch my application correctly. However whenever I click a button that has a method using my external library I get the following error:
C:\Documents and Settings\Koneko>java -jar D:\Mangment.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/POIFSFileSystem at managment_system.ManagmentGUI.getNextStat(ManagmentGUI.java:569) at managment_system.ManagmentGUI$1.actionPerformed(ManagmentGUI.java:195)
I do not get this error when I run and use my program from within the IDE.
The JAR that has my external library (and has the class for POIFileSystem) is also on my D drive and i referenced it correctly (I think) In my classpath:
I would really like to get this working and I'm very confused XP
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path=""/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="D:/poi.jar"/> <classpathentry kind="output" path=""/> </classpath>