简体   繁体   English

在Windows上为IntelliJ Idea指定JRE

[英]Specify JRE for IntelliJ Idea on Windows

如何定义哪些JRE IntelliJ IDEA应该用于在Windows上运行?

In the following post it was specified that the paths look up sequence is the following: 在以下帖子中指定了路径查找顺序如下:

  1. IDEA_JDK env. IDEA_JDK env。 variable 变量
  2. ./jre directory ./jre目录
  3. registry 注册处
  4. JDK_HOME environment variable JDK_HOME环境变量

And indeed. 确实如此。 Creating an IDEA_JDK environment variable did help. 创建IDEA_JDK环境变量确实有帮助。

More actual information including JDK64 setup is here : 包括JDK64设置更多实际信息是在这里

<product>.exe uses this JDK search sequence: <product>.exe使用此JDK搜索序列:

  1. IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK environment variable (depends on the product, WEBIDE_JDK applies to both WebStorm and PhpStorm) IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK环境变量(取决于产品, WEBIDE_JDK适用于WebStorm和PhpStorm)
  2. ..\\jre directory ..\\jre目录
  3. system Registry 系统Registry
  4. JDK_HOME environment variable JDK_HOME环境变量
  5. JAVA_HOME environment variable JAVA_HOME环境变量

idea64.exe uses this JDK search sequence: idea64.exe使用此JDK搜索序列:

  1. IDEA_JDK_64 environment variable IDEA_JDK_64环境变量
  2. ..\\jre64 directory ..\\jre64目录
  3. system Registry 系统Registry
  4. JDK_HOME environment variable JDK_HOME环境变量
  5. JAVA_HOME environment variable JAVA_HOME环境变量

It's also possible to start the IDE with <product>.bat file located in the bin directory, it uses the following JDK search sequence: 也可以使用位于bin目录中的<product>.bat文件启动IDE,它使用以下JDK搜索序列:

  1. IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK environment variable (depends on the product) IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK环境变量(取决于产品)
  2. ..\\jre directory ..\\jre目录
  3. JDK_HOME environment variable JDK_HOME环境变量
  4. JAVA_HOME environment variable JAVA_HOME环境变量

Environment variable must point to the JDK installation home directory, for example: 环境变量必须指向JDK安装主目录,例如:

c:\Program Files (x86)\Java\jdk1.7.0_17
  • /create-i4j-log command line switch can be used with the .exe to trace the JDK search sequence and find out why the specific JDK was chosen. /create-i4j-log命令行开关可以与.exe一起使用来跟踪JDK搜索序列并找出选择特定JDK的原因。
  • The actual JDK version used by the IDE can be verified in Help | About 可以在Help | About验证IDE使用的实际JDK版本 Help | About dialog (open any project to access the menu). Help | About对话框(打开任何访问菜单的项目)。
  • Define IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK variable depending on the product to override the default version from IDE_HOME\\jre . 根据产品定义IDEA_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK变量以覆盖IDE_HOME\\jre的默认版本。
  • Use Rapid Environment Editor to add/edit the variables, it will detect incorrect paths. 使用Rapid Environment Editor添加/编辑变量,它将检测不正确的路径。

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

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