Open Nightloewe opened 3 years ago
I got it working by also setting System.setProperty("org.graalvm.home", javaHome);
, cause the method org.graalvm.home.impl.DefaultHomeFinder#getGraalVmHomeNative()
returns null
Hello @Nightloewe, I am going to take a look at this issue. If I have any questions I will let you know
Describe GraalVM and your environment :
java -Xinternalversion
:Have you verified this issue still happens when using the latest snapshot? No You can find snapshot builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases
Describe the issue A NullPointerException happens when trying to start a native image using Espresso.
Code snippet or code repository that reproduces the issue
Steps to reproduce the issue Please include both build steps as well as run steps
git clone https://github.com/Nightloewe/NativeTest
mvn clean install
inplugin_api
sub directorymvn -Pnative -DskipTests package
in root directory of the projectnative_test.exe
fromtarget
sub directory into root directory of the projectnative_test.exe -Djava.home=%JAVA_HOME%
with%JAVA_HOME%
being the location of the graalvm installationExpected behavior The Context is built without any exception to happen.
Additional context Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if necesary
Details
``` org.graalvm.polyglot.PolyglotException: java.lang.NullPointerException at com.oracle.truffle.espresso.runtime.EspressoProperties.processOptions(EspressoProperties.java:293) ~[na:na] at com.oracle.truffle.espresso.runtime.EspressoContext.initVmProperties(EspressoContext.java:616) ~[na:na] at com.oracle.truffle.espresso.runtime.EspressoContext.spawnVM(EspressoContext.java:450) ~[na:na] at com.oracle.truffle.espresso.runtime.EspressoContext.initializeContext(EspressoContext.java:410) ~[na:na] at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:143) ~[na:na] at com.oracle.truffle.espresso.EspressoLanguage.initializeContext(EspressoLanguage.java:63) ~[na:na] at com.oracle.truffle.api.TruffleLanguage$Env.postInit(TruffleLanguage.java:3640) ~[na:na] at com.oracle.truffle.api.LanguageAccessor$LanguageImpl.postInitEnv(LanguageAccessor.java:300) ~[na:na] at com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureInitialized(PolyglotLanguageContext.java:638) ~[na:na] at com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1104) ~[na:na] at com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:97) ~[na:na] at org.graalvm.polyglot.Context.getBindings(Context.java:536) ~[na:na] at dev.teamnight.native_test.NativeTestApplication.onApplicationEvent(NativeTestApplication.java:45) ~[native_test.exe:0.0.1-SNAPSHOT] at dev.teamnight.native_test.NativeTestApplication.onApplicationEvent(NativeTestApplication.java:14) ~[native_test.exe:0.0.1-SNAPSHOT] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[na:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[na:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[na:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) ~[na:na] at org.springframework.boot.context.event.EventPublishingRunListener.contextPrepared(EventPublishingRunListener.java:89) ~[native_test.exe:2.5.3] at org.springframework.boot.SpringApplicationRunListeners.lambda$contextPrepared$3(SpringApplicationRunListeners.java:67) ~[na:na] at java.util.ArrayList.forEach(ArrayList.java:1541) ~[native_test.exe:na] at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) ~[na:na] at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) ~[na:na] at org.springframework.boot.SpringApplicationRunListeners.contextPrepared(SpringApplicationRunListeners.java:67) ~[na:na] at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:404) ~[native_test.exe:2.5.3] at org.springframework.boot.SpringApplication.run(SpringApplication.java:337) ~[native_test.exe:2.5.3] at dev.teamnight.native_test.NativeTestApplication.main(NativeTestApplication.java:20) ~[native_test.exe:0.0.1-SNAPSHOT] ```