Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem packaging my app as jar file

 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I'm trying to build an application that uses a third party class that extends JTable. I developed it in Netbeans and it runs fine. Now I'm trying to package all the class files as a jar and run them from the command line.
When the app first pops up on the screen the third party app isn't used and I get to that point fine, when I push a button that causes the third party class to be instantiated I get a class not found error.
I run it like this
java -jar -cp c:\path_to_jar\third_party.jar myApp.jar
I also tried to unpack third_pary.jar in the dir with my other class files and including its contents in myApp.jar but that didn't work either.
Anybody see what I'm doing wrong here??
Thanx
Dave
 
Michael Fitzmaurice
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave
If you open the jar file in something like WinZip, or use the jar utility to print it's contents, do you see your third party library in there?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could be remembering incorrectly, but a little voice in my head is saying "executable JARs ignore external CLASSPATH settings".
I also tried to unpack third_pary.jar in the dir with my other class files and including its contents in myApp.jar but that didn't work either.
If done correctly, it should work. You could also just include the third party JAR with your myApp.jar. Take a look towards the end of the Creating an Executable JAR File thread for such instructions.
[ October 28, 2003: Message edited by: Dirk Schreckmann ]
 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Guy's,
worked like a charm
sure is nice to have knowledgable folks point ya towards the the instructions
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic