• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to export CLASSPATH variable?

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
Currently i've set up the CLASSPATH variables in a BAT file for a few softwares (Jdk, tomcat, apache, mysql). I'm using Windows 2000. The problem is that when i launch Tomcat4.0.6, it opens on a new console, but there the tomcat couldn't fine mysql.jar file which is already in the CLASSPATH.
Hence, i doubt that the classpath variable is not exported to the new console.
Is there are way to pass the CLASSPATH variable to the new console?
Thanks in advance..
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problem is that Tomcat ignores the environment CLASSPATH setting entirely. Believe me, this is a good thing when you are trying to develop web applications because you don't have to keep fooling with the environment.
Jars that your servlet needs to run should be placed in one of the Tomcat directories according to how they need to be shared among the various applications. All this is discussed in the tomcat-docs that got installed with your Tomcat. Note that we have a Tomcat discussion area here on JavaRanch.
Bill
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have jars that are dependent on other jars or paths (including wars), you can place that information in Manifest.mf in the META-INF directory of the jar.
 
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't have to do that at all. Anything you want on the classpath, simply package it in a jar and then add it to one of tomcat's lib folders (depending on what level you want it "seen" at)
${tomcat}/server/lib
or
${tomcat}/shared/lib
or
${tomcat}/common/lib
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, if you don't mind being locked into Tomcat forever. What if you have a large development team using different servers with standard jars of common code in different web applications? It doesn't make sense to use directories that are dependent on the web server implementation. What if I want to move everything to WebLogic or WebSphere? I would need to copy all those jars to the specific directories of those implementations instead of just dropping the ears and wars into the server root.
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
How to specify the classpath in the manifest file. Please show me the syntax.
Thank you,
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a sample:

Note that each entry must have a space after each entry before a newline including the Class-Path: line and must not contain any ^Ms, so make sure your editor uses clean new lines.
 
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic