Skip to content
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

Missing field: name: Ljava/lang/String; in Klass<Ljava/lang/Thread;> when try to run Java 8 on Espresso #10748

Open
wschung1994 opened this issue Feb 24, 2025 · 1 comment
Assignees
Labels

Comments

@wschung1994
Copy link

Describe the issue
After installing the Espresso on this page:

https://www.graalvm.org/latest/reference-manual/espresso/

When I run the command on the page to run java 8 on the downloaded espresso

java --java.JavaHome=/path/to/java8/home -version

I am getting the following error:

Internal error:
org.graalvm.polyglot.PolyglotException: com.oracle.truffle.espresso.meta.EspressoError: should not reach here: Missing field: name: Ljava/lang/String; in Klass<Ljava/lang/Thread;>
at com.oracle.truffle.espresso.impl.Klass.requireDeclaredField(Klass.java:1395)
at com.oracle.truffle.espresso.meta.Meta.(Meta.java:540)
at com.oracle.truffle.espresso.runtime.EspressoContext.spawnVM(EspressoContext.java:425)
at com.oracle.truffle.espresso.runtime.EspressoContext.initializeContext(EspressoContext.java:320)
at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:294)
at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:94)
at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$Env.postInit(TruffleLanguage.java:3927)
at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.postInitEnv(LanguageAccessor.java:288)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureInitialized(PolyglotLanguageContext.java:771)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1467)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:95)
at org.graalvm.polyglot/org.graalvm.polyglot.Context.getBindings(Context.java:563)
at com.oracle.truffle.espresso.libjavavm.LibEspresso.createJavaVM(LibEspresso.java:81)
Suppressed: Attached Guest Language Frames (0)
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.

This is the java 8 version:

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

I also tried the latest version Java 8 which can be downloaded:

java version "1.8.0_431"
Java(TM) SE Runtime Environment (build 1.8.0_431-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.431-b10, mixed mode)

In this case, I am getting the following error:

Error: A JNI error has occurred, please check your installation and try again

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. Download the espresso for Linux on https://www.graalvm.org/latest/reference-manual/espresso/
  2. Download and install Java 8
  3. run the command "java --java.JavaHome=/path/to/java8/home -version"

Describe GraalVM and your environment:

  • GraalVM version (latest snapshot builds can be found here), or commit id if built from source: [CE 21.0.2+13.1]
  • JDK major version: [21.0.2]
  • OS: [Linux (ubuntu 22.4]
  • Architecture: [x64]

More details
Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.

    PASTE YOUR LOG/STACK TRACE HERE

Internal error:
org.graalvm.polyglot.PolyglotException: com.oracle.truffle.espresso.meta.EspressoError: should not reach here: Missing field: name: Ljava/lang/String; in Klass<Ljava/lang/Thread;>
at com.oracle.truffle.espresso.impl.Klass.requireDeclaredField(Klass.java:1395)
at com.oracle.truffle.espresso.meta.Meta.(Meta.java:540)
at com.oracle.truffle.espresso.runtime.EspressoContext.spawnVM(EspressoContext.java:425)
at com.oracle.truffle.espresso.runtime.EspressoContext.initializeContext(EspressoContext.java:320)
at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:294)
at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:94)
at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$Env.postInit(TruffleLanguage.java:3927)
at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.postInitEnv(LanguageAccessor.java:288)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureInitialized(PolyglotLanguageContext.java:771)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1467)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:95)
at org.graalvm.polyglot/org.graalvm.polyglot.Context.getBindings(Context.java:563)
at com.oracle.truffle.espresso.libjavavm.LibEspresso.createJavaVM(LibEspresso.java:81)
Suppressed: Attached Guest Language Frames (0)

@fernando-valdez fernando-valdez self-assigned this Feb 25, 2025
@fernando-valdez
Copy link
Member

Thanks for reporting this issue. I will take a look at it and will let you know if I have any question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants