Click to See Complete Forum and Search --> : Need your help!
DarkVader
January 16th, 2003, 11:50 AM
Hi
I have set the path for my jdk. But, i still have to put all my JAVA programs in the subfolder "BIN" for them to compile and execute correctly. If I run a JAVA program which is not stored in the subfolder "BIN", it does not work.
Can anyone help me?
Thanks in advance!
Goodz13
January 16th, 2003, 12:26 PM
What OS(including version) are you using, where did you set the path, what is the line that you used to set the path?
dlorde
January 16th, 2003, 05:48 PM
What is the error message you get when 'it does not work'?
The usual cause of directory related problems trying to run Java applications is an incorrect classpath setting. The classpath must be set to include all the directories that contain classes used by the application, and all jar files used - this includes the current directory.
Here's to the happiest days of my life,
Spent in the arms of another man's wife -
My mother...
DarkVader
January 18th, 2003, 01:33 AM
I am using Windows XP. I made use of environmental variables PATH and CLASSPATH.
Both my PATH and CLASSPATH variables contain: c:\jdk1.4;c:\jdk1.4\bin
DarkVader
January 18th, 2003, 02:11 AM
If i got put my java programs in the subfolder BIN, i got this error
noclassdeffoundexception
dlorde
January 18th, 2003, 06:00 AM
Previously you said it didn't work unless the class files were in the bin directory, now you say you get NoClassDefFoundException if they're in the bin directory (that is what you said isn't it?)...
Whatever, a NoClassDefFoundException means you have not included the specified class on the classpath.
<sigh> I can only repeat what I said before:The classpath must be set to include all the directories that contain classes used by the application, and all jar files used - this includes the current directory.In case it isn't clear, this includes the application's class directory too.
It is not a good idea to put your Java classes in the JDK bin directory (or any other JDK directory).
Under a spreading gooseberry bush the village burglar lies,
The burglar is a hairy man with whiskers round his eyes
And the muscles of his brawny arms keep off the little flies...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.