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
936 0
Maven - Error:java: Annotation processing is not supported for module cycles. Please ensure that all
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
2月前
|
开发者 Python
【Python】已解决:ERROR: Could not find a version that satisfies the requirement easyocr (from versions: n
【Python】已解决:ERROR: Could not find a version that satisfies the requirement easyocr (from versions: n
58 0
|
4月前
|
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
40 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
|
Linux 开发者 Windows
Flutter报错Building with plugins requires symlink support的解决方法
Flutter报错Building with plugins requires symlink support的解决方法
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
622 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
libcanberra development package not found
libcanberra development package not found
60 0
configure: error: Package requirements (commoncpp 6.2.2) were not met
configure: error: Package requirements (commoncpp 6.2.2) were not met
79 0
编译OpenJDK12:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
编译OpenJDK12:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
109 0