This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Scala Interpreter error

8 replies
jleuenberger
Joined: 2009-09-12,
User offline. Last seen 3 years 7 weeks ago.

Hello,
There is an error when I try to run the Scala Interpreter in
Eclipse(v3.5.1) using the latest Scala nightly plugin.
Here is how to recreate the bug:
right-click on the Scala project, Scala -> Create Scala Interpreter.

Console output:
-----------------------------

Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java HotSpot(TM)
Server VM, Java 1.6.0_15).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :9: error: not found: type Interpreter
class InterpreterSettings(repl: Interpreter) {
^
:3: error: type InterpreterSettings is not a member of package
scala.tools.nsc
var value: scala.tools.nsc.InterpreterSettings = _
^
Exception in thread "main" java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:169)
at scala.None$.get(Option.scala:167)
at
scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
at
scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
at
scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
at
scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
at scala.util.control.Exception$Catch.apply(Exception.scala:79)
at scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
at
scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
at scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
at scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
:4: error: type InterpreterSettings is not a member of package
scala.tools.nsc
def set(x: Any) = value =
x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
^
---------------------------

Johan

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Scala Interpreter error
I apologize.  I haven't had time to keep up/maintain the scala interpreter/console in Eclipse.  I'm pretty sure things have changed enough on trunk to break.  I would like to say I'd fix it, but unfortunately, the amount of time it takes to set up a development enivornment for the Eclipse Scala plugin on my machine usually entails my entire free time for that day.  If there's someone else who is maintaining a development environment, I can guide you through the process of fixing the interpreter, but unfrouantely can't commit to doing this myself.

BTW this looks like a valid bug.

- Josh

On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger <johan.leuenberger@epfl.ch> wrote:
Hello,
There is an error when I try to run the Scala Interpreter in Eclipse(v3.5.1) using the latest Scala nightly plugin.
Here is how to recreate the bug:
right-click on the Scala project, Scala -> Create Scala Interpreter.

Console output:
-----------------------------

Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java HotSpot(TM) Server VM, Java 1.6.0_15).
Type in expressions to have them evaluated.
Type :help for more information.

scala> <script>:9: error: not found: type Interpreter
class InterpreterSettings(repl: Interpreter) {
                              ^
<script>:3: error: type InterpreterSettings is not a member of package scala.tools.nsc
 var value: scala.tools.nsc.InterpreterSettings = _
                            ^
Exception in thread "main" java.util.NoSuchElementException: None.get
  at scala.None$.get(Option.scala:169)
  at scala.None$.get(Option.scala:167)
  at scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
  at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
  at scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
  at scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
  at scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
  at scala.util.control.Exception$Catch.apply(Exception.scala:79)
  at scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
  at scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
  at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
  at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
  at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
  at scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
  at scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
<script>:4: error: type InterpreterSettings is not a member of package scala.tools.nsc
 def set(x: Any) = value = x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
                                                          ^
---------------------------

Johan

jleuenberger
Joined: 2009-09-12,
User offline. Last seen 3 years 7 weeks ago.
Re: Scala Interpreter error

It would be great if I could help fix this bug. I have a working
development environment and i looked at the code but i don't see where
the problem is located. May the errors is in the
InterpreterLaunchConfigurationDelegate class or where else?

-Johan

Josh Suereth wrote:
> I apologize. I haven't had time to keep up/maintain the scala
> interpreter/console in Eclipse. I'm pretty sure things have changed
> enough on trunk to break. I would like to say I'd fix it, but
> unfortunately, the amount of time it takes to set up a development
> enivornment for the Eclipse Scala plugin on my machine usually entails
> my entire free time for that day. If there's someone else who is
> maintaining a development environment, I can guide you through the
> process of fixing the interpreter, but unfrouantely can't commit to
> doing this myself.
>
> BTW this looks like a valid bug.
>
> - Josh
>
> On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
> > wrote:
>
> Hello,
> There is an error when I try to run the Scala Interpreter in
> Eclipse(v3.5.1) using the latest Scala nightly plugin.
> Here is how to recreate the bug:
> right-click on the Scala project, Scala -> Create Scala Interpreter.
>
> Console output:
> -----------------------------
>
> Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
> HotSpot(TM) Server VM, Java 1.6.0_15).
> Type in expressions to have them evaluated.
> Type :help for more information.
>
> scala> :9: error: not found: type Interpreter
> class InterpreterSettings(repl: Interpreter) {
> ^
> :3: error: type InterpreterSettings is not a member of
> package scala.tools.nsc
> var value: scala.tools.nsc.InterpreterSettings = _
> ^
> Exception in thread "main" java.util.NoSuchElementException: None.get
> at scala.None$.get(Option.scala:169)
> at scala.None$.get(Option.scala:167)
> at
> scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
> at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
> at
> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
> at
> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
> at
> scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
> at scala.util.control.Exception$Catch.apply(Exception.scala:79)
> at scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
> at
> scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
> at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
> at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
> at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
> at scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
> at scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
> :4: error: type InterpreterSettings is not a member of
> package scala.tools.nsc
> def set(x: Any) = value =
> x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
> ^
> ---------------------------
>
> Johan
>
>

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Scala Interpreter error
You need to make sure the InterpreterSettings class is still being used.  If not, you should probably just use whatever Settings class the interpreter uses to load in settings.  I have another project I use at work where I can validate that (the code probably changed after 2.7.x).

Also, the classpath that was generated used to use the wrong algorithm for determining jar locations.  I"m not sure if this was updated by miles or not.   I'm currently in a crunch at work for beta, but hopefully i can guide you correctly this weekend.


- Josh

On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger <johan.leuenberger@epfl.ch> wrote:
It would be great if I could help fix this bug. I have a working development environment and i looked at the code but i don't see where the problem is located. May the errors is in the InterpreterLaunchConfigurationDelegate class or where else?

-Johan

Josh Suereth wrote:
I apologize.  I haven't had time to keep up/maintain the scala interpreter/console in Eclipse.  I'm pretty sure things have changed enough on trunk to break.  I would like to say I'd fix it, but unfortunately, the amount of time it takes to set up a development enivornment for the Eclipse Scala plugin on my machine usually entails my entire free time for that day.  If there's someone else who is maintaining a development environment, I can guide you through the process of fixing the interpreter, but unfrouantely can't commit to doing this myself.

BTW this looks like a valid bug.

- Josh

On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger <johan.leuenberger@epfl.ch <mailto:johan.leuenberger@epfl.ch>> wrote:

   Hello,
   There is an error when I try to run the Scala Interpreter in
   Eclipse(v3.5.1) using the latest Scala nightly plugin.
   Here is how to recreate the bug:
   right-click on the Scala project, Scala -> Create Scala Interpreter.

   Console output:
   -----------------------------

   Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
   HotSpot(TM) Server VM, Java 1.6.0_15).
   Type in expressions to have them evaluated.
   Type :help for more information.

   scala> <script>:9: error: not found: type Interpreter
   class InterpreterSettings(repl: Interpreter) {
                                 ^
   <script>:3: error: type InterpreterSettings is not a member of
   package scala.tools.nsc
    var value: scala.tools.nsc.InterpreterSettings = _
                               ^
   Exception in thread "main" java.util.NoSuchElementException: None.get
     at scala.None$.get(Option.scala:169)
     at scala.None$.get(Option.scala:167)
     at
   scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
     at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
     at
   scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
     at
   scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
     at
   scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
     at scala.util.control.Exception$Catch.apply(Exception.scala:79)
     at scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
     at
   scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
     at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
     at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
     at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
     at scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
     at scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
   <script>:4: error: type InterpreterSettings is not a member of
   package scala.tools.nsc
    def set(x: Any) = value =
   x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
                                                             ^
   ---------------------------

   Johan




jleuenberger
Joined: 2009-09-12,
User offline. Last seen 3 years 7 weeks ago.
Re: Scala Interpreter error

I modified the variable mainClass of the doTheLaunch method from
"scala.tools.nsc.MainInterpreter" to
"scala.tools.nsc.MainGenericRunner". So instead of launching an instance
of MainInterpreter, it launchs MainGenericRunner. It seems to work but
i'm not sure that it's the better way to make it work.
by the way, there is still a problem with the classpath...

-Johan

Josh Suereth wrote:
> You need to make sure the InterpreterSettings class is still being
> used. If not, you should probably just use whatever Settings class
> the interpreter uses to load in settings. I have another project I
> use at work where I can validate that (the code probably changed after
> 2.7.x).
>
> Also, the classpath that was generated used to use the wrong algorithm
> for determining jar locations. I"m not sure if this was updated by
> miles or not. I'm currently in a crunch at work for beta, but
> hopefully i can guide you correctly this weekend.
>
>
> - Josh
>
> On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger
> > wrote:
>
> It would be great if I could help fix this bug. I have a working
> development environment and i looked at the code but i don't see
> where the problem is located. May the errors is in the
> InterpreterLaunchConfigurationDelegate class or where else?
>
> -Johan
>
> Josh Suereth wrote:
>
> I apologize. I haven't had time to keep up/maintain the scala
> interpreter/console in Eclipse. I'm pretty sure things have
> changed enough on trunk to break. I would like to say I'd fix
> it, but unfortunately, the amount of time it takes to set up a
> development enivornment for the Eclipse Scala plugin on my
> machine usually entails my entire free time for that day. If
> there's someone else who is maintaining a development
> environment, I can guide you through the process of fixing the
> interpreter, but unfrouantely can't commit to doing this myself.
>
> BTW this looks like a valid bug.
>
> - Josh
>
> On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
>
> >> wrote:
>
> Hello,
> There is an error when I try to run the Scala Interpreter in
> Eclipse(v3.5.1) using the latest Scala nightly plugin.
> Here is how to recreate the bug:
> right-click on the Scala project, Scala -> Create Scala
> Interpreter.
>
> Console output:
> -----------------------------
>
> Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
> HotSpot(TM) Server VM, Java 1.6.0_15).
> Type in expressions to have them evaluated.
> Type :help for more information.
>
> scala> :9: error: not found: type Interpreter
> class InterpreterSettings(repl: Interpreter) {
> ^
> :3: error: type InterpreterSettings is not a member of
> package scala.tools.nsc
> var value: scala.tools.nsc.InterpreterSettings = _
> ^
> Exception in thread "main"
> java.util.NoSuchElementException: None.get
> at scala.None$.get(Option.scala:169)
> at scala.None$.get(Option.scala:167)
> at
>
> scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
> at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
> at
>
> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
> at
>
> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
> at
>
> scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
> at
> scala.util.control.Exception$Catch.apply(Exception.scala:79)
> at
> scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
> at
>
> scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
> at
> scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
> at
> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
> at
> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
> at
> scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
> at
> scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
> :4: error: type InterpreterSettings is not a member of
> package scala.tools.nsc
> def set(x: Any) = value =
> x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
> ^
> ---------------------------
>
> Johan
>
>
>
>

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Scala Interpreter error
For the classpath, you need to look at how the plugin computes classpaths for scala library and try to duplicate it for the "nsc" bundle.  I had the code laying around somewhere untested, but the real fun in testing the classpath is that you need to look things up differently when running via an eclipse debug deployment or when bundled into a plugin.jar.

Sorry my notes there are pretty weak, it was also the thing I was attempting to tackle.

- Josh

On Thu, Nov 19, 2009 at 12:09 AM, Johan Leuenberger <johan.leuenberger@epfl.ch> wrote:
I modified the variable mainClass of the doTheLaunch method from "scala.tools.nsc.MainInterpreter" to "scala.tools.nsc.MainGenericRunner". So instead of launching an instance of MainInterpreter, it launchs MainGenericRunner. It seems to work but i'm not sure that it's the better way to make it work.
by the way, there is still a problem with the classpath...

-Johan

Josh Suereth wrote:
You need to make sure the InterpreterSettings class is still being used.  If not, you should probably just use whatever Settings class the interpreter uses to load in settings.  I have another project I use at work where I can validate that (the code probably changed after 2.7.x).

Also, the classpath that was generated used to use the wrong algorithm for determining jar locations.  I"m not sure if this was updated by miles or not.   I'm currently in a crunch at work for beta, but hopefully i can guide you correctly this weekend.


- Josh

On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger <johan.leuenberger@epfl.ch <mailto:johan.leuenberger@epfl.ch>> wrote:

   It would be great if I could help fix this bug. I have a working
   development environment and i looked at the code but i don't see
   where the problem is located. May the errors is in the
   InterpreterLaunchConfigurationDelegate class or where else?

   -Johan

   Josh Suereth wrote:

       I apologize.  I haven't had time to keep up/maintain the scala
       interpreter/console in Eclipse.  I'm pretty sure things have
       changed enough on trunk to break.  I would like to say I'd fix
       it, but unfortunately, the amount of time it takes to set up a
       development enivornment for the Eclipse Scala plugin on my
       machine usually entails my entire free time for that day.  If
       there's someone else who is maintaining a development
       environment, I can guide you through the process of fixing the
       interpreter, but unfrouantely can't commit to doing this myself.

       BTW this looks like a valid bug.

       - Josh

       On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
       <johan.leuenberger@epfl.ch <mailto:johan.leuenberger@epfl.ch>
       <mailto:johan.leuenberger@epfl.ch
       <mailto:johan.leuenberger@epfl.ch>>> wrote:

          Hello,
          There is an error when I try to run the Scala Interpreter in
          Eclipse(v3.5.1) using the latest Scala nightly plugin.
          Here is how to recreate the bug:
          right-click on the Scala project, Scala -> Create Scala
       Interpreter.

          Console output:
          -----------------------------

          Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
          HotSpot(TM) Server VM, Java 1.6.0_15).
          Type in expressions to have them evaluated.
          Type :help for more information.

          scala> <script>:9: error: not found: type Interpreter
          class InterpreterSettings(repl: Interpreter) {
                                        ^
          <script>:3: error: type InterpreterSettings is not a member of
          package scala.tools.nsc
           var value: scala.tools.nsc.InterpreterSettings = _
                                      ^
          Exception in thread "main"
       java.util.NoSuchElementException: None.get
            at scala.None$.get(Option.scala:169)
            at scala.None$.get(Option.scala:167)
            at
                scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
            at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
            at
                scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
            at
                scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
            at
                scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
            at
       scala.util.control.Exception$Catch.apply(Exception.scala:79)
            at
       scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
            at
                scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
            at
       scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
            at
       scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
            at
       scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
            at
       scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
            at
       scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
          <script>:4: error: type InterpreterSettings is not a member of
          package scala.tools.nsc
           def set(x: Any) = value =
          x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
                                                                    ^
          ---------------------------

          Johan






Tim Clendenen
Joined: 2009-05-18,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala Interpreter error

Johan,

Adding getBundleEntry("/lib/msil.jar") to the list constructed at the
end of interpreterExtraClassPath within the same file as the changes you
made takes care of the classpath problem. Same as you, I'm not sure if
this is the best or correct fix, but it seems to work.

Tim

Johan Leuenberger wrote:
> I modified the variable mainClass of the doTheLaunch method from
> "scala.tools.nsc.MainInterpreter" to
> "scala.tools.nsc.MainGenericRunner". So instead of launching an
> instance of MainInterpreter, it launchs MainGenericRunner. It seems to
> work but i'm not sure that it's the better way to make it work.
> by the way, there is still a problem with the classpath...
>
> -Johan
>
> Josh Suereth wrote:
>> You need to make sure the InterpreterSettings class is still being
>> used. If not, you should probably just use whatever Settings class
>> the interpreter uses to load in settings. I have another project I
>> use at work where I can validate that (the code probably changed
>> after 2.7.x).
>>
>> Also, the classpath that was generated used to use the wrong
>> algorithm for determining jar locations. I"m not sure if this was
>> updated by miles or not. I'm currently in a crunch at work for
>> beta, but hopefully i can guide you correctly this weekend.
>>
>>
>> - Josh
>>
>> On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger
>> > wrote:
>>
>> It would be great if I could help fix this bug. I have a working
>> development environment and i looked at the code but i don't see
>> where the problem is located. May the errors is in the
>> InterpreterLaunchConfigurationDelegate class or where else?
>>
>> -Johan
>>
>> Josh Suereth wrote:
>>
>> I apologize. I haven't had time to keep up/maintain the scala
>> interpreter/console in Eclipse. I'm pretty sure things have
>> changed enough on trunk to break. I would like to say I'd fix
>> it, but unfortunately, the amount of time it takes to set up a
>> development enivornment for the Eclipse Scala plugin on my
>> machine usually entails my entire free time for that day. If
>> there's someone else who is maintaining a development
>> environment, I can guide you through the process of fixing the
>> interpreter, but unfrouantely can't commit to doing this myself.
>>
>> BTW this looks like a valid bug.
>>
>> - Josh
>>
>> On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
>>
>> > >> wrote:
>>
>> Hello,
>> There is an error when I try to run the Scala Interpreter in
>> Eclipse(v3.5.1) using the latest Scala nightly plugin.
>> Here is how to recreate the bug:
>> right-click on the Scala project, Scala -> Create Scala
>> Interpreter.
>>
>> Console output:
>> -----------------------------
>>
>> Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
>> HotSpot(TM) Server VM, Java 1.6.0_15).
>> Type in expressions to have them evaluated.
>> Type :help for more information.
>>
>> scala> :9: error: not found: type Interpreter
>> class InterpreterSettings(repl: Interpreter) {
>> ^
>> :3: error: type InterpreterSettings is not a
>> member of
>> package scala.tools.nsc
>> var value: scala.tools.nsc.InterpreterSettings = _
>> ^
>> Exception in thread "main"
>> java.util.NoSuchElementException: None.get
>> at scala.None$.get(Option.scala:169)
>> at scala.None$.get(Option.scala:167)
>> at
>>
>> scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
>>
>> at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
>> at
>>
>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
>>
>> at
>>
>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
>>
>> at
>>
>> scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
>>
>> at
>> scala.util.control.Exception$Catch.apply(Exception.scala:79)
>> at
>> scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
>> at
>>
>> scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
>> at
>> scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
>> at
>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
>> at
>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
>> at
>> scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
>> at
>> scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
>> :4: error: type InterpreterSettings is not a
>> member of
>> package scala.tools.nsc
>> def set(x: Any) = value =
>> x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
>> ^
>> ---------------------------
>>
>> Johan
>>
>>
>>
>>
>
>
>

jleuenberger
Joined: 2009-09-12,
User offline. Last seen 3 years 7 weeks ago.
Re: Scala Interpreter error

thank you Tim.
Indeed it works. I will make some tests but i think it is a possible
solution.

-Johan

Tim Clendenen wrote:
> Johan,
>
> Adding getBundleEntry("/lib/msil.jar") to the list constructed at the
> end of interpreterExtraClassPath within the same file as the changes you
> made takes care of the classpath problem. Same as you, I'm not sure if
> this is the best or correct fix, but it seems to work.
>
> Tim
>
> Johan Leuenberger wrote:
>
>> I modified the variable mainClass of the doTheLaunch method from
>> "scala.tools.nsc.MainInterpreter" to
>> "scala.tools.nsc.MainGenericRunner". So instead of launching an
>> instance of MainInterpreter, it launchs MainGenericRunner. It seems to
>> work but i'm not sure that it's the better way to make it work.
>> by the way, there is still a problem with the classpath...
>>
>> -Johan
>>
>> Josh Suereth wrote:
>>
>>> You need to make sure the InterpreterSettings class is still being
>>> used. If not, you should probably just use whatever Settings class
>>> the interpreter uses to load in settings. I have another project I
>>> use at work where I can validate that (the code probably changed
>>> after 2.7.x).
>>>
>>> Also, the classpath that was generated used to use the wrong
>>> algorithm for determining jar locations. I"m not sure if this was
>>> updated by miles or not. I'm currently in a crunch at work for
>>> beta, but hopefully i can guide you correctly this weekend.
>>>
>>>
>>> - Josh
>>>
>>> On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger
>>> > wrote:
>>>
>>> It would be great if I could help fix this bug. I have a working
>>> development environment and i looked at the code but i don't see
>>> where the problem is located. May the errors is in the
>>> InterpreterLaunchConfigurationDelegate class or where else?
>>>
>>> -Johan
>>>
>>> Josh Suereth wrote:
>>>
>>> I apologize. I haven't had time to keep up/maintain the scala
>>> interpreter/console in Eclipse. I'm pretty sure things have
>>> changed enough on trunk to break. I would like to say I'd fix
>>> it, but unfortunately, the amount of time it takes to set up a
>>> development enivornment for the Eclipse Scala plugin on my
>>> machine usually entails my entire free time for that day. If
>>> there's someone else who is maintaining a development
>>> environment, I can guide you through the process of fixing the
>>> interpreter, but unfrouantely can't commit to doing this myself.
>>>
>>> BTW this looks like a valid bug.
>>>
>>> - Josh
>>>
>>> On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
>>>
>>> >> >> wrote:
>>>
>>> Hello,
>>> There is an error when I try to run the Scala Interpreter in
>>> Eclipse(v3.5.1) using the latest Scala nightly plugin.
>>> Here is how to recreate the bug:
>>> right-click on the Scala project, Scala -> Create Scala
>>> Interpreter.
>>>
>>> Console output:
>>> -----------------------------
>>>
>>> Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
>>> HotSpot(TM) Server VM, Java 1.6.0_15).
>>> Type in expressions to have them evaluated.
>>> Type :help for more information.
>>>
>>> scala> :9: error: not found: type Interpreter
>>> class InterpreterSettings(repl: Interpreter) {
>>> ^
>>> :3: error: type InterpreterSettings is not a
>>> member of
>>> package scala.tools.nsc
>>> var value: scala.tools.nsc.InterpreterSettings = _
>>> ^
>>> Exception in thread "main"
>>> java.util.NoSuchElementException: None.get
>>> at scala.None$.get(Option.scala:169)
>>> at scala.None$.get(Option.scala:167)
>>> at
>>>
>>> scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
>>>
>>> at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
>>> at
>>>
>>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
>>>
>>> at
>>>
>>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
>>>
>>> at
>>>
>>> scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
>>>
>>> at
>>> scala.util.control.Exception$Catch.apply(Exception.scala:79)
>>> at
>>> scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
>>> at
>>>
>>> scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
>>> at
>>> scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
>>> at
>>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
>>> at
>>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
>>> at
>>> scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
>>> at
>>> scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
>>> :4: error: type InterpreterSettings is not a
>>> member of
>>> package scala.tools.nsc
>>> def set(x: Any) = value =
>>> x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
>>> ^
>>> ---------------------------
>>>
>>> Johan
>>>
>>>
>>>
>>>
>>>
>>
>>

jleuenberger
Joined: 2009-09-12,
User offline. Last seen 3 years 7 weeks ago.
Re: Scala Interpreter error

As I don't have any commit-rights, here is the patch that solves the
problem with the interpreter and the eclipse plugin.
There are only a couple of minor changes. I tested the changes in my
development environment and in a freshly installed eclipse. In both
cases, it works well.
It would be great if someone could commit the changes to the repository.

-Johan

Johan Leuenberger wrote:
> thank you Tim.
> Indeed it works. I will make some tests but i think it is a possible
> solution.
>
> -Johan
>
> Tim Clendenen wrote:
>
>> Johan,
>>
>> Adding getBundleEntry("/lib/msil.jar") to the list constructed at the
>> end of interpreterExtraClassPath within the same file as the changes you
>> made takes care of the classpath problem. Same as you, I'm not sure if
>> this is the best or correct fix, but it seems to work.
>>
>> Tim
>>
>> Johan Leuenberger wrote:
>>
>>
>>> I modified the variable mainClass of the doTheLaunch method from
>>> "scala.tools.nsc.MainInterpreter" to
>>> "scala.tools.nsc.MainGenericRunner". So instead of launching an
>>> instance of MainInterpreter, it launchs MainGenericRunner. It seems to
>>> work but i'm not sure that it's the better way to make it work.
>>> by the way, there is still a problem with the classpath...
>>>
>>> -Johan
>>>
>>> Josh Suereth wrote:
>>>
>>>
>>>> You need to make sure the InterpreterSettings class is still being
>>>> used. If not, you should probably just use whatever Settings class
>>>> the interpreter uses to load in settings. I have another project I
>>>> use at work where I can validate that (the code probably changed
>>>> after 2.7.x).
>>>>
>>>> Also, the classpath that was generated used to use the wrong
>>>> algorithm for determining jar locations. I"m not sure if this was
>>>> updated by miles or not. I'm currently in a crunch at work for
>>>> beta, but hopefully i can guide you correctly this weekend.
>>>>
>>>>
>>>> - Josh
>>>>
>>>> On Wed, Nov 18, 2009 at 5:46 PM, Johan Leuenberger
>>>> > wrote:
>>>>
>>>> It would be great if I could help fix this bug. I have a working
>>>> development environment and i looked at the code but i don't see
>>>> where the problem is located. May the errors is in the
>>>> InterpreterLaunchConfigurationDelegate class or where else?
>>>>
>>>> -Johan
>>>>
>>>> Josh Suereth wrote:
>>>>
>>>> I apologize. I haven't had time to keep up/maintain the scala
>>>> interpreter/console in Eclipse. I'm pretty sure things have
>>>> changed enough on trunk to break. I would like to say I'd fix
>>>> it, but unfortunately, the amount of time it takes to set up a
>>>> development enivornment for the Eclipse Scala plugin on my
>>>> machine usually entails my entire free time for that day. If
>>>> there's someone else who is maintaining a development
>>>> environment, I can guide you through the process of fixing the
>>>> interpreter, but unfrouantely can't commit to doing this myself.
>>>>
>>>> BTW this looks like a valid bug.
>>>>
>>>> - Josh
>>>>
>>>> On Tue, Nov 17, 2009 at 8:18 PM, Johan Leuenberger
>>>>
>>>> >>> >> wrote:
>>>>
>>>> Hello,
>>>> There is an error when I try to run the Scala Interpreter in
>>>> Eclipse(v3.5.1) using the latest Scala nightly plugin.
>>>> Here is how to recreate the bug:
>>>> right-click on the Scala project, Scala -> Create Scala
>>>> Interpreter.
>>>>
>>>> Console output:
>>>> -----------------------------
>>>>
>>>> Welcome to Scala version 2.8.0.r19682-b20091117020214 (Java
>>>> HotSpot(TM) Server VM, Java 1.6.0_15).
>>>> Type in expressions to have them evaluated.
>>>> Type :help for more information.
>>>>
>>>> scala> :9: error: not found: type Interpreter
>>>> class InterpreterSettings(repl: Interpreter) {
>>>> ^
>>>> :3: error: type InterpreterSettings is not a
>>>> member of
>>>> package scala.tools.nsc
>>>> var value: scala.tools.nsc.InterpreterSettings = _
>>>> ^
>>>> Exception in thread "main"
>>>> java.util.NoSuchElementException: None.get
>>>> at scala.None$.get(Option.scala:169)
>>>> at scala.None$.get(Option.scala:167)
>>>> at
>>>>
>>>> scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$$loadByName(Interpreter.scala:151)
>>>>
>>>> at scala.tools.nsc.Interpreter.bind(Interpreter.scala:467)
>>>> at
>>>>
>>>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:124)
>>>>
>>>> at
>>>>
>>>> scala.tools.nsc.InterpreterLoop$$anonfun$bindSettings$1.apply(InterpreterLoop.scala:122)
>>>>
>>>> at
>>>>
>>>> scala.tools.nsc.Interpreter$$anonfun$beQuietDuring$2.apply(Interpreter.scala:100)
>>>>
>>>> at
>>>> scala.util.control.Exception$Catch.apply(Exception.scala:79)
>>>> at
>>>> scala.tools.nsc.Interpreter.beQuietDuring(Interpreter.scala:98)
>>>> at
>>>>
>>>> scala.tools.nsc.InterpreterLoop.bindSettings(InterpreterLoop.scala:122)
>>>> at
>>>> scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:218)
>>>> at
>>>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:379)
>>>> at
>>>> scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:415)
>>>> at
>>>> scala.tools.nsc.MainInterpreter$.main(MainInterpreter.scala:12)
>>>> at
>>>> scala.tools.nsc.MainInterpreter.main(MainInterpreter.scala)
>>>> :4: error: type InterpreterSettings is not a
>>>> member of
>>>> package scala.tools.nsc
>>>> def set(x: Any) = value =
>>>> x.asInstanceOf[scala.tools.nsc.InterpreterSettings]
>>>> ^
>>>> ---------------------------
>>>>
>>>> Johan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland