aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes using jar export in Eclipse 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "using jar export in Eclipse 3.0" Watch "using jar export in Eclipse 3.0" New topic
Author

using jar export in Eclipse 3.0

John Martinson
Greenhorn

Joined: Jun 17, 2005
Posts: 22
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

Joined: Jan 10, 2002
Posts: 61220
    
  66

Not a build tool issue. Moved to the IDEs forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

John,
Welcome to JavaRanch!

The jar export is just exporting your code. You still need to have poi.jar in your classpath.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
John Martinson
Greenhorn

Joined: Jun 17, 2005
Posts: 22
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using jar export in Eclipse 3.0