Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Program works fine in IDE, but not in JAR.  RSS feed

 
Tarek Khojah
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember I had this problem when it came to files, where I had to use getResourceAsStream()

Now I'm facing the same problem with:

Class.forName("org.hsqldb.jdbcDriver");

Throwing a class not found exception.

I have no clue on what to do, please help.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a dependency on HSQLDB. Your IDE is resolving it for you, but you also have to tell your JAR how to resolve it.
The Java Tutorial chapter on JAR files has a section on how to set the classpath.
 
Tarek Khojah
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm surprised that Eclipse doesn't take care of these things for you.

Heh, it probably does and I just don't know how.

Thank you for your help, very much appreciated
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!