-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
`javac` initially didn't support the `Class-Path` attribute in Manifest files [1,2] for jar-files on the `--class-path` at all. This support was only added in JDK 5.0 by JDK-4212732 and the documentation of the feature is still pending and currently targeted for JDK 26 (see JDK-8278856).
`javac` currently doesn't support (i.e. ignores) `Class-Path` attribute in Manifest files [1,2] for jar-files on the `--processor-path`. Java annotation processors can be placed either on the `--class-path` or on the `--processor-path` [3] and the inconsistent handling of the `Class-Path` attribute, depending on whether a jar-file is placed on the `--class-path` or the `--processor-path`, makes it difficult to migrate annotations processors from the `--class-path` to the `--processor-path`.
Annotation processors are executed in the "runtime environment" as opposed to the "compilation environment" [4]. This distinction is especially important if annotation processors are placed on the `--processor-path`, because in such cases, their dependencies can't be put on the normal `--class-path` but instead have to be placed either on the `--processor-path` as well or they will have to made available directly to the host JVM with the help of `-J--class-path` options.
It would be helpful if `javac` could be extended such that it honors the `Class-Path` attribute in Manifest files for jar-files on the `--processor-path` such that it adds the attribute's value to the `--processor-path`.
[1] https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#classpath
[2] https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html
[3] https://docs.oracle.com/en/java/javase/24/docs/specs/man/javac.html#annotation-processing
[4] https://docs.oracle.com/en/java/javase/24/docs/specs/man/javac.html#compilation-environment-and-runtime-environment.
`javac` currently doesn't support (i.e. ignores) `Class-Path` attribute in Manifest files [1,2] for jar-files on the `--processor-path`. Java annotation processors can be placed either on the `--class-path` or on the `--processor-path` [3] and the inconsistent handling of the `Class-Path` attribute, depending on whether a jar-file is placed on the `--class-path` or the `--processor-path`, makes it difficult to migrate annotations processors from the `--class-path` to the `--processor-path`.
Annotation processors are executed in the "runtime environment" as opposed to the "compilation environment" [4]. This distinction is especially important if annotation processors are placed on the `--processor-path`, because in such cases, their dependencies can't be put on the normal `--class-path` but instead have to be placed either on the `--processor-path` as well or they will have to made available directly to the host JVM with the help of `-J--class-path` options.
It would be helpful if `javac` could be extended such that it honors the `Class-Path` attribute in Manifest files for jar-files on the `--processor-path` such that it adds the attribute's value to the `--processor-path`.
[1] https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#classpath
[2] https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html
[3] https://docs.oracle.com/en/java/javase/24/docs/specs/man/javac.html#annotation-processing
[4] https://docs.oracle.com/en/java/javase/24/docs/specs/man/javac.html#compilation-environment-and-runtime-environment.
- relates to
-
JDK-8278856 javac documentation does not mention use of Manifest class-path attribute
-
- In Progress
-
-
JDK-4212732 javac seems to ignore classpath manifest entries in jar files
-
- Resolved
-