Results 1 to 11 of 11

Thread: Java Nwebie Problem

  1. #1

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Resolved Java Nwebie Problem

    I'm trying to use the Java compiler command in Command Prompt ("javac") to compile my source code. The ("java") command works right but when I go to use the ("javac") command my Command Prompt tells me that it's not recognized as an internal or external command and I don't understand why because it was working earlier this evening. What's wrong here?
    Last edited by GamerMax5; Nov 11th, 2005 at 12:06 AM.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  2. #2
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Java Nwebie Problem

    You might be using one of the following java packages:

    jre = Java Runtime Environment
    jdk = Java Developer Kit

    Jar, Java, Javac, etc... are located in the /bin directory of your java folder.

    Firstly find your java directory, as an example mine is: C:\Program Files\Java\jdk1.5.0_05\bin

    Now go into the command prompt and type the command PATH

    Look at the path, if your java directory isn't in it, you need to add the directory to it, this can be done like this:

    path=%path%C:\Program Files\Java\jdk1.5.0_05\bin

    Replace 'C:\Program Files\Java\jdk1.5.0_05\bin' with your java directory.

    You will have to do this everytime you visit the command prompt as it isn't saved, i don't know how to save it, but i'm sure there is a way. Maybe someone else on here knows.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Java Nwebie Problem

    In the path command there's a typo. Should be:
    path=%path%;C:\Program Files\Java\jdk1.5.0_05\bin

    Note the semicolon after the second %.

    To save it, go to Control Panel->System->Advanced->Environment Variables.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Java Nwebie Problem

    Okay to save the path to the SDK in the Environment Variables, I edit the one that's currently there?

    EDIT: I changed the path variable value but I have another question. What exactly does that do?
    Last edited by GamerMax5; Nov 10th, 2005 at 02:58 PM. Reason: Figured it out
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Java Nwebie Problem

    The path variable is where the OS looks for executables when you enter their name without a full path.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Java Nwebie Problem

    Oh so it's sort of like an auto complete feature for executables without a full path?
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Java Nwebie Problem

    Yeah, sort of.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Java Nwebie Problem

    Hey thanks all.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  9. #9
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Java Nwebie Problem

    Quote Originally Posted by CornedBee
    In the path command there's a typo. Should be:
    path=%path%;C:\Program Files\Java\jdk1.5.0_05\bin

    Note the semicolon after the second %.

    To save it, go to Control Panel->System->Advanced->Environment Variables.
    The semi-colon is not necessary, i type the path the way i said on the computer at my university all the time, and it works every time.

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Java Nwebie Problem

    Perhaps the original path at your university is ;-terminated to begin with?
    Envvar substitution is stupid; I very much doubt Windows would realize you're concatenating two paths.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Java Nwebie Problem

    Quote Originally Posted by CornedBee
    Perhaps the original path at your university is ;-terminated to begin with?
    Envvar substitution is stupid; I very much doubt Windows would realize you're concatenating two paths.
    The original path at my university isn't ; terminated, nor is the path on my own computer, and i never use ; when setting the path. I assume that ; is optional.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width