Results 1 to 7 of 7
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    193
    Rep Power
    7

    Exclamation Reinstalled Windows, JAVAC in command promt gives me error

    So I have reinstalled windows, downloaded Java, and then JDK, Java installed JRE 7, but as I installed JDK, it was a newer version and for some reason also installed JRE 8. I've then went and uninstalled Java 7 in the Programs and Features from the control panel. Then I went to "C:\Program Files\Java\jdk1.8.0_05\bin" and I had copied this (without the quotes) into User Variables, new variable called "Path" and the value of "C:\Program Files\Java\jdk1.8.0_05\bin". I press OK on all the windows, run command prompt, type javac. It gives me error, java works, javac doesn't.

    EDIT: Sorry, Code and Error:
    Java Code:
    Microsoft Windows [Version 6.1.7600]
    Copyright <c> 2009 Microsoft Corporation. All rights reserved.
    
    C:\Users\COMP>javac
    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/Object
    Please help, Thanks
    Augustas
    Last edited by augustas656; 04-18-2014 at 09:24 PM.

  2. #2
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    311
    Rep Power
    10

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    Go to programs and features and uninstall everything (java) and then download and install fresh new jdk (you don't need to install jre additionally). If it goes ok you wouldn't need to set path by your self.
    Before installing jdk, delete user variable "path" you have created previously to avoid potential problems with new installation. The installation it self should put correct path to bin folder in System Variables "Path" and everything should work. After installation try again both java and javac commands in cmd.
    If it doesn't work again then add correct path for your jdk-bin directory to System Variables "Path" (be careful not to accidentally delete existing paths and separate them with semicolon (;) from new one.
    If it still doesn't work, you will need to uninstall it again and clean registry from leftovers (google for some cleaners) and then to install it again...

    Good luck
    Last edited by milovan; 04-19-2014 at 01:50 AM.

  3. #3
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    193
    Rep Power
    7

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    I don't have a user path variable that goes on like value;value;value;value;value;, so I don't need to put the semi-colon, there's no other variable with the name Path.
    Last time I did this, it didn't have path and javac worked when I did it right, somehow, but as I said I never had semi-colons seperating the many path values. And it was the same before, and it did work.

    I'ma try what you said, just telling you abuot the semicolons.

  4. #4
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    311
    Rep Power
    10

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    Well, in User Variables you probably don't have semicolons since you only have one path inside, the one you have put. I am talking of System Variables "Path". There is already some paths to some programs inside and they are separated with (;). So be careful not to delete them when adding new one...

  5. #5
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    7

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    Can you open a command line (cmd.exe) and check the path (set path)?

    I think that your path for Java was added at the end and maybe there is a javac earlier in the path. (Maybe in windows or system32 directory)

    You could check that with putting your path at the first location:
    Set path=C:\Program Files\Java\jdk1.8.0_05\bin;%path%
    Inside the cmd window and afterwards try javac again.

    With kind regards,

    Konrad

  6. #6
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    193
    Rep Power
    7

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    Not sure, eclipse works for me, so I don't think this is an issue though anymore.

  7. #7
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    311
    Rep Power
    10

    Default Re: Reinstalled Windows, JAVAC in command promt gives me error

    magic...

Similar Threads

  1. Replies: 28
    Last Post: 06-10-2012, 04:48 AM
  2. Error with javac and java command
    By pateldpk in forum New To Java
    Replies: 3
    Last Post: 04-13-2012, 05:53 PM
  3. Help with JAVA and command promt!
    By Sinfonian22291 in forum New To Java
    Replies: 5
    Last Post: 03-05-2011, 05:35 PM
  4. Replies: 2
    Last Post: 03-31-2010, 01:26 AM
  5. Class Not Found command promt
    By TenF in forum New To Java
    Replies: 9
    Last Post: 08-18-2009, 01:36 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
  •