Skip to content

Error while compiling #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcust opened this issue Sep 25, 2018 · 5 comments
Closed

Error while compiling #690

marcust opened this issue Sep 25, 2018 · 5 comments
Assignees

Comments

@marcust
Copy link

marcust commented Sep 25, 2018

I'm trying to compile a example real life application with GraalVM, but I'm getting

error: should not reach here: Could not find field java.util.zip.ZipEntry.name on class sun.net.www.protocol.jar.URLJarFile$URLJarFileEntry
Error: Image building with exit status 1

I've no idea where to go from here.

Reproducible via https://github.com/marcust/jzenith/tree/experimental/graalvm

any of the jzenith-example fat jars, eg:

/opt/graalvm/bin/native-image  --verbose  --no-server  -Dio.netty.noUnsafe=true   -H:ReflectionConfigurationFiles=../../jzenith-graalvm-extras/reflectconfigs/netty.json  -H:+ReportUnsupportedElementsAtRuntime  -Dfile.encoding=UTF-8  -jar target/jzenith-example-mysql-0.1-SNAPSHOT-fat.jar 
@cstancu
Copy link
Member

cstancu commented Sep 25, 2018

@marcust what is your Java version?

@marcust
Copy link
Author

marcust commented Sep 25, 2018

@cstancu ok, I was using OpenJDK 10 to build down to 8 Bytecode, that might not have been the best idea.

But now that I switched to OpenJDK 8 (I'm on Ubuntu, so I used update-java-alternatives) and I get the same result. I tried to set a JAVA_HOME but that also did not make any difference. I even completely removed the OpenJDK 10 installation, did also not change anything, still the same error.

To answer your question:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
GraalVM Version 1.0.0-rc6

I just realised that GraalVM is also a complete JDK, but even when I set my path fully to the GraalVM installation and build the jar with that I see the same error.

@cstancu
Copy link
Member

cstancu commented Sep 25, 2018

Thanks for double-checking your Java version. I was able to reproduce this and at first look it seems to be an issue in our substitution mechanism.

@cstancu cstancu self-assigned this Sep 25, 2018
@jhult
Copy link
Contributor

jhult commented Sep 26, 2018

I've hit the same issue when trying to use class.getClassLoader().getResource("myResourceInsideJar").

@cstancu cstancu added the bug label Sep 26, 2018
@cstancu
Copy link
Member

cstancu commented Sep 27, 2018

@marcust the reported issue is fixed in adced00. It didn't make the cut for rc7 so it will be available in rc8 or you can build from source.
However trying to create the image for your example app runs into another issue: fatal error: java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiRenderer$Code. This issue is known and was reported in #656. The workaround is to modify the class path such that it includes the missing type.

@cstancu cstancu closed this as completed Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants