Open streamingdv opened 1 year ago
Hi @streamingdv, Thanks for reporting this issue, we will try to reproduce it and get back to you.
@streamingdv We have not been able to reproduce this issue.
Strange, it still doesn't work on my PC though with the same setup I posted above.
Can you please try to add -H:TempDirectory
flag to the native-image command, to point to dev directory C:\\Users\\<USER>\\dev\\svmtmp
, and try again.
graalvmNative {
binaries {
main {
buildArgs.add('-H:TempDirectory=C:\\Users\\<USER>\\dev\\svmtmp')
}
}
@brahimhaddou @marwan-hallaoui
same issue on my windows machine
[1/8] Initializing... (10.3s @ 0.36GB) Java version: 22+36, vendor version: Oracle GraalVM 22+36.1 Graal compiler: optimization level: 2, target machine: x86-64-v3, PGO: ML-inferred C compiler: cl.exe (microsoft, x64, 19.39.33523) Garbage collector: Serial GC (max heap size: 80% of RAM) 2 user-specific feature(s):
1 experimental option(s) unlocked:
Build resources:
[8/8] Creating image... [**] (0.0s @ 7.24GB)
## Stack Trace
```java
java.lang.NegativeArraySizeException: -1619337216
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.RelocatableBuffer.<init>(RelocatableBuffer.java:56)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImage.build(NativeImage.java:468)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:699)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:537)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:526)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:701)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:140)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:95)
Name | Value |
---|---|
Java version | 22+36 |
Vendor version | Oracle GraalVM 22+36.1 |
Runtime version | 22+36-jvmci-b02 |
C compiler | cl.exe (microsoft, x64, 19.39.33523) |
release
file@brahimhaddou I encountered the same error as you did. During troubleshooting, I found that it was due to several jar packages. Removing them from Maven allowed the exe to be packaged normally. Unfortunately, my main logic relies on these jar packages. The packages I imported are the following three:
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv-platform</artifactId>
<version>1.5.10</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>6.1.1-1.5.10</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.5.10</version>
</dependency>
Name | Value |
---|---|
Java version | 17.0.9+9 |
Vendor version | GraalVM CE 17.0.9+9.1 |
Runtime version | 17.0.9+9-jvmci-23.0-b22 |
C compiler | cl.exe (microsoft, x64, 19.38.33133) |
release
fileIMPLEMENTOR="GraalVM Community"
JAVA_RUNTIME_VERSION="17.0.9+9-jvmci-23.0-b22"
JAVA_VERSION="17.0.9"
JAVA_VERSION_DATE="2023-10-17"
LIBC="default"
MODULES="java.base java.compiler java.instrument java.logging java.management jdk.internal.vm.ci jdk.jfr jdk.unsupported org.graalvm.sdk java.datatransfer java.xml java.prefs java.desktop java.transaction.xa java.sql jdk.management org.graalvm.truffle jdk.internal.vm.compiler com.oracle.graal.graal_enterprise com.oracle.svm.extraimage_enterprise com.oracle.svm.svm_enterprise com.oracle.svm_enterprise.ml_dataset java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.incubator.foreign jdk.incubator.vector jdk.internal.le jdk.internal.opt jdk.internal.vm.compiler.management jdk.internal.vm.compiler.truffle.jfr jdk.jartool jdk.javadoc jdk.jcmd jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported.desktop jdk.xml.dom jdk.zipfs org.graalvm.extraimage.builder org.graalvm.js.scriptengine org.graalvm.locator org.graalvm.nativeimage.llvm"
OS_ARCH="x86_64"
OS_NAME="Windows"
SOURCE=".:git:1fcfe930ebdb+ labsjdk-builder:39179710e6adc4516c2d9e8b108e11584578e659 compiler:aeab112b50799393fd379ac14057a09fb518a6e1 graal-js:e2b74f45ce0eb8ae3f9bd24b068f128e91d607e8 java-benchmarks:aeab112b50799393fd379ac14057a09fb518a6e1 regex:aeab112b50799393fd379ac14057a09fb518a6e1 sdk:aeab112b50799393fd379ac14057a09fb518a6e1 substratevm:aeab112b50799393fd379ac14057a09fb518a6e1 tools:aeab112b50799393fd379ac14057a09fb518a6e1 truffle:aeab112b50799393fd379ac14057a09fb518a6e1 vm:aeab112b50799393fd379ac14057a09fb518a6e1"
GRAALVM_VERSION="23.0.2"
COMMIT_INFO={"compiler": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "graal-js": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1696419001, "commit.rev": "e2b74f45ce0eb8ae3f9bd24b068f128e91d607e8"}, "java-benchmarks": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "regex": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "sdk": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "substratevm": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "tools": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "truffle": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}, "vm": {"commit.committer": "Marouane El Hallaoui <marouane.el.hallaoui@oracle.com>", "commit.committer-ts": 1697732165, "commit.rev": "aeab112b50799393fd379ac14057a09fb518a6e1"}}
component_catalog="https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java17.properties|{ee=GraalVM Enterprise Edition}rest://gds.oracle.com/api/20220101/"
GDS_PRODUCT_ID="D53FAE8052773FFAE0530F15000AA6C6"
I got javacv to work on mine and was able to compile into native-image. The Negative error you guys encounter is because you're packing more than 2GB into the native image. Try separating the native libraries from the native-image.
I got javacv to work on mine and was able to compile into native-image. The Negative error you guys encounter is because you're packing more than 2GB into the native image. Try separating the native libraries from the native-image.
You're right. Thank you very much
I got javacv to work on mine and was able to compile into native-image. The Negative error you guys encounter is because you're packing more than 2GB into the native image. Try separating the native libraries from the native-image.
How to separate? Can you say something? Currently it seems Graalvm can only package it into a native executable file
I got javacv to work on mine and was able to compile into native-image. The Negative error you guys encounter is because you're packing more than 2GB into the native image. Try separating the native libraries from the native-image.
You need to dynamically load the corresponding platform's DLLs at program startup and declare the dependency on JavaCV in the module-info.java file
@aliiy can you please share with us a sample how you made it work?
Describe the issue Tried to follow your tutorial here and I used the community edition 22.3.2 Java 17 downloaded from here. I navigate to my project in and executed via
.\gradlew nativeCompile
the Native Tools Command Prompt. I get a java.lang.NegativeArraySizeException exception when I execute the nativeCompile command. I have no idea what could be the problem. The project is a standard JavaFX gradle project.Steps to reproduce the issue I use the id
'org.graalvm.buildtools.native' version '0.9.21'
gradle plugin then I execute the.\gradlew nativeCompile
the Native Tools Command PromptDescribe GraalVM and your environment:
More details The build.gradle of my test project looks like this
The main class like this
Command line output