在Jetbrains IntelliJ IDEA 2023上使用自定义启动运行时(Runtime)
环境说明:
IDEA:2023.2.2,内部版本号 #IU-232.9921.47
OS:22.04.1-Ubuntu
想必看这个教程的大部分都是因为fcxit输入法框架在Linux Idea上不跟随的问题吧。
目前中文互联网充斥大量过时的教程,使用Idea2023的几乎不存在,甚至还在使用Choose Runtime
这个插件,其他方法要么是覆盖原来的运行时,要么是添加一个IDEA_JDK
的环境变量,无疑都不够优雅。这篇文章主要是提供一个更方便的方法
首先是官方的修改文档Change the boot Java runtime of the IDE
我们使用第一种方法
Go to Help | Find Action or press
Ctrl
Shift
A
.Find and select the Choose Boot Java Runtime for the IDE action.
Select the new desired runtime and click OK.
If necessary, you can change the location where IntelliJ IDEA will download the selected runtime.
Wait for IntelliJ IDEA to restart with the new runtime.
安装文章说法,你应该可以看到高级选项,然后可以使用自定义Runtime
To use a different Java runtime available on your computer, select Add Custom Runtime… under Advanced in the New field. IntelliJ IDEA lists all the JDKs and JREs that it was able to detect. Select one or click Add JDK to specify the location of the desired Java home directory.
但是我想很多人都会遇到一个问题,没有自定义的选项!
我Google了一段时间,发现已经有人向Jetbrains提了Issue,解决方法是禁用Android的插件
重启后重新选择Runtime,可以自定义Runtime了,解决。
如果对Android插件有需求的可以修改Runtime后启用插件,修改Runtime效果不会消失(但是我不确保没有隐性问题)