I have a problem starting Intellij IDEA (15.0.3) in 64 bit mode. When clicking on the idea6.exe I get this error (Failed to create a JVM error code -6):
This is my configuration:
System:
Windows 7 - 64 bit - 16GB RAM
System Variables:
IDEA_JDK_64: C:\Program Files\Java\jdk1.8.0_74
JVM_HOME: C:\Program Files\Java\jdk1.7.0_79
(1.7 version is needed for my dev activity)
vm options: idea64.exe.vmoptions left as default
As a trial: I've tried various combinations like system variables pointing to the same JDK path or also to increase -Xmx value in idea64.exe.vmoptions, but the error is still there.
What can the root cause be?
Thank you very much.
I solved problem in my case by deleting file C:\Users\username\.IdeaIC2016.2\idea.exe.vmoptions, because I created it before to customize VM options. File can have name idea64.exe.vmoptions if you overrode options under 64-bit version of Intellij IDEA.
Tracked it down to a mis-typed VM option in the end.
Somehow one of the lines in my idea64.exe.vmoptions file has been mis-typed. Instead of -XX:UseParNewGC I had -XX:USeParNewGC (note the unwanted extra capital letter).
Correcting that fixed the problem - so check your .vmoptions file for typos if you get the -6 error on startup.
And note that there may be several copies of this file. The default is in the installation folder (eg "Program Files (x86)\Jetbrains\Intellij 2016.1\bin\idea64exe.vmoptions"), but if you select "Help...Edit Custom VM Options" in the IDE it will create an override file in \Users\.IntellijIdea2016.1\idea64exe.vmoptions
I experienced the same issue with IntelliJ IDEA 2016.1.3 on 64bit Windows 7 with JDK1.8.0_92.
Executing idea.bat instead of idea.exe worked for me.
I think issue caused because you are using 32 bit launcher, and it has limitation as 4G for RAM.
So, if you will change value "-Xmx" to 2048 in c:\users\XXXXXX.WebStorm2016.3\webstorm.exe file -> this should help. Otherwise -> delete this file and wait when WebSrotm propose you to change it from IDE
Note: there are also webstorm.exe and webstorm64.exe files in your c:\Program Files
Had same problem, any option in studio64.exe.vmoptions led to this window.
Fixed by changing entry in PATH, it had old JDK folder, which pointed to different Java installation(Java 7) than JAVA_HOME(Java 8), after replacing it — Android Studio started normally with entries in studio64.exe.vmoptions file.
For me, using Intelli J Idea Community Version 2017.3, I found the idea.exe.vmoptions file in C:\Users\${UserName}.IdeaIC2017.3\config. I had increased the JVM Heap Memory to 4096MB from 512MB due to an earlier crash (-Xmx4096m). Changing to 1024MB seemed to do the job.
For me it worked once i deleted the vmoptions file created under the C:USERS.IntelliJIdea2017.2\config folder.
Related
I just installed Android Studio on Elementary OS 0.3 Freya and run it using the terminal. On my first start-up, however, there's an error message shown:
Gradle 'Test' project refresh failed
Unable to start the daemon process. This problem might be caused by
incorrect configuration of the daemon. For example, an unrecognized
jvm option is used. Please refer to the user guide chapter on the
daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
Unrecognized VM option 'MaxPermSize=256m' Error: Could not create the
Java Virtual Machine. Error: A fatal exception has occurred. Program
will exit.
I read this and tried all the ways to solve it but to no avail. I did notice that his error was somewhat different from mine and thought that might be why I couldn't solve my problem using the ways suggested.
As I executed the .sh file on my terminal, it printed:
Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=250m;
support was removed in 8.0
(java:5094): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap"
Gtk-Message: Failed to load module "canberra-gtk-module"
I'm not sure whether it's related to the error or not. Please help.
In my case I had a line
org.gradle.jvmargs=-Xmx6408m -XX:MaxPermSize=6408m -XX:+HeapDumpOnOutOfMemoryError
in my gradle.properties file in the project structure.
removing -XX:MaxPermSize=6408m from that file fixed an issue
As it was already said in this thread, Permanent Generation was removed in Java 8, which is used in your case. I think, the easiest solution is to remove parameters associated with Permanent Generation during program execution.
Go to the directory where you have Android Studio. Then go to the bin/ subdirectory. Locate the following files, which contains Java Virtual Machine options:
studio.vmoptions
studio64.vmoptions
Open these files and locate line with MaxPerSize parameter. It should look as follows:
XX:MaxPermSize=256m
Remove this line in both files. I don't know if you are using 32-bit or 64-bit operating system, so you can update both files just in case.
I'm not sure if it will solve your problem, but I would try it in such situation. In my case, with this option and Java 8, I just get the warning, but Android Studio starts anyway. After removing this parameter, Android Studio still starts, but without warning. I'm using Ubuntu 14.04 LTS.
EDIT:
There is another solution for this problem described here: https://stackoverflow.com/a/27913562/1150795.
Go to File > Other Settings > Default Project Structure > JDK location and check the path.
In case of Ubuntu Linux, we can set /usr/lib/jvm/java-7-oracle as default JDK if we are using Oracle JVM. JDK 7 is the safest option for Android.
-XX:MaxPermSize was deprecated in JDK 8, marked as obsolete in JDK 16, and removed in JDK 17. It was superseded by the -XX:MaxMetaspaceSize option.
Change -XX:MaxPermSize to -XX:MaxMetaspaceSize solve my problem.
ref:
https://github.com/expo/expo-cli/issues/4196#issuecomment-1035850918
https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#removed-java-options
In my case opening $ANDROID_HOME/tools/lib/monitor-x86_64/monitor.ini and removing
XX:MaxPermSize=256m
from it did the job.
Oh I've solved this problem, I install Oracle JDK 9 when android studio runs on JDK 6 or JDK 7 (if I'm not mistaken).
so I uninstalled Oracle JDK 9, then download and install the JDK 7.
On MacOS the following clause in ./gradlew injects this option:
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\" \"-Xmx1024m\" \"-Xms256m\" \"-XX:MaxPermSize=1024m\""
fi
This file can be edited by hand after the project has been generated.
i had the same issue and i was able to solve it by adding this directly in the terminal
export JAVA_VERSION=1.8
and then try the
I'm trying to open Oracle SQL Developer on my Windows7 64-bit.
When I tried to open SQL Developer it asked for java.exe path and I gave C:\Java\jdk1.6.0_34\jre\bin\java.exe
I got an error from Oracle SQL Developer saying: Unable to find a Java Virtual Machine. To point to a location of a JVM. Please refer to oracle9i jdeveloper install guide (jdev install.html)
Any clue on how to fix this?
Another Solution:
This worked for me several times. Install JDK7 and point to location of jdk7\jre\bin\java.exe
Probably this is you are looking for (from this post):
Oracle SQL developer is NOT support on 64 bits JDK. To solve it,
install a 32 bits / x86 JDK and update your SQL developer config file,
so that it points to the 32 bits JDK.
Fix it! Edit the “sqldeveloper.conf“, which can be found under
“{ORACLE_HOME}\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf“, make
sure “SetJavaHome” is point to your 32 bits JDK.
Update:
Based on #FGreg answer below, in the Sql Developer version 4.XXX you can do it in user-specific config file:
Go to Properties -> Help -> About
Add / Change SetJavaHome to your path (for example - C:\Program Files (x86)\Java\jdk1.7.0_03) - this will override the setting in sqldeveloper.conf
Update 2: Based on #krm answer below, if your SQL Developer and JDK "bits" versions are not same, you can try to set the value of SetJavaHome property in product.conf
SetJavaHome C:\Program Files\Java\jdk1.7.0_80
The product.conf file is in my case located in the following directory:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0
I just installed SQL Developer 4.0.0.13 and the SetJavaHome can now be overridden by a user-specific configuration file (not sure if this is new to 4.0.0.13 or not).
The location of this user-specific configuration file can be seen in the user.conf property under 'Help -> About' on the 'Properties' tab. For example, mine was set to:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf
On Windows 7.
The first section of this file is used to set the JDK that SQLDeveloper should use:
#
# By default, the product launcher will search for a JDK to use, and if none
# can be found, it will ask for the location of a JDK and store its location
# in this file. If a particular JDK should be used instead, uncomment the
# line below and set the path to your preferred JDK.
#
SetJavaHome C:\Program Files (x86)\Java\jdk1.7.0_03
This setting overrides the setting in sqldeveloper.conf
The solution that worked for me:
If you have Sqldeveloper with java incorporated, you can use the \sqldeveloper\bin\sqldeveloper.bat to launch sqldeveloper as told here.
Version 1.5 is very, very old.
In the latest builds, we support 32 and 64 bit JDKs. In version 4.0, we find the JDK for you on Windows. If the software can't find it, it prompts for that path.
That path would look something like this
C:\Java\jdk1.7.0_45
You can read more about this here.
“C:\Users\admin\Downloads\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf” is misleading, it’s not the file which sets the Java Home variable. The actually file used is”%AppData%\sqldeveloper{PRODUCT_VERSION}\product.conf” [in my case it is "%AppData%\sqldeveloper\1.0.0.0.0\product.conf"]
The secret is you need to copy msvcr100.dll to the path where the installation says msvcr100.dll is missing (dialog box) and then try to install the sql developer.
For me I had to create bin folder in
C:\sqldeveloper\jdk\bin
and Copy msvcr100.dll to it.
If still not working! Try this!
You might also need to change the config file settings found in
C:\sqldeveloper\sqldeveloper\bin
Download and install 32 bit JDK (Windows) and set the path in config file as
SetJavaHome C:/Program Files (x86)/Java/jdk1.7.0_01
There is another route of failure, besides the version of Java you are running: You could be running out of Heap/RAM
If you had a once working version of SQLDeveloper, and you are starting to see the screenshot referenced in the original post, then you can try to adjust the amount of space SQLDeveloper requests when starting up.
Edit the file:
/ide/bin/ide.conf
Edit the line that specifies the max ram to use: AddVMOption -Xmx, reducing the size. For example I changed my file to have the following lines, which solved the issue.
#AddVMOption -Xmx640M # Original Value
AddVMOption -Xmx256M # New Value
If you have a 64-bit version of SQL Developer, but for some reason your default JDK is a 32-bit JDK (e.g. if you develop an Eclipse RCP application which requires a 32-bit JDK), then you have to set the value of the SetJavaHome property in the product.conf file to a 64-bit version of JDK in order to run the SQL Developer.
For example:
SetJavaHome C:\Program Files\Java\jdk1.7.0_80
The product.conf file is in my case located in the following directory:
C:\Users\username\AppData\Roaming\sqldeveloper\1.0.0.0.0
The solution described above worked in my case. The solutions of #evgenyl and #FGreg did not work in my case.
The Oracle SQL developer is not supported by the 64bit JDK.
To resolve this issue:
Install a 32bit JDK (x86)
Update your SQL developer config file (It should now point to the new 32bit JDK).
Edit the sqldeveloper.conf, which can be found under {ORACLE_HOME}\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
Make sure SetJavaHome is pointing to your 32bit JDK.
For example:
SetJavaHome C:\Program Files (x86) \Java\jdk1.6.0_13
This is known to happen even if there are some syntactical errors in your heap space setting in the sqldeveloper.conf.
If you have defined the heap space in any of the wrong ways mentioned here,
it still will show the same error when you launch it.
EDIT :
The correct way to set your heap size parameters would be something like this:
AddVMOption -XX:MaxPermSize=256M
AddVMOption -Xms256M
AddVMOption -Xmx768M
I also had the same problem after installing 32 bit version of java it solved.
I've been trying to install this ARToolkit from Qualcomm:
https://ar.qualcomm.at/qdevnet/
(Windows ".exe" version) on a Windows 7 64bits platform, and I keep getting the error:
Windows error 2 occured while loading the Java VM
The program trying to install this program is InstallAnywhere, but I can't seem to find any documentation about this error. The dialogue box name when the crash happens is
LaunchAnywhere
I was just wondering if anyone had seen this kind of error before and if so, how to solve it. The very few answers I can find online relate to Win98/ME issues thus making them irrelevant.
I'm currently using JDK 1.7.0_04 and jre 1.7 if this is somehow relevant.
Launch the installer with the following command line parameters:
LAX_VM
For example:
InstallXYZ.exe LAX_VM "C:\Program Files (x86)\Java\jre6\bin\java.exe"
In cmd
C:\Users\Downloads>install.exe LAX_VM "C:\Program Files\Java\jdk1.8.0_60\bin\java.exe"
For me it works a deleting "C:\ProgramData\Oracle\Java\javapath" in my system enviroment PATH variable
Edit:
If you don't have that variable or it does not work you can directly delete or rename the directory "C:\ProgramData\Oracle\Java\javapath"
'Windows error 2' has dozens of meanings (52 that I could find).
The most common one is ERROR_FILE_NOT_FOUND, which can be found in winerror.h. Without more context, that's the best I can guess. Did you check the event logs to see if there's more information there?
We could not uninstall a program, stuck with the "Windows error 2 cannot load Java VM". Added the Java path to the PATH variable, uninstalled and re-installed Java 8, the problem would not go away.
Then I found this solution online and it worked for us on the first shot:
- Uninstall Java 8
- Install Java 6
Whatever the reason, with Java 6, the error went away, we uninstalled the program, and re-installed Java 8.
If you get the error after installation:
Find the .lax file with the matching exe name and update current vm path from:
lax.nl.current.vm=C:\ProgramData\Oracle\Java\javapath\java.exe
to
lax.nl.current.vm=C:\Program Files\Java\jre1.8.0_144\bin\java.exe
Try adding C:\path\to\java\jre\bin to your system environment variable PATH and run again. That worked for me!
I think it should be .....\javaw.exe". It worked for me. Thanks.
I had same mistake, it was produced because i had disabled the creation of "_jvm" in the InstallAnywhere (project - JVM settings - Installer Settings - Bundled/Downloaded Virtual Machine), then into file "Uninstall $PRODUCT_NAME$.lax" into uninstall folder, the variable "lax.nl.current.vm" is empty.
If you don't need jvm is disabled check "Install Bundled / Downloaded Virtual Machine" option in the checkbox (project - JVM settings - Installer Settings - Bundled/Downloaded Virtual Machine).
If you need jvm is disabled because you create it manually, then you can do the following:
create an action "Modify Text File" to append variable with the value of the _jvm folder.
(Existing File)
$USER_INSTALL_DIR$\Uninstall_$PRODUCT_NAME$ \Uninstall $PRODUCT_NAME$.lax
(Append)
lax.nl.current.vm=..\_jvm\bin\java.exe
I got the same problem after upgrading java from 1.8.0_202 to 1.8.0_211
Problem:
Here are directories where new version of 1.8.0_211 of Java installed:
Directory of c:\Program Files\Java\jre1.8.0_211\bin
Directory of c:\Program Files (x86)\Common Files\Oracle\Java\javapath
So one is located in 32 bit and second is in 64 bit Program files folder. The one that is specified in the PATH is 32 bit version (c:\Program Files (x86)\Common Files\Oracle\Java\javapath), even though it was 64 bit version of the Java that was installed.
Solution:
Change system environments variable PATH from c:\Program Files
(x86)\Common Files\Oracle\Java\javapath to c:\Program
Files\Java\jre1.8.0_211\bin
Can anyone please tell me why I get the following error when I try to run my Java programs? The programs get compiled successfully but are not able to be run. I have already set the path of Java.
C:\JavaServ>javac hello1.java
C:\JavaServ>java hello1
Error: could not open C:\Program Files\Java\jre6\lib\amd64\jvm.cfg
Don't think if this is a correct way...(perhaps proper installation of Java is a permanent solution)....but this is a trick..:)
Delete the “java.exe” file from “c:\windows” and “c:\windows\system32″. That should fix it.
In case you get here and scroll this far down, the newer Oracle versions of Java x86 and probably also x64 are horribly broken. You may find that after removing all versions of Java, and even manually deleting all the versions you find in c:/program files/ and c:/program files (x86)/ that you still can't properly run a fresh install of Java.
I'm here to tell you why, and how to fix it.
Go to C:\Program Files\Common Files\ and DELETE the Oracle directory. It has a version of Java underneath it inside a junction (symlink) that is sequestered away from all your other installs. Bastards.
Now, also go to System Properties -> Advanced -> Environment Variables and edit the PATH under System Variables. Find the place where the Oracle folder is referenced, and delete it. Close all your windows down, reboot to be extra sure if you want.
Install the JRE or JDK. Open a command prompt and type 'java' and if it comes up, you're golden. If not, go back to the PATH variable and add "C:\Program Files (x86)\Java\jdk1.8.0_221\bin" or whatever looks right for your machine.
I hate Oracle.
this should be an internal file of JRE and in general you shouldn't deal with it when you're running/compiling java.
Here you can find an explanation of what exactly this file is intended for.
Bottom line, your Java installation is somehow corrupted, so as a first resort to resolve this issue, I suggest you to re-install jre.
You should ensure that you're installing the right jre for your architecture.
Hope, this helps
You can not Uninstall/Reinstall JRE if you are having this error.
That's why because previous installation has copied 3 files namely Java.exe, Javaw.exe, javaws.exe in the c:/windows/system32 folder.
Simply go there and remove these files and download a fresh version of jre from oracle and install it. I will prefer JDK 1.6 update 45. Which is very stable.
update registry path to installation location
This happened for me when I moved out my default installation from an overcrowded primary partition to another location. Fir
Java mysteriously broke on my work PC after a security patch was pushed out to us, giving this error whenever you tried to run a Java program. Somehow the 'lib' subdirectory of the Java 7 install had vanished! It might have been related to having multiple Java versions installed simultaneously.
If you're getting this error there are basically two things that could be wrong:
1) Your Java installation is broken. If the file/directory it's complaining about doesn't exist, uninstall and reinstall the JRE and then it should be there. This fixed it for me.
2) If the files are there, your PATH is somehow incorrect or pointing at an old/broken Java install. In this case you either need to fix your PATH to point to the correct java.exe/javaw.exe, or use a fully qualified path. So instead of:
java <whatever>
Use
c:\<full path to correct JRE>\bin\java.exe <whatever>
3) If your PATH is correct and files are there and it's still failing, the path could be getting truncated because it is too long. see: Running Java gives "Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'" .
i also had the same issue due to one more instance of java,javaw and javaws in C:\Windows\System32 which was pointing to jre6 and my default location of jre was pointing to this(C:\Windows\System32) location. Even having jdk 1.8 as my JAVA_HOME location i were getting this problem.
so either remove or rename java,javaw and javaws it will work.
If you have installer deployed Java on Windows and decided to bring some order to your JDKs with folders moving...
All answers with java.exe in Windows\System32 are right but in more tough situation - there are no files, but error messages still happen, then remember about Windows Registry entries (look regedit.exe).
They store information about JRE folder in this registry key:
win32:
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
win64:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment
The program can be compiled but while running it leads to such an error:
Could not open C:\Program Files\Java\jre6\lib\amd64\jvm.cfg
It indicates that the jvm.cfg file is missing in Program files. Reasons may be file corruption or file may be deleted. Install JRE again in "Program Files" folder.
Another case which happened with me is that I installed 32 bit jdk & jre in my 64 bit system in Program Files(x86) and my Program Files folder was empty. That was the reason for that error. So I installed 64 bit JRE in Program Files folder and it started to work. Note that it is not related to jdk version. Associated with only JRE problem.
I was getting the same error with my docear program on windows 7.
What I found is that I had two instances of java 1.6 installed on my computer. One instance has a jvm.cfg and the other does not.
Modifying my path to search the correct instance of java (in bold) first fixed the problem.
Here is my corrected path:
C:\Users\kranjit>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files\Java\jre6\bin;C:\Program Files (x86)\Java\jre6\bin;
In our system, for "java(jre)" for runtime purpose is availed, So If you install any different version of java, propbably the version before the one which is already installed.
E.g.; my windows 8.1 I have runtime java version of 8, then when I install Ver7 it is bu default taking V8, yet I uninstall 8, In this kind of Scenarios, Removing java.exe from c:\windows\system32 makes my java runtime work
For anyone still having an issue I made mine work by doing this probably not the best fix but it worked for me..
I uninstalled all Java's that i current had installed, reinstalled the latest one and changed the install directory to C:/Windows/jre (Basically where it kept saying there was no config file)
If you have installed more than one jdk version , uninstall the others and keep only the one in use. this worked for me.
https://www.java.com/en/download/help/uninstall_java.xml
I want to add some pointers here.
Whenever you face the error saying Could not open jvm.cfg, it means that there was some mess happened with java installation path. Below approaches might help.
If java is added in environment path, then open command prompt and type where java. If you get list of directories where java path specified. Other than the directory where you need the java file, delete the java files in all other directories.
If you are reading 2nd pointer, then 1st pointer might have not helped. Type regedit in run dialog and under HKEY_LOCAL_MACHINE, go to softwares/javasoft and rename the paths of the java installed directory.
Let me know if above approaches solve the problem.
The simple Solution is just uninstall the javaSE and reinstall it to the default location.
Then copy the installed location probably like C:\Program Files\Java\jdk1.8.0_131\bin.
After then go to desktop then while selecting right click on My Pc or This pc shortcut the under that select properties >> Advanced system settings >> under Advance tab >> last option Environment Variables..>>path >> edit >> past >> ;(not required if win10)/(required if windows 7)
I had this issue when installing 201, somehow it didn't uninstall my 191 properly. I had to go to the Program Files/Java folder, rename the old 201 directory, then install a fresh copy of 201. When doing so, it prompted me to uninstall 191, which I did. Now it's working fine.
I was facing the same issue after upgrading my java version.I had more than one jdk installation. I have manually uninstalled the old jdk version . Then it worked for me.
Resolved
I had similar issue, I tried different things but nothing worked. Then when I checked the installed programs. I could see two versions of java installed.
What I did is, just uninstall all java versions and freshly installed the required version. But this didn't seem to work when I checked in terminal. Then I had to reopen the terminal and run the command, then only it worked.
Note : Dont forget to reopen the terminal if you are testing via terminal.
I had an identical error trying to start IntellJ with a custom JBR.
C:\Users\user>"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\bin\idea.bat"
Error: could not open `C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.3\jbr-arm64\lib\jvm.cfg'
This issue may occur if there were problems extracting Java or OpenJDK from a zip or tarball (e.g. a slow extraction was terminated prematurely) or if the zip or tarball was corrupted or incomplete.
If caused by a corrupted zip or tarball, try redownloading the archive.
If caused by a bad extraction, repeating the extraction will fix this.
Copying and pasting i386\jvm.cfg from a different PC will resolve the issue.
I had the same issue.I just uninstalled Java and reinstalled again it worked fine after that . The problem is related to JRE so you can just reinstall JRE.
I had same problem - when I tried to run a Java program from command line the error message appeared: "Error: could not open jvm.cfg".
My Path environment variable included following path:
C:\ProgramData\Oracle\Java\javapath
In the folder there were 3 exe files:
java.exe
javaw.exe
javaws.exe
When I removed the the entry
C:\ProgramData\Oracle\Java\javapath
from the Path environment variable and restarted cmd, I could run the program as usual (java MyProg).
Obviously I have corrupted the path pointing to correct java jre installation
C:\Program Files\Java\jre1.8.0_151
somehow previously when I played with my settings.
It means that this jvm.cfg file is not found. Maybe it was deleted. Reinstall the program. If you have this problem with a game for example, reinstall Java in the games folder, or copy Java files .de c:/Program Files/JAVA and paste to the JAVA folder in the game folder
I get this error when I try to do anything with Java in command prompt:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment.3'
Error: could not find Java.dll
Error: could not find Java 2 Runtime Environment
I did screw around with deleting Java directories and registry a few days ago. I restarted computer and java was still working fine, then i restarted it again today and now I get this error. I have tried uninstalling and reinstalling but that doesn't seem to work. I have the latest java JRE installed and the path set in the environment variables. Anyone have any clue how to fix this?
Make sure you remove any java.exe, javaw.exe and javaws.exe from your Windows\System32 folder and if you have an x64 system (Win 7 64 bits) also do the same under Windows\SysWOW64.
If you can't find them at these locations, try deleting them from C:\ProgramData\Oracle\Java\javapath.
You will find a folder named "Oracle" on ProgramData folder in your windows installed drive. Remove the folder. Hope it will work.
In my case my install drive is C and my path is C:\ProgramData\Oracle
I had a similar problem. I had installed JDK7 update 1 but couldn't use it (probably because I found a JRE6 that I deleted after installing JDK7). Uninstalling JDK7 was impossible. The solution was to add the JRE registry entries by hand.
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.7"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7]
"JavaHome"="C:\\Program Files\\Java\\jre7"
"RuntimeLib"="C:\\Program Files\\Java\\jre7\\bin\\client\\jvm.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_01]
"JavaHome"="C:\\Program Files\\Java\\jre7"
"RuntimeLib"="C:\\Program Files\\Java\\jre7\\bin\\client\\jvm.dll"
You'll have to adjust the above to your own directories and version.
If this doesn't help, there's still JavaRa https://singularlabs.com/software/javara/ .
Delete these 3 files present in your local at path C:\ProgramData\Oracle\Java\javapath
java.exe
javaw.exe
javaws.exe
This solved the issue for me :)
Make sure you remove any java.exe, javaw.exe and javaws.exe from your system.
if you have an x32 system (Win XP 32 bits) Windows\System32 folder
if you have an x64 system (Win 7 64 bits) also do the same under Windows\SysWOW64 folder
On Windows 10 I had just installed the JDK, and got these errors when checking the version. I had to delete all executable files starting with java (i.e. java.exe, javaw.exe and javaws.exe) from C:\ProgramData\Oracle\Java\javapath. And then, once deleted, re-run the JDK installer, restart my terminal program and java -v works.
There are 3 locations to check
Registry HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_xxx\JavaHome
Java Control Panel- Java tab - View - Path
Environment Variables - Path ($env:Path)
All 3 have to align (if you have multiple entires just remove the wrong ones) - thats all
I had the same:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment
Clearing Windows\SysWOW64 doesn't help for Win7
In my case it installing JDK8 offline helped (from link)
I would have tagged this as a comment but cant (dont have the rep) just wanted to thank Tilman. I was trying to get PDFsam (PDF Split and Merge) to work to no avail.
At launch it would produce an error stating that it could not find JRE 1.6.0. I Have both 32 and 64 bit versions and they check out fine at the java website in their respective browsers.
Tried uninstalling/reinstalling and rebooting repeatedly as well as using JavaRa. No such luck, still no go.
I looked in the registry after reading this post and there was no ...\SOFTWARE\JavaSoft\ key so I added each with their respective string values pointing to my x86 version (PDFsam is a 32bit program). This got past the first problem but an error popped up about amd64 libraries suggesting the machine wanted to run the 64bit version. So I changed the paths to the 64bit JRE and PDFsam now works.
FYI - I got here by searching for Java registry keys after I was unable to launch javaw.exe from command prompt (even after adding the requisite paths to system path), making the aforementioned changes solved this as well.
I got this kind of error whe nI had JDK 1.7 before and I installed JAVA JDK 1.8 and pointed my JAVA_HOME and PATH variables to JAVA 1.8 version. When I try to find the java version I got this error. I restarted my machine, and it works . It seems to be we have to restart the machine after modifying the environment variables.
In case a virus scanner (like McAfee) is running, try:
Disable virus scanner
Uninstall Java (via Control Panel / Programs and Features)
Reinstall Java (from Java.com)
Re-enable virus scanner
Uninstall Java (via Control Panel / Programs and Features)
Install Java JRE 7 --> OFFLINE <--
Configure JAVA_HOME and Path = %JAVA_HOME%/bin;%PATH%
I have Windows 7. I got the same problem after installing: PyCharm.
I wasn't satisfied with PyCharm, so I decided to use Eclipse instead. This is when I discovered that things went wrong with my JDK. I used to have Java.9.x. So I decided to uninstall it and get the newer version (at my time it was Java.11.x. The same problem persisted.
I followed most of the steps mentioned above in the post like:
- Removing all java*.exe files,
- removing Java related entries from the registry.
- Cleaning-up all unnecessary Java folders. However nothing helped. I still had something in the system referring to a broken Java pathname.
What really brought remedy is the following:
- Uninstalled what ever version of JDK I had at the moment.
- Re-Installed the last JDK version I had before the problem took place
- Properly uninstall that version.
- Install whatever latest version of SDK. ..
That's it .. at this point everything returned to normal ... Except that Java.11.xx did not fix the system path automatically, I had to do it manually.
I followed multiple answers from above and got my issue resolved.
Issue:
Javac was on 13 from jdk but java was using 1.8 from jre so java threw incompatible runtime error
Fix:
Under Control Panel -> Programs: I uninstalled 1.8 (named Java 8 runtime) and DID NOT touch the other one (named Java (TM) SE Development Kit 13)
Deleted java.exe, javac.exe and javawc.exe files from:
a. C:\Windows\system32
b. C:\Windows\SysWOW64
c. C:\ProgramData\Oracle\Java\javapath
The environment variable JDK_HOME was pointing to 13 but JAVA_HOME was pointing to 1.8 so i pointed JAVA_HOME to also use 13 which was C:\Program Files\Java\jdk-13.0.1
There was a Path variable under both User variables and system variables sections.
For the one in user variables section, i added the string %JDK_HOME% - which translated automatically to the physical path.
For the one under system variables, I deleted the path C:\ProgramData\Oracle\Java\javapath and added C:\Program Files\Java\jdk-13.0.1\bin
All good now! Thanks to all the people who answered, you rock!
Make sure to delete java references from system32, SysWOW64, and delete javapath from ProgramData\Oracle\Java. It solves the issue
If you have "C:\ProgramData\Oracle\Java\javapath" in your PATH, just make sure that the java bin path entries are present before this entry in your PATH.
I was facing the exact same issue, and I just moved the java jdk/jre bin path entries up in the list, above the oracle entry and it resolved my issue.