Page 1 of 2 12 LastLast
Results 1 to 20 of 34
  1. #1
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default JAVAC is not recognized blah blah....=(

    Alright, I'm brand new into Java, meaning I started reading up and teaching myself a day or 2 ago...

    Basically, I have eclipse, my dev tools that I need, and everything ready to go, except my compiler isn't working for some reason.

    I have the JDK [C:\Program Files\Java\jdk1.6.0_23].....

    Javac.exe is in C:\Program Files\Java\jdk1.6.0_23\bin where I think it should be... and I've already un/reinstalled it.

    When I run javac -version it gives me the common "not recognized as an internal or external command" error...

    I tried looking at other similar threads but the system variable stuff is over my head still and I don't know how/where to look, or even what I'd be looking for if I did...

    I just need to get this damn compiler working so I can start running my practice exercises/experiments... =*(

    Can anyone help me on where to start to troubleshoot this or what other info I need to gather first?

  2. #2
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    Go to system properties > advanced > Environment Variables

    under user variables click new

    For "Variable Name" enter "PATH"
    for "Variable Value" enter "C:\Program Files\Java\jdk1.6.0_23\bin"

    Now you can use "javac" anywhere in any directory in the command prompt.

    "javac TestProg.java" make sure you "cd" to your *.java class file directory

  3. #3
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    Alright, I added the variable "PATH" and put the value "C:\Program Files\Java\jdk1.6.0_23\bin" but when I just type "javac" in the cmd prompt it still gives the same error, and jsut to be sure i changed the directory to where my program is that I'm trying to compile and when i did "javac test.java" it gave the same thing...

    any sugestions on where to go next?

  4. #4
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    I did that stuff first with the command prompt. But then found a nice IDE. It looks like you have Eclipse, personally I like Intellij Idea. They have a free version and it seems much nicer and easier to use then eclipse.
    After installing IntelliJ
    everything got WAY easier. It also works with android easily.


    I dont really mess with the command prompt anymore.

  5. #5
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    so IntelliJ has an android plugin for starting projects for apps?

    If this is a problem with eclipse is there a path or plugin i could change/get to make this work?

    If it helps i'm on XP 32bit

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

    Default

    Quote Originally Posted by Lance87 View Post
    so IntelliJ has an android plugin for starting projects for apps?

    If this is a problem with eclipse is there a path or plugin i could change/get to make this work?

    If it helps i'm on XP 32bit
    Look here. b.t.w. you still have that little path problem to solve.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    Yes a couple weeks ago IntelliJ came out with version 10 and its pretty nice. It works just like eclipse did, but way easier for me to set up.


    Anyway do you know the cd command in the prompt?
    type cd c:/
    cd program files
    cd java
    cd jdk1.6.0_23

    now type
    javac

    you should see a list of things pop up.
    Does this happen?
    this way is ok too.. if you make a mistake, you have to start all over though
    or type all at once
    cd C:\Program Files\Java\jdk1.6.0_23

    now try
    javac

  8. #8
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    Weird, when I C:\>cd \program files\java\jdk1.6.0_23 it gives me "Too many parameters - files\java\jdk1.6.0_23"

    Also, when I just typed cd \program files it said "Too many parameters - files"

    I can get around it by typing "cd \progra~1\java" but then it stops me again when I try to cd to jdk1.6.0.23 with the same error


    Lol Jos, I didn't know about lmgtfy...

    Anyways, guess I have to look into the path now? No effing idea what's going on with the parameter error.

    BTW, thanks guys for being super-helpful, this forum is better than I expected =)

  9. #9
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    cd \program files\java\jdk1.6.0_23
    bad
    cd c:/program files/java/jdk1.6.0_23
    good

    cd stands for change directory.

  10. #10
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    Quote Originally Posted by AcousticBruce View Post
    cd \program files\java\jdk1.6.0_23
    bad
    cd c:/program files/java/jdk1.6.0_23
    good
    Fail. here I go again...

  11. #11
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    with /program files it says invalid switch, i'm trying to mess around with it still though..

    This shit makes me feel inferior regardless of my IQ, lol

  12. #12
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    copy and paste this whole line "cd c:/program files/java/jdk1.6.0_23/bin"

    there should not be an error unless you gave me the wrong fold name.

  13. #13
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    GOT IT!

    Under "Variable Value" I had "C:\Program Files\Java\jdk1.6.0_23\bin", but it needed to be "C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe"

    My program has a cannot find symbol error but this is farther than I've gotten so far!

  14. #14
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    Haha well that may work....
    but the point of pointing it to the bin directory is so you can use all other commands in that bin folder.

    So im not sure you should point it to only javac.exe

  15. #15
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    Weird, after I did this, then went back into the environment, the variable went back to C:\Program Files\Java\jdk1.6.0_23\bin\jdk1.6.0_23....

    WTF? I don't care, it's working now, lol

  16. #16
    AcousticBruce is offline Senior Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    202
    Rep Power
    5

    Default

    haha good.

    You do know that a IDE will compile this stuff for you dont you?
    If you want to try Intellij out i will help you. Otherwise I have no expertise in eclipse.

  17. #17
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    I might get back to you on that, if you don't mind, my goal is to develop android apps, and since i'm soooo new, i'm trying to stick with the most popular programs/methods in that regard so that I have more opportunity for references/resources down the road.

    If you have a suggestion on this though,



    /**
    Disply "Test" to the standard output.
    */

    class Test{
    public static void main(String[] args) {
    System.out.PrintIn("Test");
    }
    }


    Gives me C:\JFILES>javac Test.java
    Test.java:7: cannot find symbol
    symbol : method printIn(java.lang.String)
    location: class java.io.PrintStream
    System.out.printIn("Test");
    ^
    1 error

  18. #18
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    the "^" is supposed to be pointed at the period between "out" and "printIn"...

  19. #19
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    I made printIn "print" instead and it gave me my class file

  20. #20
    Lance87 is offline Member
    Join Date
    Dec 2010
    Posts
    17
    Rep Power
    0

    Default

    Sorry for jumping the gun so much and asking questions real wuick, but like I said, I'm at work so I never know when I'm gonna get back to the PC.. =)

Page 1 of 2 12 LastLast

Similar Threads

  1. 'javac' is not recognized as an internal command
    By Infected_ in forum New To Java
    Replies: 3
    Last Post: 10-18-2010, 04:04 AM
  2. javac is not recognized command...
    By javastudent87 in forum New To Java
    Replies: 6
    Last Post: 07-30-2010, 06:50 AM
  3. Javac not recognized
    By OscarLiu in forum New To Java
    Replies: 8
    Last Post: 06-29-2010, 04:10 PM
  4. Javac is not recognized?
    By Java idiot in forum New To Java
    Replies: 4
    Last Post: 08-03-2009, 07:54 PM
  5. javac command not recognized
    By sunshine39 in forum New To Java
    Replies: 7
    Last Post: 03-04-2009, 04:54 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
  •