Error launching IDEA: Failed to load JVM - java

I recently installed IntelliJ IDEA 2018. However, when I tried to run IntelliJ, I received the following error message:
Error loading IDEA:
I looked up my system environment variables which I have posted below:
System Variables:
I checked which version of Java I have on the command prompt:
Java Version | Command Prompt:
I checked my program files:
Program Files | JDK 9:
I also checked my Program Files (x86):
Program Files (x86) | JRE 1.8:

I've had an issue in the past where the oracle jdk was given priority over the jdk I wanted to use and eclipse wouldn't load because of it. While this is not exactly the same issue it seems similar in nature since I see you have a listing for Oracle/java/javapath in your Path environment variable.
I can see in your path that oracle is listed first.
Try listing %JAVA_HOME%/bin; as the first entry inside your Path variable.

Thank you everyone for your help. Listing %JAVA_HOME%/bin; as the last entry inside my Path variable resolved my issue.
IntelliJ Now Working

Copy the below path from your local machine
C:\Program Files\Java\jdk1.8.0_181\jre\bin\server\jvm.dill
And Set the Environment Variables
Set the %JAVA_HOME%\bin
I faced same issue and resolved from
http://commandstech.com/intellij-idea-failed-to-load-jvm-dll/

Related

No compiler is provided in this environment. maven build failed

I am getting the following error while using the following command
mvn clean install package
Error
No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK?
I have tried the solutions already present online but none of them worked, I have my JDK path selected in the installed JRE's on my eclipse.
I am using Ubuntu 16.04. Can someone help?
I have already tried the solution given in No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
but that didn't help. I already have my JDK path selected correctly
Check JAVA_HOME path is set as the environment variable pointing to JDK. Refer maven installation steps for more information.
https://maven.apache.org/install.html
Give the jdk path in /etc/environment
Eg : JAVA_HOME="/usr/lib/jvm/java-8-oracle"
then
source /etc/environment
also add in bashrc
vi ~/.bashrc
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
source ~/.bashrc
I had this same exact error.
There are a lot of possible solutions posted for this problem, even more duplicates. However, after checking many of them I did not find the solution. After some tries and investigations among my environment settings I have found out that the issue was caused by having multiple java paths pointing to different versions that were set up by different IDE's. Also, it seems that Maven was trying to use the first version it found in the PATH settings which actually appeared to be a JRE version.
The solution for me was to put the path pointing to Java JDK as the first path in the PATH environment settings.
Also, make sure that the new environment settings are in effect before you try to use Maven again.
A very simple way to see if mvn actually tries to use the JDK is to execute the following command:
mvn -version
It will print out the Java paths along with other info.

system cannot get java compiler please use jdk intead of jre

When trying to deploy my application to the Google App Engine server I get the following error:
Cannot get the System Java Compiler. Please use a JDK, not a JRE.
All solutions I've seen for this involve editing an eclipse configuration file, but I'm not using eclipse. I'm executing appcfg.cmd from the dos prompt.
I have a jdk installed and my JAVA_HOME is pointing to it:
c:\program files\java\jdk1.7.0_45
Few points:
Could you check if the JAVA_HOME\bin folder is in the PATH environment variable. If not put that and make sure that it is pointing to the correct version.
Also check java -version on your machine after setting it.
I think you need to add the bin folder as the sub-directory please give it a try
c:\program files\java\jdk1.7.0_45\bin

Windows error 2 occured while loading the Java VM

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

Java path..Error of jvm.cfg

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

Running J2EE Eclipse in a VM - Unable to find a javac compiler

Kinda new posting up questions here so bear with me. I had to install a XP VM recently in order to run a program that required use of an Oracle 10g client. I setup my tomcat server and when I went through the directory and started the .jsp file, I got this error
2011-02-22 09:13:01,291 ERROR (org.apache.jasper.compiler.Compiler:394) - Javac exception
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Weird thing is I set my JAVA_HOME variable in my VM to 'C:\Program Files\Java\jdk1.6.0_24;' and my PATH variable to '%JAVA_HOME%\bin;'.
It says that its a jasper-complier error... I made sure to add several TOMCAT_HOME variables in my eclipse library path that looked at the jasper-compiler,jasper-runtime,jsp-api.jar, and servlet-api.jar located in my tomcat server folder.
I also followed these instructions here, that state to add the jdk\bin's tools.jar to Eclipse's Ant runtime global entries
Any help appreciated, I'm stumped.
It usually happens because Oracle ships with an outdated version of JDK which conflicts the PATH that we set. Scan your PATH environment variable for any oracle JDK and remove it. It should help.
Look into your Launcher configurations (of type 'Apache Tomcat') and find the one created when you launched the JSP. There must be an 'environment tab'. You could define the JAVA_HOME here. Is this a version 5 of Tomcat (or earlier) ? Starting with version 5.5, Jasper has an embedded JDT (eclipse java compiler).
Hey I figured it out, just made sure you add to your JDK to your PATH variable (ie. java\jdk...\bin) and I also added it to my tomcat\lib folder and added it to my projects library as another variable.

Categories

Resources