GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag

简介: GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag

就是想体验GraalVM使用多语言的时候报错

    public static void main(String[] args) {
        System.out.println("Hello World from Java!");

        Context context = Context.newBuilder().allowAllAccess(true).build();

        context.eval("js", "print('Hello World from JavaScript!');");
        context.eval("python", "print('Hello World from Python!')");
        context.eval("ruby", "puts 'Hello World from Ruby!'");
    }

报错信息

Exception in thread "main" java.lang.IllegalArgumentException: A language with id 'js' is not installed. Installed languages are: [].
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineException.illegalArgument(PolyglotEngineException.java:131)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.throwNotInstalled(PolyglotEngineImpl.java:1105)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.requirePublicLanguage(PolyglotEngineImpl.java:1112)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.requirePublicLanguage(PolyglotContextImpl.java:1502)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.lookupLanguageContext(PolyglotContextImpl.java:1464)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1473)
  at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:63)
  at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:403)
  at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:429)
  at icu.yujing.blog.GraalVMTest.main(GraalVMTest.java:19)

进程已结束,退出代码为 1

提示没安装 安装就好了(未配置graalvm的环境变量时, 应在graalvm包下的bin目录执行命令)

PS F:\ProgramsDev\JDK\graalvm-jdk-17.0.8+9.1\bin> .\gu install js
Downloading: Artifacts catalog from gds.oracle.com
Skipping ULN EE channels, no username provided.
Downloading: Component catalog from www.graalvm.org
Processing Component: Graal.js
Processing Component: ICU4J
Processing Component: TRegex
Additional Components are required:
    ICU4J (org.graalvm.icu4j, version 23.0.1), required by: Graal.js (org.graalvm.js)
    TRegex (org.graalvm.regex, version 23.0.1), required by: Graal.js (org.graalvm.js)
Downloading: Component js: Graal.js from gds.oracle.com
Downloading: Component org.graalvm.icu4j: ICU4J from gds.oracle.com
Downloading: Component org.graalvm.regex: TRegex from gds.oracle.com
Installing new component: TRegex (org.graalvm.regex, version 23.0.1)
Installing new component: ICU4J (org.graalvm.icu4j, version 23.0.1)
Installing new component: Graal.js (org.graalvm.js, version 23.0.1)

graalvm是什么?如何使用?

You can use GraalVM like a Java Development Kit (JDK) in your IDE.

您可以在IDE中像Java开发工具包(JDK)一样使用GraalVM。

相关文章
|
Java Maven
Maven - Error:java: Annotation processing is not supported for module cycles. Please ensure that all
Maven - Error:java: Annotation processing is not supported for module cycles. Please ensure that all
1034 0
Maven - Error:java: Annotation processing is not supported for module cycles. Please ensure that all
|
3月前
|
缓存 Linux 开发工具
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
153 0
|
7月前
|
Linux Docker 容器
problem with installed package podman-1.4.2-5.module_el8.1.0
problem with installed package podman-1.4.2-5.module_el8.1.0
48 0
|
Java 应用服务中间件 Apache
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
libcanberra development package not found
libcanberra development package not found
64 0
|
iOS开发
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
114 0
|
Java iOS开发
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
138 0
|
Java
编译OpenJDK:invalid configuration Files: machine Files not recognized
编译OpenJDK:invalid configuration Files: machine Files not recognized
111 0
|
API 开发工具 Android开发
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
984 0
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
The application could not be installed: INSTALL_FAILED_INSUFFICIENT_STORAGE
The application could not be installed: INSTALL_FAILED_INSUFFICIENT_STORAGE
580 0
The application could not be installed: INSTALL_FAILED_INSUFFICIENT_STORAGE