Error occurred during initialization of VM - starting IDE
Whenever I try to start IntelliJ Idea I am getting the following error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
I have installed Java SDK via the following command:
apt-get install oracle-java7-installer
The output of `java -version` is:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
and `echo $JAVA_HOME` shows:
/usr/java/jdk1.7.0_45
and `echo $PATH` shows:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/java/jdk1.7.0_45/bin
Why is this error happening?
EDIT:
I am able to compile and run an simple HelloWorld java program in the terminal.
(Using Crunchbang - based on Debian)
Please sign in to leave a comment.
Hello.
1. Is any JDK installation really located at /usr/java/jdk1.7.0_45 ?
2. Does $JDK_HOME points anywhere (has a value)?
Thanks,
Alexander.
1. Yes it is actually there.
2. echo $JDK_HOME is blank.
Thanks,
Colin.
Thank you.
What IDEA version do you use?
Alexander.
12, I just downloaded it this morning.
I've downloaded IDEA (both Community and Ultimate, BTW), unset JDK_HOME, defined JAVA_HOME. Both builds run OK.
The only difference is that I've downloaded java as tar.gz from Oracle site and installed it via unpacking into dedicated directory. Not via apt-get.
So, I usppose the problem is in java installation. Please check permissions on all files in /usr/java/jdk1.7.0_45 : in tar.gz I've got they by default had some user names. If that does not help, please try java tar.gz installation.
Regards,
Alexander.
All the files where set as root so I removed the apt-get version and tried installing the tar.gz version and I am still getting the same error. Also my: java -version is now showing that I'm now using: java version "1.5.0" gij (GNU libgcj) version 4.7.2. I've tried changing this by running: update-alternatives --config java but it is running an error stating: There is only one alternative in link group java (providing /usr/bin/java): /usr/bin/gij-4.7 Nothing to configure.
OK I deleted my Idea installation and reinstalled and it now seems to be working fine. Would like to say thank you very much for helping.
Unpacking jdk-nnn-tar.gz does not update PATH, so plain "java" command without path does now see new java version. This should not be a problem for IDEA, e.g. my "java -version" shows me 1.6.0_31, while I actually use 1.7.0_45 without trouble. We need IDEA_JDK, JDK_HOME or JAVA_HOME.
To exclude accidentals:
1. Is IDEA_JDK variable set?
2. Am I right that you're running .../idea-IU-129.1359/bin/idea.sh ?
Thanks,
Alexander.
Ok, nice.