Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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.
 
Sheriff
Posts: 23692
50
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: 21452
95
Chrome Eclipse IDE Java 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!