Results 1 to 7 of 7
  1. #1
    minty115 is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Help please, javac issues

    Hello i'm very new to java (started yesterday) And have been reading through a book i have gotten the JDK and made a command. When i went to compile it

    Java Code:
    javac Example.java
    It said something like javac is not a internal or external command.

    thankyou

    ~minty (Really new to java) (was inspired by minecraft) :)

  2. #2
    mr_guy is offline Member
    Join Date
    Feb 2011
    Posts
    18
    Rep Power
    0

    Default

    You need to type the location of where the "javac" file is and where "Example.java" is.

    e.g.
    Java Code:
     C:\Program Files\Java\jdk1.6.0_21\bin\javac C:\Users\username\Example.java

  3. #3
    minty115 is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    Thanks :D In the book it didnt say that :P. it said

    type where the .java is so

    cd C:\java

    then

    javac Example.java

    EDIT: has tried putting what you put into the run>cmd and still didnt work :P sorry.
    Last edited by minty115; 02-26-2011 at 04:19 AM.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,573
    Rep Power
    12

    Default

    See if this helps: Paths in Oracle's Tutorial.

    Whether you set the PATH variable as suggested there, or specify the full path to the javac executable on the command line (as suggested by mr_guy) you do have to use your installation directory and not the example one! And also use quotes around things with spaces in them.

    Java Code:
    >"C:\Program Files\Java\jdk1.6.0_21\bin\javac" C:\Users\username\Example.java

  5. #5
    gaborn415 is offline Member
    Join Date
    Feb 2011
    Posts
    25
    Rep Power
    0

    Default

    I used this vide4o and modifed the path variable in Windows, doing so allows you to use javac, and java commands without needing to type a full pathname prior to running the command you can just type javac, or java myprogram.java.

    YouTube - ' javac ' is not recognized

  6. #6
    YAY
    YAY is offline Member
    Join Date
    Feb 2011
    Posts
    20
    Rep Power
    0

    Default

    Quote Originally Posted by minty115 View Post
    Hello i'm very new to java (started yesterday) And have been reading through a book i have gotten the JDK and made a command. When i went to compile it

    Java Code:
    javac Example.java
    It said something like javac is not a internal or external command.

    thankyou

    ~minty (Really new to java) (was inspired by minecraft) :)
    You didn't say which OS do you have :confused:

    If windows, you just make start.bat file in notepad in your workspace with content:
    Java Code:
    path C:\Program Files\Java\jdk1.6.0_23\bin
    start
    If your location of java bins is different than C:\Program Files\Java\jdk1.6.0_23\bin simply change it.
    When you want to compile java files run this file, not cmd
    :)

  7. #7
    vallala.rk is offline Member
    Join Date
    Sep 2011
    Posts
    1
    Rep Power
    0

    Default Re: Help please, javac issues

    classnotfound exception while running sample java

Similar Threads

  1. need help with javac
    By pawanmutalik in forum New To Java
    Replies: 10
    Last Post: 02-03-2011, 07:56 AM
  2. javac
    By PhilArmstrong in forum New To Java
    Replies: 31
    Last Post: 11-21-2009, 04:46 PM
  3. javac?
    By sardare in forum Eclipse
    Replies: 1
    Last Post: 06-14-2008, 03:06 AM
  4. javac DOS
    By rdunne in forum New To Java
    Replies: 3
    Last Post: 01-01-2008, 12:49 PM
  5. Help with javaC
    By Daniel in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 03:44 PM

Tags for this Thread

Posting Permissions

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