scala EPFL线程“主"中的异常java.lang.NoClassDefFoundError:javax/script/Compilable

编程入门 行业动态 更新时间:2024-10-28 16:26:26
本文介绍了scala EPFL线程“主"中的异常java.lang.NoClassDefFoundError:javax/script/Compilable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我对 Scala 和JVM编程完全陌生.我最近加入的团队使用scala来构建要在Spark上运行的程序.工作中的堆栈稳定且功能正常,但其复杂性与我在家里的需求不符:仅仅是拥有功能性Scala外壳的人在添加任何"环境复杂性"

I am a complete noob on Scala and JVM programming. The team I recently joined uses scala to build programs to be run on Spark. The stack at work is stable and functional but its complexity does not match the needs I have at home: merely the one to have a functional scala shell to get a bit more familiar with the language, try things, get the syntax right before adding any "environmental complexity"

[注意]我只想让某些东西与此文档(因此,请不要根据编译器,sbt,IDE等来回答)

[NOTE] I just want something dumb in the same vein of this documentation (so, please not answer based on compilers, sbt, IDE, etc etc)

david@ripper$ java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode) david@ripper$ scala -version Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

这是我吃午餐时得到的东西

Here is what I get when lunching the shell

david@ripper$ scala Exception in thread "main" java.lang.NoClassDefFoundError: javax/script/Compilable at scala.tools.nsc.interpreter.ILoop.createInterpreter(ILoop.scala:118) at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:911) at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:909) at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:909) at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97) at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:909) at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74) at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87) at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98) at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

这似乎是一个经典问题,尽管我首先与系统上安装了 Oracle Java 11 有关.但是,我认为我使用以下命令将openjdk8设置为默认的,系统范围的JRE:

It seems like a classical issue I first though related with the fact that I have an Oracle java 11 installed on my system. However, I thought that I made openjdk8 is the default, system-wide JRE with this:

update-alternatives --config java Il existe 2 choix pour l'alternative java (qui fournit /usr/bin/java). Sélection Chemin Priorité État ------------------------------------------------------------ 0 /usr/lib/jvm/java-11-oracle/bin/java 1091 mode automatique 1 /usr/lib/jvm/java-11-oracle/bin/java 1091 mode manuel * 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 mode manuel

我想念的是什么.不是使用/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 标量.我正在使用 Debian 9

What am I missing. Isn't scala using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java. I am using the default scala package provided in Debian 9

推荐答案

结果是, update-alternatives --config java 并没有更改用户PATH的 JAVA_HOME (仍然指向java11).似乎scala-shell不使用系统的默认JRE,而是使用一个.bashrc(在我的情况下为.zshrc)指向.

Turns out, update-alternatives --config java did not change the JAVA_HOME of the user's PATH (which still pointed to java11). It seems that the scala-shell does not use the system's default JRE but, rather, the one .bashrc (in my case .zshrc) points to.

更多推荐

scala EPFL线程“主"中的异常java.lang.NoClassDefFoundError:javax/script/Compilable

本文发布于:2023-05-31 10:01:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/389499.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   异常   scala   quot   EPFL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!