Eclipse cannot find Java on Ubuntu

后端 未结 8 1140
自闭症患者
自闭症患者 2021-02-09 05:38

Java is properly installed in my Ubuntu 12.04 and the PATH variable is set in the .bashrc file.

The command java -version gives an expected out

8条回答
  •  面向向阳花
    2021-02-09 06:11

    Java in Ubuntu is usually located at /usr/lib/jvm/, but ubuntu usually creates a symlink to the current version of java at /usr/lib/jvm/java-7-sun. The symlink may or may not exist depending on how you installed java on your machine, now that it is no longer available at the repos.

    Navigate to /usr/lib/jvm/ and type the ls command to find the appropriate folder java is located in. Once you have the location nailed down, look for a file named libjvm.so.

    In my machine, the -vm arg looks like this:

    -vm
    /usr/lib/jvm/java-6-sun/jre/lib/amd64/server/libjvm.so
    

    Make sure the path is in a new line below -vm or it won't work.

提交回复
热议问题