Cannot determine current directory

前端 未结 11 1347
旧时难觅i
旧时难觅i 2021-02-03 16:40

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

相关标签:
11条回答
  • 2021-02-03 17:30

    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

    0 讨论(0)
  • 2021-02-03 17:33

    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.

    0 讨论(0)
  • 2021-02-03 17:34

    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.

    0 讨论(0)
  • 2021-02-03 17:41

    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.

    0 讨论(0)
  • 2021-02-03 17:42

    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
    
    0 讨论(0)
提交回复
热议问题