• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple classpath  RSS feed

 
igwe kalu kalu ogba
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I've installed the jdk , but my java applications require some JAR files in order to run properly (comm.jar, jtds.jar e.t.c). Now, I know that these files should be under the variable CLASSPATH in Windows xp, 2000, nt e.t.c. But I do not want to add each path to each jar file individually each time . Is it possible to create a folder for all my java JAR files and maybe and a reference to this folder using C:\jarpath\*.jar so that I do not have to set each JAR file individually??
 
Yevgeniy Treyvus
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try putting the jars in jre\lib\ext directory.

or, you can always write your own classloader
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can use the -classpath command-line option for javac and java. This still requires you to list them out individually, but this can be automated if you use a build tool like Ant.

Layne
 
igwe kalu kalu ogba
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mmm, I dont use Ant and dont know how to use it. Putting the jars in jre/lib and even jdk/lib didn't work either. Isn't there another way? My classpath maxed out on my old machine (i.e you couldn't add anymore JARS to the variable classpath). And adding a jar each time can be quite messy. Please help
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by igwe kalu kalu ogba:
Mmm, I dont use Ant and dont know how to use it. Putting the jars in jre/lib and even jdk/lib didn't work either. Isn't there another way?


You put them into the wrong places... They should be in %JAVA_HOME%/jre/lib/ext, not %JAVA_HOME%/jre/lib or %JAVA_HOME%/lib

It will solve the problems for sure...
 
Udegbunam Morah
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the JVM automatically load all files in that ext directory?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Udegbunam Morah:
Does the JVM automatically load all files in that ext directory?


Yes, JVM automatically load all of them upon startup... So they all will be available after startup to the application...
 
igwe kalu kalu ogba
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah !! It works now, Haha.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!