Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using jar export in Eclipse 3.0

 
John Martinson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build an App that reads Excel files. I'm using Eclipse 3.0 and the POI API. Everything works when I launch from within Eclipse, but once I export to an executable jar and try to run it the class that uses POI does not seem to work.

I have the POI jar included in my libraries for this project and have played around with the order in the Order and Export TAB in Project Properties menu.

Any help would be great!

distressed intern.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a build tool issue. Moved to the IDEs forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Welcome to JavaRanch!

The jar export is just exporting your code. You still need to have poi.jar in your classpath.
 
John Martinson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First time using classpath. I have poi.jar in my class bath. But when I try to open the Excel sheet after starting my jar I get "NoClassDefFoundError" and then it lists the fisrt class I try to use in my code.

my comand line looks like so and a few variations

java -classpath /poi.jar; -jar myjar.jar
java -classpath C:/db/poi.jar; -jar myjar.jar
java -classpath C:\db\poi.jar; -jar myjar.jar

It runs fine in Eclipse, what can I be doing wrong?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since it works in Eclipse, this is more of a command line question than an IDEs one. I'll move the question to Java In General for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic