June 15th, 2013, 09:02 PM
Cant register java BIN directory PATH - oracle.com info out of date!
Just trying to get started using java and everything. I'm stumped at registering JDK's BIN directory as a PATH variable though. Seems the information on oracle.com's guide for doing this is out of date. Relevant excerpt below:
"How do I set the PATH permanently?
Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000.
Click Advanced > Environment Variables.
Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:
Well i figured my way into the ENVIRONMENT VARIABLES section from the above guide, but after that? Sorry but the above is just asking me to add ONE variable, nowadays they come in pairs you have to have a variable NAME and a variable VALUE.
My java stuff is all installed in c:\_java\ so heres what I've put in both the top and bottom sections:
but this doesnt work. What is missing? If anyone here can update/ask them to update this for modern times on oracle website, that might prove useful.
The end result of all this of course is that in CMD "javac" is not a recognised command.
All help is appreciated!
June 15th, 2013, 09:23 PM
Never mind I managed to figure it out (but that page still needs updating).
Turns out your meant to have PATH as the variable name, then jdk path as the value.
The weird thing is i'm sure I had something else with a PATH value already, but now i cant see it any more. Can you only have one custom directory for programs in dos?
ANYWAY, I have ANOTHER problem now. I put in the command for JavaC to compile the code.
* It must find the file because it doesnt bring up any error messages and/or spam its help info back out.
* It must compile it correctly because it gives no errors at all.
But it doesnt make a class file.
My understanding is it will make a .class file in the same file as the .java file. Its not giving error messages, i type the command, enter it. It pauses for a moment like its doing something, then thats it, its back waiting for a command.
Just to be clear, it doesnt give an error message, BUT it doesnt give any sort of "compile completed" message either. But still just produces no class file.
June 16th, 2013, 07:17 AM
I don't know why there isn't a .class file. javac doesn't give any message if there are no errors.
For a test, make a syntax error in the .java file, compile it and see if the javac command gives an error message.