classpath - How to create a Scala presentation compiler inside Ammonite REPL? -


i want create scala presentation compiler in ammonite repl, got error of missing dependency 'object scala in compiler mirror'.

i have tried workaround mentioned in object scala in compiler mirror not found - running scala compiler programatically . unfortunately not work.

how make work?

welcome ammonite repl 1.0.0 (scala 2.12.2 java 1.8.0_131) if ammonite, please support our development @ www.patreon.com/lihaoyi @ import scala.tools.nsc.settings  import scala.tools.nsc.settings @ import scala.tools.nsc.interactive.global  import scala.tools.nsc.interactive.global @ import scala.tools.nsc.reporters.consolereporter  import scala.tools.nsc.reporters.consolereporter @ val settings = new settings()  settings: settings = settings {   -d = . }  @ settings.usejavacp.value = true   @ val reporter = new consolereporter(settings)  reporter: consolereporter = scala.tools.nsc.reporters.consolereporter@4a24170b @ val compiler = new global(settings, reporter)  error: error while loading object, missing dependency 'object scala in compiler mirror', required /library/java/javavirtualmachines/jdk1.8.0_131.jdk/contents/home/jre/lib/rt.jar(java/lang/object.class) scala.reflect.internal.missingrequirementerror: object scala in compiler mirror not found.   scala.reflect.internal.missingrequirementerror$.signal(missingrequirementerror.scala:17)   scala.reflect.internal.missingrequirementerror$.notfound(missingrequirementerror.scala:18)   scala.reflect.internal.mirrors$rootsbase.$anonfun$getmoduleorclass$4(mirrors.scala:54)   scala.reflect.internal.mirrors$rootsbase.getmoduleorclass(mirrors.scala:54)   scala.reflect.internal.mirrors$rootsbase.getmoduleorclass(mirrors.scala:66)   scala.reflect.internal.mirrors$rootsbase.getpackage(mirrors.scala:172)   scala.reflect.internal.definitions$definitionsclass.scalapackage$lzycompute(definitions.scala:169)   scala.reflect.internal.definitions$definitionsclass.scalapackage(definitions.scala:169)   scala.reflect.internal.definitions$definitionsclass.scalapackageclass$lzycompute(definitions.scala:170)   scala.reflect.internal.definitions$definitionsclass.scalapackageclass(definitions.scala:170)   scala.reflect.internal.definitions$definitionsclass.init(definitions.scala:1447)   scala.tools.nsc.global$run.<init>(global.scala:1149)   scala.tools.nsc.interactive.global$typerrun.<init>(global.scala:1308)   scala.tools.nsc.interactive.global.newtyperrun(global.scala:1331)   scala.tools.nsc.interactive.global.<init>(global.scala:286)   ammonite.$sess.cmd6$.<init>(cmd6.sc:1)   ammonite.$sess.cmd6$.<clinit>(cmd6.sc) 

the same code works in official scala repl.

welcome scala 2.12.2 (java hotspot(tm) 64-bit server vm, java 1.8.0_131). type in expressions evaluation. or try :help.  scala> import scala.tools.nsc.settings import scala.tools.nsc.settings  scala> import scala.tools.nsc.interactive.global import scala.tools.nsc.interactive.global  scala> import scala.tools.nsc.reporters.consolereporter import scala.tools.nsc.reporters.consolereporter  scala> val settings = new settings() settings: scala.tools.nsc.settings = settings {   -d = . }  scala> settings.usejavacp.value = true settings.usejavacp.value: boolean = true  scala> val reporter = new consolereporter(settings) reporter: scala.tools.nsc.reporters.consolereporter = scala.tools.nsc.reporters.consolereporter@7eeb38b2  scala> val compiler = new global(settings, reporter) compiler: scala.tools.nsc.interactive.global = scala.tools.nsc.interactive.global@3b6a4b91 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -