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
1042 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
|
4月前
|
Java
No compiler detected, make sure you are running on top of a JDK instead of a JRE
No compiler detected, make sure you are running on top of a JDK instead of a JRE
63 1
|
6月前
|
Java Maven
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
446 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
|
Java Maven
The JAVA_HOME environment variable is not defined correctly 解决方法
解决措施:去设置里把JAVA8卸载掉,注意右击卸载,不要直接删根目录,然后把环境变量JAVA8_HOME也删掉,JAVA8 再见
801 0
The JAVA_HOME environment variable is not defined correctly 解决方法
libcanberra development package not found
libcanberra development package not found
64 0
|
XML 开发工具 Android开发
R.java was modified manually Reverting to generated version
R.java was modified manually Reverting to generated version

热门文章

最新文章