This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've downloaded a few Java programs that use other class libs. Now I had to add those to my CLASSPATH. The question I have is do I need to explicity add a JAR like this: SET CLASSPATH=.;c:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\lib\tools.jar;c:\java\hsql\hsql.jar;f:\jaxp1.0.1\jaxp.jar;f:\jaxp1.0.1\parser.jar;%CLASSPATH% Or can I just simply tell it what directory those JARS are in? My CLASSPATH is getting huge and I will probably download more Java stuff in the future that calls for adding yet more stuff to my CLASSPATH. This is not a real big issue but something that bugs me. Keep in mind that everything is working, This is just something I'm concerned about. Thanks, Frank
If you are using Java 2, you can just put the jarfiles in the lib/ext directory and they will be picked up automatically. For Java 1.1, you still have to have a long classpath. If there are jars which you only use for one or two programs, you can add them to the classpath just before they are used either in a batch file/shell script: <pre> set CLASSPATH=mail.jar;activation.jar;%CLASSPATH% java MyStuff </pre> or using the classpath command line parameter <pre> java -classpath "mail.jar;activation.jar" MyStuff </pre>