maven 如何使用Python安装GraalVM?

3lxsmp7m  于 2023-11-17  发布在  Maven
关注(0)|答案(1)|浏览(167)

我想测试GraalVM project。我首先安装了graalvm-jdk-21.0.1+12.1;然而,在我必须运行命令“"${JAVA_HOME}"/bin/gu install python”的步骤中,我遇到了麻烦。“graalvm-jdk-21.0.1+12.1”目录中没有/bin/gu文件。
然后我安装了包含/bin/gu文件的graalvm-jdk-17.0.9+11.1。但这次我遇到了另一个问题:Python not available
我试图跳过这一步并运行“mvn compile”,它给出了下面的错误:`

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.623 s
[INFO] Finished at: 2023-10-18T15:08:57+04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-graalvm-python) on project PygalExample: org.apache.maven.plugins.enforcer.RequireFilesExist failed with message:
[ERROR] You must set JAVA_HOME to a GraalVM with Python installed.
[ERROR] Some required files are missing:
[ERROR] /home/eshqin/Downloads/graalvm-jdk-17_linux-x64_bin/graalvm-jdk-17.0.9+11.1/bin/graalpython
[ERROR] 
[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

字符串
我如何解决这个问题并复制测试?当我运行“mvn clean install”时,它也失败了。
操作系统是Ubuntu 20.04
我想这个项目被编译并成功运行。

o2g1uqev

o2g1uqev1#

GraalVM的最新版本(GraalVM for JDK 21)改变了语言的部署方式。没有gu(Graal Updater),GraalPy没有安装到GraalVM安装中,而是发布在Mavencentral上。本文中的pom.xml脚本假设GraalVM的旧版本。我们将更新本文。
目前,这是一篇关于变化的新文章:
https://medium.com/graalvm/truffle-unchained-13887b77b62c
你必须相应地修改旧GraalPy文章中的pom.xml。另一种方法是使用新GraalPy的standalone工具来生成Java应用程序的框架:
https://www.graalvm.org/latest/reference-manual/python/standalone-binaries/#embedding-graalpy-in-a-java-application

相关问题