• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Class Path Issue with jar execution

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to execute a jar with classpath configuration via bat file:



-- Projects
-- Projects\run_app.bat
-- Projects\Demo-App.jar
-- Projects\lib\classes12.zip

Issue: It is not able to load the classes12.zip. I checked with -verbose. I even tried with complete path instead of relative path.

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When running an executable jar file the CLASSPATH environment variable is not used.
It only uses the classpath as defined in the Manifest.

And...how old is your Oracle instance?
classes12.zip has not been the driver for must be close to 15 years now.
 
Jigar Gohil
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:When running an executable jar file the CLASSPATH environment variable is not used.
It only uses the classpath as defined in the Manifest.

And...how old is your Oracle instance?
classes12.zip has not been the driver for must be close to 15 years now.



Thanks Dave, for quick reply

Oracle 10g and classes12 works for it when I use it with independent class file. My problem is when i package that file in a jar and try to refer it from outside.

- Is there a way by which I can keep the dependent jar outside and set it in the classpath? Like here I do not want to keep the classes12 as part of my App jar and wants to refer it from outside.

Regards,
Jigar
 
Sheriff
Posts: 28438
104
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jigar Gohil wrote:Is there a way by which I can keep the dependent jar outside and set it in the classpath? Like here I do not want to keep the classes12 as part of my App jar and wants to refer it from outside.



Yes, like Dave said you put the class path into the executable jar's manifest. I'd suggest you read through the Oracle tutorial about jar files to get the necessary background -- https://docs.oracle.com/javase/tutorial/deployment/jar/
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jigar Gohil wrote:
Oracle 10g and classes12 works for it when I use it with independent class file.



You should be using the version of the JDBC driver that applies to your version of Oracle, and/or your version of Java.
This is the Oracle page for 10g (release 2).
Unless you are using a pre-1.4 version of Java you should be on a much much newer version of the driver.
 
Goodbye moon men. Hello tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic