简体   繁体   English

其中哪些是我的JDK路径,哪些是JAVA_HOME?

[英]Which of these is my JDK path, and which is JAVA_HOME?

I just installed Linux Mint and am trying to configure SpringSource Tool Suite which requires you to direct it to the system "JDK path". 我刚刚安装了Linux Mint,并尝试配置SpringSource Tool Suite,它要求您将其定向到系统“ JDK路径”。 Although I haven't explicitly downloaded/installed Java on this system yet, when I ran the update manager I did see Open JDK get installed and found several directories under /usr/lib/jvm (see screenshot below). 尽管我尚未在该系统上明确下载/安装Java,但是当我运行更新管理器时,确实看到安装了Open JDK并在/usr/lib/jvm下找到了几个目录(请参见下面的屏幕快照)。 My questions are: 我的问题是:

  • Spring Tool Suite requires you to specify a path to the JDK, and my question is, which one do I choose, and why?; Spring Tool Suite要求您指定JDK的路径,而我的问题是,我选择哪个,为什么? and
  • How do I tell which of these is my JAVA_HOME ?; 我怎么知道我的JAVA_HOME是哪一个? and
  • What's the difference between the " JDK path " and JAVA_HOME ? JDK路径 ”和JAVA_HOME什么区别?

在此处输入图片说明

Thanks in advance! 提前致谢!

Edit : 编辑

echo $PATH --> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games echo $ PATH-> / usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin:/ usr / games

java -version -> java version "1.7.0_03" OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3) OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode) java -version-> Java版本“ 1.7.0_03” OpenJDK运行时环境(IcedTea7 2.1.1pre)(7〜u3-2.1.1〜pre1-1ubuntu3)OpenJDK 64位服务器VM(内部版本22.0-b10,混合模式)

which java -> /usr/bin/java 哪个Java-> / usr / bin / java

Spring Tool Suite requires you to specify a path to the JDK, and my question is, which one do I choose, and why?; Spring Tool Suite要求您指定JDK的路径,而我的问题是,我选择哪个,为什么? and

This can only be answered according to the needs of your application. 这只能根据您的应用程序的需求来回答。 Do you need the stability of Java 6 or the features added in Java 7? 您是否需要Java 6的稳定性或Java 7中添加的功能? Are there APIs you intend to use that are only available in Java 7 or are the Java 6 libraries sufficient? 您打算使用仅在Java 7中可用的API还是Java 6库足够? Do you have customers that require the use of one JVM over another? 您是否有需要使用一个JVM而不是另一个JVM的客户? Only you can answer these questions. 只有您可以回答这些问题。

How do I tell which of these is my JAVA_HOME?; 我怎么知道我的JAVA_HOME是哪一个? and

You will want to make JAVA_HOME reference the specific JVM environment that you've decided on for your project. 您将要使JAVA_HOME引用为项目决定的特定JVM环境。 For example, if you decide on Java 6 you'll probably want to set your JAVA_HOME to /usr/lib/jvm/java-6-openjdk-amd64. 例如,如果决定使用Java 6,则可能需要将JAVA_HOME设置为/ usr / lib / jvm / java-6-openjdk-amd64。

What's the difference between the "JDK path" and JAVA_HOME? “ JDK路径”和JAVA_HOME有什么区别?

The JDK path refers to the Java Development Kit - which includes the java compiler, debugger and other tools associated with developing java programs. JDK路径引用Java开发工具包-包括Java编译器,调试器和与开发Java程序相关的其他工具。 JAVA_HOME can reference either the JDK root or the JRE (Java Runtime Environment) root directory when running java programs; 运行Java程序时,JAVA_HOME可以引用JDK根目录或JRE(Java运行时环境)根目录。 but you should, for development purposes, always have JAVA_HOME reference the JDK root. 但是出于开发目的,您应该始终让JAVA_HOME引用JDK根目录。

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

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