Results 1 to 10 of 10
- 07-05-2011, 11:32 PM #1
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.
- 07-05-2011, 11:38 PM #2
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.
- 07-07-2011, 04:52 AM #3
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)>
- 07-07-2011, 04:57 AM #4
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.
- 07-07-2011, 05:09 AM #5
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.
- 07-07-2011, 05:13 AM #6
Can you execute the java command in a command prompt and copy the contents here.getting an error that Java "could not create the virtual machine"
- 07-07-2011, 05:14 AM #7
The java -version command, or just java by itself?
Last edited by Terra; 07-07-2011 at 05:17 AM.
- 07-07-2011, 05:15 AM #8
The command that returns the error message: "could not create the virtual machine"
- 07-07-2011, 05:17 AM #9
Oh, it occurs when I attempt to execute a .exe file on the desktop for the game Minecraft.
- 07-07-2011, 05:28 AM #10
Similar Threads
-
Sharing Variables Among Multi-JFrame Environment?
By rmerry in forum AWT / SwingReplies: 3Last Post: 03-07-2011, 04:39 PM -
Path in Environment Variables already occupied
By missrose1991 in forum New To JavaReplies: 0Last Post: 02-25-2011, 01:07 PM -
how to create environment variables
By elizabeth in forum Advanced JavaReplies: 4Last Post: 08-02-2007, 04:53 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks