File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath settings

 
Steve Campbell
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Steve Campbell
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic