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
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"
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.
> 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