Results 1 to 10 of 10
  1. #1
    freelance84 is offline Member
    Join Date
    Jul 2011
    Posts
    8
    Rep Power
    0

    Default 'javac' not recognisable even after Environment Variables.

    Hi,

    I'm am completely new to Java. Previous coding has been solely web based (php, js...ect).

    I am following this guide. I have installed jdk1.6.0_26, i have followed the installation problems guide and written into the Environmental Variables the following: C:\Program Files\Java\jdk1.6.0_26\bin\ and named them 'javac'...

    However I am still getting the ''javac' is not recognized as an internal or external command, operable program or batch file'...

    I've tried unistalling and reinstalling but that hasn't changed anything... Does anyone know what I'm missing? i would very much appreciate a helping hand here... i've been trying to just do the hello world now for a few hours and i cant compile it..

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Go to the directory you put in your path environment variable; do you see a javac.exe file in that directory?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    freelance84 is offline Member
    Join Date
    Jul 2011
    Posts
    8
    Rep Power
    0

    Default

    yup... C:\Program Files\Java\jdk1.6.0_26\bin\javac.exe

    It's all there... i dont get it.

  4. #4
    freelance84 is offline Member
    Join Date
    Jul 2011
    Posts
    8
    Rep Power
    0

    Default

    yup... C:\Program Files\Java\jdk1.6.0_26\bin\javac.exe

    It's all there... i dont get it.

  5. #5
    freelance84 is offline Member
    Join Date
    Jul 2011
    Posts
    8
    Rep Power
    0

    Default

    Well, i found a remote compiler: JXXX Compiler Service

    Compiled the basic HelloWorld.java, tried to run it from CMD but it failed... really don't understand what i'm doing wrong... i've attached an image of the error...
    Attached Thumbnails Attached Thumbnails 'javac' not recognisable even after Environment Variables.-capture.jpg  

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    You should run it as:

    Java Code:
    java HelloWorld
    (skip the .class part). Also check your path variable for typos. If the path really points to the directory where javac.exe is stored you should be able to run it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Quote Originally Posted by freelance84 View Post
    ... and written into the Environmental Variables the following: C:\Program Files\Java\jdk1.6.0_26\bin\ and named them 'javac'...
    Are you saying you named the environment variable javac?
    That path should be added to the PATH variable.

  8. #8
    freelance84 is offline Member
    Join Date
    Jul 2011
    Posts
    8
    Rep Power
    0

    Default

    Ooooo... :) thank you very much Tolls and Jos

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    You can show us your PATH variable by opening a command prompt and entering: PATH
    Here's what I get
    Java Code:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    
    D:\Norms\Norms Tools>path
    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Ja
    va\jdk1.5.0_04\bin;C:\BatchFiles;C:\Program Files\Support Tools\;C:\WINDOWS\syst
    em32\WindowsPowerShell\v1.0;C:\Program Files\QuickTime\QTSystem\
    
    D:\Norms\Norms Tools>
    You can copy the contents of the command prompt by:
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

  10. #10
    Join Date
    Jul 2011
    Posts
    11
    Rep Power
    0

    Default

    after installing java check for JRE too

    JRE will only execute ur program

    go to enviromental variables ---> sys variables --> go to path --> edit --> copy the jdk bin folder path

    save .... apply .... restart ur sys once

    becoz javac app resides in jdk bin folder .... so u have to choose that path ......

Similar Threads

  1. Java Environment Variables Error?
    By Terra in forum New To Java
    Replies: 9
    Last Post: 07-07-2011, 06:28 AM
  2. Path in Environment Variables already occupied
    By missrose1991 in forum New To Java
    Replies: 0
    Last Post: 02-25-2011, 02:07 PM
  3. how to create environment variables
    By elizabeth in forum Advanced Java
    Replies: 4
    Last Post: 08-02-2007, 05:53 AM

Posting Permissions

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