Reputation: 869
I cannot run the command in Catalina 10.15.2:
bash-3.2$ $GRAALVM_HOME/Home/bin/gu install native-image
It returns me this message:
cannot be opened because the developer cannot be verified.
I have tried running
sudo xattr -r -d com.apple.quarantine $GRAALVM_HOME
where
bash-3.2$ echo $GRAALVM_HOME
/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents
with no luck. I cannot run the command, so i cannot run succesfully the command
mvn install -Pnative
.
[pastebin][1]
I have already read this [thread][2], not worked for me.
Help, please
UPDATE
ok, i have applied the suggestion, and now i can create native-image, but when i try to run mvn install -Pnative i got one error:
~/g/q/quarkus-echo> echo $GRAALVM_HOME
/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0
aironman@MacBook-Pro-de-Alonso ~/g/q/quarkus-echo> cd $GRAALVM_HOME
aironman@MacBook-Pro-de-Alonso /L/J/J/graalvm-ce-java8-19.3.0> sudo xattr -r -d com.apple.quarantine $GRAALVM_HOME
Password:
bash-3.2$ /Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents/Home/bin/gu install native-image
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Downloading: Component native-image: Native Image from github.com
Installing new component: Native Image (org.graalvm.native-image, version 19.3.0)
bash-3.2$ pwd
/Users/aironman/gitProjects/quarkus-test/quarkus-echo
bash-3.2$ mvn install -Pnative
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< ujr.combat.quarkus:quarkus-echo >-------------------
[INFO] Building quarkus-echo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ quarkus-echo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ quarkus-echo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ quarkus-echo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/aironman/gitProjects/quarkus-test/quarkus-echo/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ quarkus-echo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ quarkus-echo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running ujr.combat.quarkus.EchoResourceTest
2020-01-13 17:13:45,816 INFO [io.quarkus] (main) Quarkus 1.1.1.Final started in 0.324s. Listening on: http://0.0.0.0:8081
2020-01-13 17:13:45,829 INFO [io.quarkus] (main) Profile test activated.
2020-01-13 17:13:45,829 INFO [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jsonb]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.998 s - in ujr.combat.quarkus.EchoResourceTest
2020-01-13 17:13:46,604 INFO [io.quarkus] (main) Quarkus stopped in 0.028s
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ quarkus-echo ---
[INFO]
[INFO] --- quarkus-maven-plugin:1.1.1.Final:build (default) @ quarkus-echo ---
[INFO] [org.jboss.threads] JBoss Threads version 3.0.0.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /Users/aironman/gitProjects/quarkus-test/quarkus-echo/target/quarkus-echo-1.0-SNAPSHOT-native-image-source-jar/quarkus-echo-1.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /Users/aironman/gitProjects/quarkus-test/quarkus-echo/target/quarkus-echo-1.0-SNAPSHOT-native-image-source-jar/quarkus-echo-1.0-SNAPSHOT-runner.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.070 s
[INFO] Finished at: 2020-01-13T17:13:48+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.1.1.Final:build (default) on project quarkus-echo: Failed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Cannot find the `native-image` in the GRAALVM_HOME, JAVA_HOME and System PATH. Install it using `gu install native-image`
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.getNativeImageExecutable(NativeImageBuildStep.java:376)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:134)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:830)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
bash-3.2$ echo $GRAALVM_HOME
/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0
bash-3.2$
UPDATE 2
After Viktor suggestion, i changed GRAALVM_HOME:
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents/Home
bash-3.2$ export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents/Home
bash-3.2$ /Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents/Home/bin/gu install native-image
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Component Native Image (org.graalvm.native-image) is already installed.
bash-3.2$ pwd
/Users/aironman/gitProjects/quarkus-test/quarkus-echo
bash-3.2$ mvn install -Pnative
...
project quarkus-echo: Failed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.IllegalStateException: Unsupported version of GraalVM detected: GraalVM Version 19.3.0 CE. Please use GraalVM 19.2.1.
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.checkGraalVMVersion(NativeImageBuildStep.java:340)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:155)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:830)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It looks like i have to downgrade to GRAALVM 19.2.1...
Thank you guys for the assistance. I will see how to downgrade to required version using brew...
Upvotes: 4
Views: 12752
Reputation: 767
brew install --cask graalvm/tap/graalvm-ce-lts-java11
curl -L -o graalvm-ce-java11-darwin-aarch64-22.1.0.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.1.0/graalvm-ce-java11-darwin-aarch64-22.1.0.tar.gz
sudo mv graalvm-ce-java11-22.1.0 /Library/Java/JavaVirtualMachines
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-lts-java11/Contents/Home
/Library/Java/JavaVirtualMachines/graalvm-ce-lts-java11/Contents/Home/bin/gu install native-image
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-lts-java11/Contents/Home
export PATH=$PATH:$GRAALVM_HOME
source ~/.zshrc
mvn package -Dquarkus.package.type=native
OR
./gradlew build -Dquarkus.package.type=native
Upvotes: 4
Reputation: 3729
This worked for me 10 minutes ago on OSX 0.14.6 Mojave
had the same issue with
brew install --cask graalvm/tap/graalvm-ce-java11
# check your version and fix the last part of path
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.3.0
# install native image
/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.3.0/Contents/Home/bin/gu install native-image
# don't forget to fix version of GraalVM, yours can be newer
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.3.0/Contents/Home
./gradlew build -Dquarkus.package.type=native
Upvotes: 8
Reputation: 26579
You need to run the quarantine removal on the topdir:
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0
Upvotes: 9