1

Due to apache-tomcat 10 requirements, I need the "rt.jar" from Java 8 (possibly 7). 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".

Where can I find the jar file for Java8 (and 7) in case?

wheleph
  • 7,974
  • 7
  • 40
  • 57
Ray Holme
  • 11
  • 2
  • Can you explain why you need to compile your stuff to Java 8 exactly? Just yesterday I was able to install a servlet compiled with Java 18 into Apache Tomcat 10.0.23. – wheleph Sep 24 '22 at 17:56

1 Answers1

1

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. That way you can get rt.jar from the necessary version.

SDKMAN is more straightforward to use but ASDF VM is more extensible.

To get started with the latter you need to:

  1. Install ASDF VM
  2. Install the Java plugin
  3. List available for installation JDKs: asdf list-all java
  4. Install the necessary version. Something like 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
wheleph
  • 7,974
  • 7
  • 40
  • 57