Comments (8)
Hi @srchen1987,
Thank you for reaching out to us.
Did you try using the latest version of GraalVM? you can find it here https://github.com/graalvm/graalvm-ce-builds/releases
Also if you want to create the native image from a class, you can follow the instructions found in this documentation in the from class section
from graal.
Hi @srchen1987,
Thank you for reaching out to us. Did you try using the latest version of GraalVM? you can find it here https://github.com/graalvm/graalvm-ce-builds/releases Also if you want to create the native image from a class, you can follow the instructions found in this documentation in the from class section
Is there a bug in version 21?
from graal.
I found an other bug
./native-image --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.perf=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED -jar xxx.jar
./xxx
Exception in thread "main" java.lang.IllegalAccessError: class com.anywide.dawdler.fatjar.loader.launcher.LaunchedURLClassLoader (in unnamed module @0x2d38eb89) cannot access class jdk.internal.loader.URLClassPath (in module java.base) because module java.base does not export jdk.internal.loader to unnamed module @0x2d38eb89
from graal.
Hi @srchen1987,
While there isn't necessarily a bug in version 21.0.1 (2023-10-17), we highly recommend updating to the latest version. This ensures you have all the most recent updates, including potential fixes for any issues or bugs identified in previous versions.
It looks like you're working on building a simple example for Native Image. Could you please let me know which commands you used to create your executable? Also, did you follow the instructions provided in the documentation link I shared earlier?
from graal.
Here ...
./native-image --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.perf=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED -jar xxx.jar
I found an other bug
./native-image --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.perf=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED -jar xxx.jar
./xxx
Exception in thread "main" java.lang.IllegalAccessError: class com.anywide.dawdler.fatjar.loader.launcher.LaunchedURLClassLoader (in unnamed module @0x2d38eb89) cannot access class jdk.internal.loader.URLClassPath (in module java.base) because module java.base does not export jdk.internal.loader to unnamed module @0x2d38eb89
from graal.
I'm afraid I don't understand what you're trying to do here.
If your goal is to build the Native Image of a simple java class then just like what is specified in the documentation you can follow these steps.
- Create your java class. For example this:
public static void main(String[] args) {
System.out.println("Hello, Native World!");
}
}
- Compile it and build a native executable from the Java class
javac HelloWorld.java
native-image HelloWorld
- Run the application:
./helloworld
from graal.
I'm afraid I don't understand what you're trying to do here. If your goal is to build the Native Image of a simple java class then just like what is specified in the documentation you can follow these steps.
- Create your java class. For example this:
public static void main(String[] args) { System.out.println("Hello, Native World!"); } }
- Compile it and build a native executable from the Java class
javac HelloWorld.java native-image HelloWorld
- Run the application:
./helloworld
A simple example can run. I have tested it before. Please note that I used jpms in my code.
I was added --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED
But run it still reports an error :
Exception in thread "main" java.lang.IllegalAccessError: class com.anywide.dawdler.fatjar.loader.launcher.LaunchedURLClassLoader (in unnamed module @0x2d38eb89) cannot access class jdk.internal.loader.URLClassPath (in module java.base) because module java.base does not export jdk.internal.loader to unnamed module @0x2d38eb89
from graal.
I am not able to reproduce the issue with the information you provided. Could you please create a reproducer and push it in a github repo and share it with me? Also make sure to include the steps you followed to reproduce the issue. Thank you.
from graal.
Related Issues (20)
- [GR-57707] native-image-agent omits String[] from "serialization" when using newConstructorForSerialization HOT 3
- Graal Initialization Failure - Intel i3 Processors 2nd Gen HOT 3
- [GR-57831] StringLatin1.charAt has a substantially supoptimal translation HOT 8
- DNS TXT record value parsing error after packaging Native Image HOT 4
- [GR-57845] Java/Espresso Support: EspressoFinalReference NoSuchMethodError
- Build akka with nativeImageRunAgent warning for java.lang.IndexOutOfBoundsException HOT 1
- [native-image] Runtime error when using java.lang.reflect.Array in library HOT 1
- java.lang.UnsatisfiedLinkError: com.fazecast.jSerialComm.SerialPort.getCommPortsNative() HOT 2
- Trying to generate native image graalVM with quarkus app on Windows doesn't work HOT 1
- com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor class not found for declaringClass: java.time.Ser HOT 1
- AudioSystem.getMixerInfo() returns empty list in native image
- Class.forName does not respect ClassLoader parameter
- [GR-58048] Unexpected process finished for GraalVM for JDK 22 HOT 1
- How to compile as static object file .o (not shared object)? HOT 1
- graalvm Improvements to the way metadata is generated,Metadata is generated by the class name directory, which makes it easy to troubleshoot missing metadata HOT 1
- When using new Date() in JavaScript, if the system time is changed, the returned value is still the time before the modification HOT 1
- The build crashed with $ mx build on IBM Semeru 21 LTS JDK HOT 4
- The build failed with compilation error and $ mx build on Open JDK 21 LTS JDK HOT 1
- Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing com.oracle.svm.core.thread.Target_java_lang_VirtualThread.threadState(Target_java_lang_VirtualThread.java:167) HOT 1
- Java Runtime Error (SIGILL) on AWS Graviton using GraalVM JDK 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graal.