Click to See Complete Forum and Search --> : help setting classpath
benmartin101
Aug 17th, 2006, 02:45 PM
I have to work with a bunch of .jar files. I don't want to have to always do the following:
javac -cp "c:\jarFolder\aa.jar;c:\jarFolder\bb.jar;c:\jarFolder\cc.jar;c:\jarFolder\dd.jar;c:\jarFolder\ee.jar( and so on and so on)" myProg.java
How do I compile myProg.java without having to type so many ? All my .jar files are located in "jarFolder" folder.
ComputerJy
Aug 17th, 2006, 03:06 PM
insert "." at the end of your classpath, then whenever you call Javac from the any folder it will look for classes in that folder, if you want to use this folder from another path put ";C:\jarFolder;" at the end of the classpath.
ClassPath:
1- Go to System Properties from the Control Panel
2- Advanced Tab
3- Environment Variables
4- System Variables, Double click the ClassPath, and if you don't have it, add new one
benmartin101
Aug 17th, 2006, 03:42 PM
Sorry, but I don't quite understand what you mean. Where am I putting the "."? In the command line or in the System Properties(System variables)? This is what I did based on how I understood your explanation. I opened that Advanced Tab and created a CLASSPATH in the System variables. I named it CLASSPATH and the value I put a "." at the end of the classpath like so:
"c:\jarFolder\."
Then in the dos cmd line, i put:
javac StockQuoteService.java
but it didn't work.
stefano5
Aug 18th, 2006, 04:03 AM
Try c:\jarFolder\;.; :)
benmartin101
Aug 18th, 2006, 10:36 AM
In the command line after "-cp" or in the Advanced Tab->System Variabled->CLASSPATH?
ComputerJy
Aug 18th, 2006, 10:45 AM
in the classpath
benmartin101
Aug 18th, 2006, 12:57 PM
I tried putting it inthe Advanced Tab, CLASSPATH, and ran this command:
javac MyNameService.java
and I still get the "cannot find symbol" error.
CornedBee
Aug 18th, 2006, 03:00 PM
Have you listed every JAR in the CLASSPATH variable? It doesn't do automatic resolution. (Java6 will.)
I stand by my point from the other thread, though: use an IDE or an Ant build file.
benmartin101
Aug 21st, 2006, 04:44 PM
ok, i'll try that. Thanks for the responses.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.