Results 1 to 9 of 9
  1. #1
    Spadge is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default [SOLVED]JDK Configuration trouble

    So I just installed the JDK and I'm having some troubles.

    I've scoured google and exhausted every possibility, there must be something I'm missing

    I'm very new to Java so I'm just trying to configure it at the moment and I'm getting this error when I try to compile my code.



    I understand that this is usually a PATH or CLASSPATH problem, trust me I've been over it.


    This is what I get returned when I check the PATH. (I've just noticed, the dir is there twice... not too sure why that is.)

    Anyway, I read somewhere that it might have something to do with the javac file itself and to confirm this I ran javac.exe and got this:


    To my knowledge, this sort of return indicates that the .exe is fine.

    My CLASSPATH variable is: .;C:\Programs Files\Java\jdk1.6.0_24\lib\tools.jar

    My PATH variable is: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Progam Files\Java\jdk1.6.0_24\bin

    I've tried this with ';' and '\' on the end of bin.

    I can also confirm that the pathfiles are correct, both java and javac are in the bin folder and tools.jar is in the lib folder.

    I'm literally stumped, I also get the feeling that it's going to be something really simple and I'm going to look like an idiot but at this point I'm willing to take that hit.

    I'm running win7 64bit if that helps, if you guys could shed any light on this I would be really grateful. thanks in advance for any help you can give.
    Last edited by Spadge; 04-07-2011 at 08:21 PM. Reason: solved

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Just forget about all the stuff you've done.

    Open the command prompt and type the command "javac" and press enter. What happen?

  3. #3
    Spadge is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    This happen:


    All of my hate.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Fine. As the system says your OS cannot find that javac as a recognized command. So you've to do something more. That's configuring the CLASSPATH.

    You can set the classpath in two models, either temporary or permanently.

    Lets do it temporary to confirm that installation is fine. On your command prompt change the working folder to the folder location where your java class file is located, using CD command.

    Then type the following, and press enter.

    >path=C:\Programs Files\Java\jdk1.6.0_24\bin
    Nothing will happens. You just prompt for the next command. Now type the "javac" command and press enter. What happen?

  5. #5
    Spadge is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default


  6. #6
    Join Date
    Apr 2011
    Posts
    36
    Rep Power
    0

    Default

    Spadge, you have two ;; on your PATH variable, try with just one ; and that way you'll have a permanent variable on your system.
    There is not knowledge that it is not power!
    buyapentiumjerk.blogspot.com

  7. #7
    Spadge is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    I noticed that too, which confused me because my PATH variable only has one ';'

    I restarted my computer and ran it again, now it returns the right information.



    unfortunately I still get the javac error. :/

  8. #8
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    there is an error in the entry for java in your path: c:\Progam Files ... when you make a call to your javac.exe and its found the path is c:\Program Files\... so correct this in your path variable and try again.

  9. #9
    Spadge is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    ahahaha, hours and hours of trying to figure it out and it was a simple typo.

    I could not feel more stupid (I also noticed that my CLASSPATH is C:\Program's' Files... haha.)

    It compiles now thankyou (although now I have compile errors but I can fix those myself.)

    Thankyou for your help guys, I'll be sticking around the forums while I work through Java so expect me to embarrass myself some more.
    Last edited by Spadge; 04-07-2011 at 08:20 PM. Reason: forgot to close parentheses... I should not be learning java if I cant remember to do that.

Similar Threads

  1. Configuration via Annotations
    By Pinas in forum Advanced Java
    Replies: 1
    Last Post: 03-11-2011, 07:08 PM
  2. dataSource configuration
    By videanuadrian in forum New To Java
    Replies: 4
    Last Post: 12-14-2010, 08:01 AM
  3. JVM configuration, -xmx over 4 gb
    By tolja in forum Advanced Java
    Replies: 3
    Last Post: 06-30-2010, 12:09 PM
  4. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  5. svn and configuration files
    By caffeine in forum New To Java
    Replies: 1
    Last Post: 08-21-2008, 04:14 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
  •