Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Runnable Jar with referenced libraries

843789Mar 30 2010 — edited Mar 30 2010
I wrote this program on eclipse 3.5.2 to use at work and I imported an external jar to allow me to do some things with excel "jxl.jar";. Now I'm finished with my program and it works great on my computer and if I export to "Runable Jar" I can have this nice little .jar file on my desktop that runs my program. However if I give it to a co-worker it does not work properly. The part that doesn't seem to work is the button that does the calculations on a excel spreadsheet. So, I concluded that the imported jxl.jar file isn't being packed into my final jar. I have tried exporting to plain Jar, Runable Jar, Fat Jar, with just about every possible combination of settings possible. I don't know anything about ANT but I looked at the output from one of them and I noticed this line "zipfileset excludes" which seemly confirms my conclusion.
  <?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
- <project default="create_run_jar" name="Create Runnable Jar for Project PSF_Checker">
- <!-- this file was created by Eclipse Runnable JAR Export Wizard
  --> 
- <!-- ANT 1.7 is required                                        
  --> 
- <target name="create_run_jar">
- <jar destfile="C:/Documents and Settings/USER/Desktop/PSF Checker.beta.jar" filesetmanifest="mergewithoutmain">
- <manifest>
  <attribute name="Main-Class" value="psf_checker.PSF_Checker" /> 
  <attribute name="Class-Path" value="." /> 
  </manifest>
  <fileset dir="C:/Documents and Settings/USER/workspace/PSF_Checker/bin" /> 
  <zipfileset excludes="META-INF/*.SF" src="C:/Documents and Settings/USER/workspace/PSF_Checker/bin/jxl.jar" /> 
  </jar>
  </target>
  </project>
If I need to give more info let me know.

Thank you,

Dustin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 27 2010
Added on Mar 30 2010
3 comments
236 views