Work with the excellent Sun tutorial for Getting Started. Once you have the basics going, see if my own Java Environment tips help.
In short, you will need to run a program called "javac" to compile and another called "java" to execute your code. These are both in the "bin" directory of the JDK so that has to be in the Windows path. From the command line it will look like:
What exactly are you clicking on / typing in that causes Visual Studio to appear? You need to give us more details, otherwise we'll just be guessing what you're doing, which will not make it easier to help you.
it's probably in "c:\program files\java\jdk1.6.0\bin"
once you have that in your path, open a NEW command window. type "javac -version" to make sure it works. if you get "javac is not recognized...", you've done something wrong.
let us know when you get that much working...
[ June 27, 2006: Message edited by: fred rosenberger ]
You haven't done this yet - I know because the errors you get (javac can't be found etc.) are explained in the tutorial, including what you should do if you get that error. You wouldn't be asking those questions if you had carefully followed the tutorial.
So, please, follow the tutorial - it is very easy, and takes you through the whole process in baby steps.
[ June 28, 2006: Message edited by: Jesper Young ]
that's strange... can you check to make sure the java.exe is actually there? it should be in the same spot as your javac.exe...
on my machine, i get this:
C:\Program Files\Java\jdk1.5.0_03\bin>dir java*.exe
Volume in drive C is New Volume
Volume Serial Number is 707B-DB28
Directory of C:\Program Files\Java\jdk1.5.0_03\bin
04/13/2005 03:25 AM 49,248 java.exe
04/13/2005 03:25 AM 49,269 javac.exe
04/13/2005 03:25 AM 49,275 javadoc.exe
04/13/2005 03:25 AM 49,269 javah.exe
04/13/2005 03:25 AM 49,265 javap.exe
04/13/2005 03:25 AM 49,250 javaw.exe
04/13/2005 03:49 AM 127,078 javaws.exe
7 File(s) 422,654 bytes
0 Dir(s) 1,161,285,632 bytes free
and it compiles. that means that you now have a YourClass.class file in the directory.
then you say you type
and you get an error message. assuming everything i said is correct, can you post the EXACT text of the error message? if the OS can find javac, it should be able to find java, since you say they are in the same spot...
As far as helping you run your code, Fred Rosenberger's earlier response which explained how to set the Path variable, coupled with the Java Tutorial should of got you off the ground by now.
When in the C:\Program Files\Java\JDK 1.6.0\bin directory type javac -version on the command prompt and post your output.
follow Keith's directions to open up the environment variables. select the path one, then at the very end, put in a semi-colon, then the directory, everything from the c: to the final /bin part.
you can then open a dos/command prompt, and type
make sure the command window is opened AFTER you save the change to your path variable. you should see your new directory there.
if so, you should then be able to type "java -version" and get something meaningful.