简体   繁体   English

Ubuntu 或 Android Eclipse 中的 OpenJDK

[英]OpenJDK in Ubuntu or Android Eclipse

I am new to OpenJDK.我是 OpenJDK 的新手。 Should I install OpenJDK in Ubuntu or is OpenJDK already available in Android Eclipse that I am presently working in?我应该在 Ubuntu 中安装 OpenJDK,还是在我目前工作的 Android Eclipse 中已经可以使用 OpenJDK? If no, then how do I go about installing the OpenJDK in Ubuntu. Please help me.如果没有,那我go如何安装OpenJDK Ubuntu请帮帮我。

You can install openjdk by running sudo apt-get install openjdk-7-jre , (jdk 7).您可以通过运行sudo apt-get install openjdk-7-jre (jdk 7) 来安装 openjdk。 However if you have a working eclipse installation for Java programs chances are that you already have java installed on your machine.但是,如果您有一个用于 Java 程序的 eclipse 安装,那么您的计算机上可能已经安装了 java。

Now to verify it there are following three ways:-现在验证它有以下三种方式: -

  1. Run javac/ java from command line.从命令行运行 javac/java。
  2. Manually check the /usr/lib/jvm folder.手动检查 /usr/lib/jvm 文件夹。
  3. In Eclipse Go to Window -> preferences -> Java -> installed JREs and see The path of listed JREs there if any.....在 Eclipse Go 到 Window -> 首选项 -> Java -> 安装的 JRE 并查看列出的 JRE 的路径(如果有的话)......

Hope it helps!!!希望能帮助到你!!!

EDIT 1 Eclipse is an IDE which helps you in developing applications in various programming languages and Java is just one of them, when you install eclipse it checks whether you have any installed JREs in your system.编辑 1 Eclipse 是一个 IDE,它可以帮助您使用各种编程语言开发应用程序,而 Java 只是其中之一,当您安装 eclipse 时,它会检查您的系统中是否安装了任何 JRE。 If the installer can't find any JRE than it gives you a message for that.如果安装程序找不到任何 JRE,它会给您一条消息。 If it finds any JRE than it takes the path to that JRE and configures itself accordingly.如果它找到任何 JRE,它就会采用该 JRE 的路径并相应地配置自身。

On the other hand OpenJDk is The place to collaborate on an open-source implementation of the Java Platform, Standard Edition, and related projects.另一方面, OpenJDk是在 Java 平台、标准版和相关项目的开源实现上进行协作的地方。 You also have sunjdk (oracle's implementation) and many more.您还有 sunjdk(oracle 的实现)等等。 For more information about openJdk refer the link.有关 openJdk 的更多信息,请参阅链接。

One more thing you can install multiple JREs in your machine and choose which one you want to use for any project.还有一件事,您可以在您的机器上安装多个 JRE,并选择您想要用于任何项目的 JRE。

You may also use the command sudo update-alternatives --config java to see java alternatives currently installed on your machine.您还可以使用命令sudo update-alternatives --config java来查看当前安装在您机器上的 java 备选方案。

Hope this helps.希望这可以帮助。 Good luck!祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM