|
-
Aug 17th, 2006, 02:45 PM
#1
Thread Starter
Frenzied Member
help setting classpath
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.
-
Aug 17th, 2006, 03:06 PM
#2
Re: help setting classpath
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
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 17th, 2006, 03:42 PM
#3
Thread Starter
Frenzied Member
Re: help setting classpath
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.
-
Aug 18th, 2006, 04:03 AM
#4
Addicted Member
Re: help setting classpath
Try c:\jarFolder\;.;
-
Aug 18th, 2006, 10:36 AM
#5
Thread Starter
Frenzied Member
Re: help setting classpath
In the command line after "-cp" or in the Advanced Tab->System Variabled->CLASSPATH?
-
Aug 18th, 2006, 10:45 AM
#6
Re: help setting classpath
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 18th, 2006, 12:57 PM
#7
Thread Starter
Frenzied Member
Re: help setting classpath
I tried putting it inthe Advanced Tab, CLASSPATH, and ran this command:
javac MyNameService.java
and I still get the "cannot find symbol" error.
-
Aug 18th, 2006, 03:00 PM
#8
Re: help setting classpath
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 21st, 2006, 04:44 PM
#9
Thread Starter
Frenzied Member
Re: help setting classpath
ok, i'll try that. Thanks for the responses.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|