Javac can't find my file...

I have put javac into my PATH so now it recognizes javac but now it can't find my HelloWorld.java that is on my desktop. Is a certain folder I need to put my source in?Thanks for any help.Also, if it matter I have XP sp2
[249 byte] By [masnorka] at [2007-11-27 10:05:26]
# 1
Well, where are you compiling from? It won't magically scan your entire hard drive looking for a file
georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 2
My file is on my desktop so where should put it?
masnorka at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 3
Should I put it in /bin with the javac file?
masnorka at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 4

Wherever you want, theoretically. Probably a good idea to get into the habit of keeping source code at least somewhere vaguely sensible. Just sticking them on your desktop is a bad idea. But the crux of the matter is, you need to invoke the javac compiler either from the folder the source code is in, or by specifying a path to the source code. Read the basics tutorial for more. The forum may be "new to Java" but it isn't intended as a replacement for reading a tutorial, more to help you when you don't understand something

georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 5
> Should I put it in /bin with the javac file?No! Do yourself a favour. Put the compiler down for now, and do some reading
georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 6
Ok you tell me to read and I look around but where are the tutorials?
masnorka at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 7
> Ok you tell me to read and I look around but where> are the tutorials?You found this place, didn't you? If only you could apply what you did to find this, to something else......
georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 8
Ok I found the tutorial I did a cd command in the directory I have my source in then I do "javac helloworld.java" and I get and error saying "error: Class names, 'helloworld',are only excepted if annotation processing is explicitly requested."
masnorka at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 9

Sorry, I know this sounds harsh, but I'm not getting into holding your hand through what you should find out for yourself. If I do, you'll be reliant on someone helping you with everything else, and never get anywhere. Trust me, go read a tutorial. All of it. From start to finish. You've probably just scanned it for certain key words like "compile"

georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 10
Hey nice guy I did it myself!!!!!!!!!!!!!!!!!!!
masnorka at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 11
Told you so
georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 12

just do one thing...

Right click on your My Computer icon on the Desktop.

Click on properties button.

Click on advanced tab.

Click on Environment variable button.

In system variables list select the path variable.

Click on edit button.

Do not change the previous path.

Just append semicolon " ; " if the previous path doesen't ends with it.

Now append absolute path of your java bin directory which must be like

C:\j2sdk1.4.0\bin; there.

Click OK button

Do it 2 times more for closing all the dialog boxes.

Now you can keep your files anywhere in your file system.

To run them just go into that directory.

Suppose you have kept them in C:\abc\xyz folder

then cd c:\abc\xyz

and then run java file as

javac filename.java

java filename

Thats all.

i am sure that it must work.

Friend4evera at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...
# 13

> just do one thing...

> Right click on your My Computer icon on the Desktop.

> Click on properties button.

> Click on advanced tab.

> Click on Environment variable button.

> In system variables list select the path variable.

> Click on edit button.

> Do not change the previous path.

> Just append semicolon " ; " if the previous path

> doesen't ends with it.

> Now append absolute path of your java bin directory

> which must be like

> C:\j2sdk1.4.0\bin; there.

> Click OK button

> Do it 2 times more for closing all the dialog boxes.

> Now you can keep your files anywhere in your file

> system.

> To run them just go into that directory.

> Suppose you have kept them in C:\abc\xyz folder

> then cd c:\abc\xyz

> and then run java file as

>

> javac filename.java

>

> java filename

>

> Thats all.

> i am sure that it must work.

That's considerably more than one thing

georgemca at 2007-7-13 0:40:29 > top of Java-index,Java Essentials,New To Java...