2

Migration guide seems to state that after JEP 220 both JDK and JRE install in lib directory

dynamically linked libraries and the complete internal implementation of the JDK.

Since it says "complete" does this mean, for example, tools.jar which previously did not ship with JRE, now indeed ships on JRE as part of libjvm?.

Analysing Ubuntu packages

it seems JDK version does not install anything extra under lib/ although it does install bunch of modules under jmods/. AFAIU, .jmods are relevant if one ships app with modular image, however they are not strictly necessary for building an application?

I understand similar question has been asked many times in pre-JDK9 world, however after JEP 220 introduced significant changes, what extra APIs are provided by JDK installation that are not provided by just JRE installation?

Mario Galic
  • 47,285
  • 6
  • 56
  • 98
  • 1
    The `.jmod` file are packaged modules, used by the `jlink` tool, nothing else. Everything is modules now, no need for tools.jar since JDK 9. The classes that used to be in tools.jar are now in their respective modules (jdk.compiler, jdk.javadoc, ...). What is your issue? – Alan Bateman Mar 16 '20 at 08:13
  • @AlanBateman Seemingly, I am able to call Java compiler API with just JRE installation, whilst pre-9 I had to have full JDK because, AFAIU, compiler API was in tools.jar which only shipped with full JDK. Thus, I am wondering if now just JRE has everything one needs including what was previously in tools.jar? – Mario Galic Mar 16 '20 at 18:51
  • 1
    Does `java --list-modules` list `jdk.compiler`? If so then you are using a run-time image that has the java compiler. – Alan Bateman Mar 17 '20 at 06:54
  • @AlanBateman Indeed, there exists `java.compiler` and `jdk.compiler`. I guess JRE now does ship with complete APIs, or it could be just how Ubuntu decided to package it. Do you mind posting your comments as answer so I can accept it. – Mario Galic Mar 17 '20 at 08:59
  • If `jdk.compiler` is listed then it means the `javac` compiler is in the run-time image. What does `java -version` and `which java` say? Asking because it sounds like an installation issue or that your PATH isn't set correctly. – Alan Bateman Mar 17 '20 at 09:46
  • @AlanBateman `javac` CLI tool is not installed anywhere on the system according to `sudo / -name javac`. This is a fresh install of Ubuntu with only [openjdk-11-jre-headless](https://packages.ubuntu.com/bionic/i386/openjdk-11-jre-headless/filelist). `which java` gives `/usr/bin/java`, whilst `java -version` gives `11.0.6`. – Mario Galic Mar 17 '20 at 09:54
  • 1
    I can't tell what is going on there, maybe they are stripping binaries from the run-time image. I suggest a bug report to point out that the java compiler is in the jdk.compiler module, it's crazy for a run-time image to claim that it has this module but not have the java launcher. – Alan Bateman Mar 17 '20 at 10:44

0 Answers0