This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes classpath settings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "classpath settings" Watch "classpath settings" New topic
Author

classpath settings

Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
I've posted something similar in the JDBC section, but I now realize that it's probably more appropriate here. My question is in setting up the java environment according to some books, I can create a "java_home" environment variable (I'm running Windows 2000) and place any jar files (such as from a vendor which contains a jdbc type 4 driver) into the "jdk\jre\lib\ext" and both the "javac" and "java" commands will find them. I'd like to forgo creating a classpath variable. I'm trying to create a java application, not a servlet or applet.
matt hooker
Ranch Hand

Joined: Jul 26, 2001
Posts: 46
Hullo.
IF jdk\jre\lib\ext is your compile time and runtime environment then yes, putting the jars in here will work for javac and java. However, if you are running a seperate runtime environment, which most people will be, this is probably at C:\Program Files\JavaSoft\... or somesuch, you will then need to put a copy of the jars in this jre\lib\ext directory to support runtime.


Its not what you do, its the way you say you've done it.
Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
Running my Java application using the "java" command doesn't seem to work unless I explicitly put in a "-classpath" statement. I put the .jar file containing the db drivers into the \jdk\jre\lib\ext directory, but they aren't found. According to the Wrox book "Beginning Java 2" I shouldn't have to use a classpath statement.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
So where are you putting YOUR class files?
Unless they are also in the \ext directory they will not be found unless they are in the classpath.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
wood burning stoves
 
subject: classpath settings
 
Similar Threads
Where to put jdbc jar files
classpath - differences between java command line argument and environment variable
Problems implementing plug-ins....!
CLASSPATH PROBLEM
Setting package classpath in cmd line - how?