configuring eclipse on ubuntu to use my jdk version

问题: I am trying to use eclipse on my installed jdk, which I thought should be simple to do in ubuntu (as it is in windows), but it turned out to be a surprisingly complex task....

问题:

I am trying to use eclipse on my installed jdk, which I thought should be simple to do in ubuntu (as it is in windows), but it turned out to be a surprisingly complex task. Firstly, the installations and running the eclipse are done like this:

$ which javac
/home/xx/jdk1.8.0_192/bin/javac
$ java -version
/home/xx/jdk1.8.0_192/bin/java
$ echo $JAVA_HOME
/home/xx/jdk1.8.0_192
$ dpkg --print-architecture
amd64
$ /home/xx/eclipse.j/java-2018-09/eclipse/eclipse -vm /home/xx/jdk1.8.0_192/bin/java

eclipse-help-about shows the version as "2018-09 (4.9.0)", and when I see eclipse-help-about-installation_details-configure and search for -vm, shows that my specified jdk version is being used. And I am using ubuntu-18.04.

However, when I am creating a new project in eclipse, I am seeing that it still uses JRE System Library "java-11-openjdk-amd64". How do I change this to use my version of jdk? Do I need to set some more environment variables, do I need to configure eclipse in some other way?

I have looked at questions 16843976 and 3026897, but they are not really helping.

A second related question (after the above is answered): I have some extra jar files (eg for antlr) in a directory named /home/xx/jar. How do I tell eclipse to pick up the extra jars from this directory?


回答1:

To configure java on eclipse use Look for Preferences and them search for Java -> Installed JREs

Please find below screenshot for more information. If none is present Click Add enter image description here

Also for extra jars add them to your Build path. Right click the Project -> Build Path -> Configure Build Path

  • 发表于 2019-01-15 06:16
  • 阅读 ( 235 )
  • 分类:网络文章

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除