#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    Cant register java BIN directory PATH - oracle.com info out of date!


    Hi there,

    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:

    C:\Program Files\Java\jdk1.6.0_<version>\bin"


    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:

    Name: "javac"
    Value: "C:\_java\jdk1.7.0_21\bin\"

    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!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0
    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.
  4. #3
  5. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,724
    Rep Power
    348
    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.

IMN logo majestic logo threadwatch logo seochat tools logo