Results 1 to 10 of 10
  1. #1
    Terra's Avatar
    Terra is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Exclamation Java Environment Variables Error?

    I was editing the PATH and CLASSPATH variables to use the JDK and be able to compile from command line, but I was unsuccessful. I decided to uninstall Java (both the JDK and JRE from before) and reinstall it, however I believe that I messed up the Path and Classpath variables, and am unsure how to restore them, even after searching it for well over an hour. When I run the path command in command prompt, it returns with "No Path".
    Whenever I attempt to acquire the current version via java -version (I reinstalled the JRE, not the JDK), it says that java is not recognized as an internal or external command, operable program, or batch file. Also, (due to the lack of path, I presume) when I attempt to open programs, it comes with a variation of "Could not create the Java Virtual Machine" error.

    OS: Windows XP
    (I'm almost certain that the path is wrong somehow) Current Path: C:\Program Files\Java\jre6\bin\;%SystemRoot%\system32;%System Root%;%SystemRoot%\System32\Wbem;
    (Is the classpath even needed with just the JRE?) Classpath: .;C:\Program Files\Java\jre6\bin\;
    Java bin path: C:\Program Files\Java\jre6\bin
    Any and all help would be greatly appreciated! Also, sorry for most likely sounding like an idiot in this, I attempted to research it, but was largely unsuccessful.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,873
    Rep Power
    25

    Default

    Open a command prompt and enter: PATH
    copy and paste what is shown here:
    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.

  3. #3
    Terra's Avatar
    Terra is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    That would be:

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\(My username)>PATH
    PATH=C:\Program Files\Java\jre6\bin\;C:\WINDOWS\system32;C:\WINDOW S;C:\WINDOWS\S
    ystem32\Wbem;

    C:\Documents and Settings\(my username)>

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,873
    Rep Power
    25

    Default

    That looks like the path to the jre, not the JDK. The javac command is in the JDK.

    Does the OS find the java command when you enter: java -version
    The install process puts the java.exe file in the C:\WINDOWS\system32 folder, so it is already on the PATH.

  5. #5
    Terra's Avatar
    Terra is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    Yes, it does. As evidenced by this:

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\(username)>java -version
    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

    However, I'm still getting an error that Java "could not create the virtual machine" when attempting to execute a program.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,873
    Rep Power
    25

    Default

    getting an error that Java "could not create the virtual machine"
    Can you execute the java command in a command prompt and copy the contents here.

  7. #7
    Terra's Avatar
    Terra is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    The java -version command, or just java by itself?
    Last edited by Terra; 07-07-2011 at 06:17 AM.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,873
    Rep Power
    25

    Default

    The command that returns the error message: "could not create the virtual machine"

  9. #9
    Terra's Avatar
    Terra is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    Oh, it occurs when I attempt to execute a .exe file on the desktop for the game Minecraft.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,873
    Rep Power
    25

    Default

    I know nothing about that. Still there could be error messages on the console.
    Open a console, change to the location of the .exe file and execute it.

    That's it for tonight.
    Back tomorrow.

Similar Threads

  1. Sharing Variables Among Multi-JFrame Environment?
    By rmerry in forum AWT / Swing
    Replies: 3
    Last Post: 03-07-2011, 05:39 PM
  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
  •