有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何降级JDK?

目前我的Java版本是17Neo4j需要我安装Java 11或OpenJDK 11,否则它会给出错误^{}。我想我需要降级到JDK 11

Java Platform, Standard Edition 11 Reference Implementations是我唯一能买到JDK 11的地方。然而,它似乎是一个二进制文件,而不是一个设置。检查C:\Program Files\Java我找到了一个jdk-17和jre1的文件夹。8.0,所以我复制了刚刚下载的jdk-11文件夹。检查路径环境时,我看到以下两行:

C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Common Files\Oracle\Java\javapath

检查javapath中的64位,我发现有java。exe,javac。exe,javaw。exe,jshell。exe。这是否意味着我应该用jdk-11中的文件替换这些文件


共 (1) 个答案

  1. # 1 楼答案

    1. 创建指向首选版本的新自定义变量

    2. 将%JAVA_HOME%/bin设置为Path变量的第一个条目

    3. 利润

      检查一下java -version

    Why not just remove the Oracle Java path entry and not worry about your JAVA_HOME placement in the Path?

    You might suggest to simply remove the Oracle Java path that was prepended to your Windows PATH by the installer. Yes, I thought of that too, but the installer also copies the java.exe, javaw.exe, and javaws.exe files to C:\Windows\System32 directory, which is also in the Windows PATH variable. So rather than chase down all the possible directories that the installer put Java, and to avoid deleting the System32 files that actually may be necessary to some process somewhere, I decided that simply prepending my preferred Java Home directory to the path was best option.

    资料来源:How to set custom Java path after installing JDK 8 – Douglas C. Ayers