Cannot determine current directory

前端 未结 11 1345
旧时难觅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: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
    

提交回复
热议问题