Tweak'd
10-19-2006, 10:47 AM
Hello,
I've been using Java at school and now I'm trying to get it set up at home.
My .java and .class files are located in the same folder, called E:\School\Java\. I've set the CLASSPATH variable to that folder, in the Environment Variables in WinXP.
I have a HelloWorld.java and a HelloWorld.class file in the CLASSPATH folder.
Typing java HelloWorld in the command line executes the class file.
However, typing javac HelloWorld.java tells me that it cannot read HelloWorld.java. When I include the CLASSPATH in the javac call, like this javac %CLASSPATH%HelloWorld.java, it compiles the source file, like it should.
Some hours of Googling and experimenting lead me nowhere. I did learn that javac looks in the CLASSPATH folder for sourcefiles, unless the sourcepath option is set. That only made me more confused, since it only confirms that the problem shouldn't occur.
But I'm no expert and I must have done something wrong. I'd be very greatful if someone could help me out here.
Thanks.
I've been using Java at school and now I'm trying to get it set up at home.
My .java and .class files are located in the same folder, called E:\School\Java\. I've set the CLASSPATH variable to that folder, in the Environment Variables in WinXP.
I have a HelloWorld.java and a HelloWorld.class file in the CLASSPATH folder.
Typing java HelloWorld in the command line executes the class file.
However, typing javac HelloWorld.java tells me that it cannot read HelloWorld.java. When I include the CLASSPATH in the javac call, like this javac %CLASSPATH%HelloWorld.java, it compiles the source file, like it should.
Some hours of Googling and experimenting lead me nowhere. I did learn that javac looks in the CLASSPATH folder for sourcefiles, unless the sourcepath option is set. That only made me more confused, since it only confirms that the problem shouldn't occur.
But I'm no expert and I must have done something wrong. I'd be very greatful if someone could help me out here.
Thanks.