Thread: Setting 'Path' (Fixes javac is not a recognized as an internal or external command)

Results 1 to 2 of 2
  1. #1 Setting 'Path' (Fixes javac is not a recognized as an internal or external command) 
    Banned

    Join Date
    Oct 2008
    Posts
    842
    Thanks given
    81
    Thanks received
    53
    Rep Power
    0
    Note: I realize that some people will probably flame me for posting this as it's simple. But honestly, some people don't know how to do this and there is almost always a help thread based off this issue.

    I have looked around on these forums for a while and I realize that a few people use "C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe *.java" to compile their classes. Well there is a solution, why not just set an environment variable?

    Instead of compiling using that long code you can just use 'javac *.java' which in my opinion is better as it is smaller.

    Step 1:

    You'll need to find where the java compiler (javac.exe) is located

    So it will be somewhere like "C:/Program Files/Java/jdk_version/bin/javac.exe"

    Once you find that, note it down in notepad or something.

    Example of what I got: "C:\Program Files\Java\jdk1.6.0_20\bin"

    Step 2:

    Right-click My Computer and then select properties

    Click the advanced tab and then click the environment variables button

    Step 3:

    Under 'User variables' click 'New' and name the variable Path

    Now for the variable value field add the path of the Java compiler which you found earlier

    Step 4:

    Press 'Ok' and then you're done

    Now instead of compiling using that long command line code you can just use javac which will do exactly the same thing.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2009
    Posts
    20
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Yeah, its easy. But hey, thanks for helping out some noobs.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 12
    Last Post: 10-31-2010, 10:22 PM
  2. Replies: 1
    Last Post: 04-27-2010, 01:34 AM
  3. Replies: 15
    Last Post: 02-20-2010, 08:31 PM
  4. Replies: 10
    Last Post: 05-31-2009, 01:42 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •