javac unzips class files from jars on class path into output directory

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Mar 7 17:55:48 UTC 2017



On 03/07/2017 08:06 AM, Doug Simon wrote:
> To be able to develop Graal on JDK 9, we're using the `--release 8` javac option and providing jar files for API that is either not in 9 or is not exported in 9. Here is a simplified form of a javac command:
>
> javac -cp jdk.internal.vm.ci.jar:jdk.unsupported_sun.misc.Unsafe.jar -d bin/ --release 8 graal/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/*.java
>
> where:
>
> dsimon at kurz-3 ~/h/graal-core> ls graal/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/*.java
> graal/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
> graal/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
>
> I expect 2 class files to be written to bin/. However, I see a number of files from jdk.internal.vm.ci.jar in bin:
>
> dsimon at kurz-3 ~/h/graal-core> jar tf jdk.internal.vm.ci.jar | wc -l
>       444
> dsimon at kurz-3 ~/h/graal-core> find bin/jdk/vm/ci | wc -l
>        55
>
> I'm guessing that these are the classes in jdk.internal.vm.ci.jar referenced (transitively?) from the Graal sources.
>
> Why is this happening? That is, why is javac extracting classes from a jar on the classpath and putting them in the output directory?
>
> -Doug

Doug,

Can you provide a more complete test case?

-- Jon


More information about the jigsaw-dev mailing list