This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Could not execute a jar file even with proper classpath.  RSS feed

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to execute a jar file which looks for a driver in another jar file.

Though I had the path in the classpath, you need to mention the class-path for the jar specifially. So, I have these lines in the manifest file,


But still, the jar file is not searched in the lib folder.
I get the following error -
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver


By the way I am trying to use hibernate pojo generator project for which I am doing this.

Let me know if anyone has any solutions for the same.
 
Marshal
Posts: 24188
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably, then, that "lib" folder is not in the same folder as the jar? Your file structure should look something like this:

-- somefolder
-- -- your.jar
-- -- lib
-- -- -- db2jcc4.jar
 
Sheriff
Posts: 21638
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And not like this, with the JAR file inside the other JAR file:
-- somefolder
-- -- your.jar
-- -- -- lib
-- -- -- -- db2jcc4.jar
 
Oh the stink of it! Smell my tiny ad!
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!