I am trying to run a .jar file that was created successfully in Netbeans and I am receiving the following error:
Error occurred during initialization of V
Solution: cd to another directory and run that command again, that works for me.
See explanation here: https://bugs.openjdk.java.net/browse/JDK-8186434
I saw the same error when I was trying to call java -version
inside a directory, which I already had deleted from another terminal session. Of course in that case java could not determine the current working directory
, simply because it didn't exist.
I was having this error in my mac, when I start tomcat from my eclipse. After setting JAVA_HOME and restarting the eclipse, the error is fixed.
In Fedora 21, I tried calling the "java -version" after an uninstall and it gave the above error. Close all the terminals and open them again and try.
Should work.
maybe you did not config java environment on your workstation correctly
the following configurations were what I did in my mac
vi ~/.bash_profile
and add those in it
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPATH
replace
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
with your jdk version and then run
source ~/.bash_profile
to use these config immediately then you can check by
java -version