简体   繁体   English

从之前的 java 版本下载 rt.jar

[英]downloading rt.jar from prior java releases

Due to apache-tomcat 10 requirements, I need the "rt.jar" from Java 8 (possibly 7).由于 apache-tomcat 10 的要求,我需要 Java 8(可能是 7)的“rt.jar”。 I need to compile my current stuff (I am on jdk 11) using "javac -source 8 -target 8..." (hoping not 7 here) but to do that right javac also needs "-bootclasspath somePathToRight/rt.jar".我需要使用“javac -source 8 -target 8 ...”(希望这里不是 7)编译我当前的东西(我在 jdk 11 上),但要做到这一点,javac 还需要“-bootclasspath somePathToRight/rt.jar” .

Where can I find the jar file for Java8 (and 7) in case?在哪里可以找到 Java8(和 7)的 jar 文件以防万一?

If you use Linux or macOS, then tools like SDKMAN and ASDF VM allow you to install multiple versions of Java at the same time.如果您使用 Linux 或 macOS,那么SDKMAN和 ASDF VM等工具允许您同时安装多个版本的 Java。 That way you can get rt.jar from the necessary version.这样您就可以从必要的版本中获得rt.jar

SDKMAN is more straightforward to use but ASDF VM is more extensible. SDKMAN 更易于使用,但 ASDF VM 更易于扩展。

To get started with the latter you need to:要开始使用后者,您需要:

  1. Install ASDF VM安装 ASDF 虚拟机
  2. Install the Java plugin安装 Java 插件
  3. List available for installation JDKs: asdf list-all java可用于安装 JDK 的列表: asdf list-all java
  4. Install the necessary version.安装必要的版本。 Something like asdf install java adoptopenjdk-8.0.345+1 asdf install java adoptopenjdk-8.0.345+1
  5. The JDK will be installed to a directory like ~/.asdf/installs/java/adoptopenjdk-8.0.345+1 JDK 将安装到~/.asdf/installs/java/adoptopenjdk-8.0.345+1等目录

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

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