Cannot Read...
Hey,
Im trying to compile my first .java file but when i type the command javac helloworld.java it returns the message 'cannot read: HelloWorld.java'
im really new to this, and must be doing something wrong, i have tried all possible avenues including the javac sourcepath <C:\MyDocument\HelloWorld.java> and it still wont work
please can someone help me out?
thanks in advance
[418 byte] By [
suzea] at [2007-10-2 14:48:05]

thank you i will try that, although i did enclose the file name " " so im not sure why it would read as a .txt file, and when i right clicked and looked at the properities it does say its a .java file?
suzea at 2007-7-13 13:23:29 >

> thank you i will try that, although i did enclose the
> file name " " so im not sure why it would read as a
> .txt file, and when i right clicked and looked at the
> properities it does say its a .java file?
It was just a guess on my part. The problem could be something different. The error comes from javac and means javac could not read the file. Be sure to use the 'dir' command to see if the file exists. May be the file is in use? I recommend that you use "javac HelloWorld.java" instead of "javac helloworld.java" You should get in the habit of using the same case since java is case sensitive even though Windows is not.
Hi,
Its simple problem. Its becoz eventhough u had saved what typed on notepad as HelloWorld.java, its HelloWorld.java.txt. So a rename is needed. For that goto command prompt and use the command
ren HelloWorld.java.text HelloWorld.java
Then compile using the command javac HelloWorld.java
and run using
java HelloWorld
regds
Anish.A.R