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

scala -> Cannot figure out how to run target

3 replies
luismmontielg
Joined: 2011-05-13,
User offline. Last seen 42 years 45 weeks ago.

Hello,
I've just installed scala 2.9.0 from jar on the website. Im on ubuntu
linux 11.04
I've set my PATH and SCALA_HOME vars accordingly.

scalac Echo.scala

is working fine.

But scala Echo is throwing this:

Exception in thread "main" java.lang.RuntimeException: Cannot figure
out how to run target: Echo
at scala.sys.package$.error(package.scala:27)
at scala.tools.nsc.GenericRunnerCommand.scala$tools$nsc
$GenericRunnerCommand$$guessHowToRun(GenericRunnerCommand.scala:38)
at scala.tools.nsc.GenericRunnerCommand$$anonfun
$2.apply(GenericRunnerCommand.scala:48)
at scala.tools.nsc.GenericRunnerCommand$$anonfun
$2.apply(GenericRunnerCommand.scala:48)
at scala.Option.getOrElse(Option.scala:109)
at
scala.tools.nsc.GenericRunnerCommand.(GenericRunnerCommand.scala:
48)
at
scala.tools.nsc.GenericRunnerCommand.(GenericRunnerCommand.scala:
17)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:
33)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:
89)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

Any ideas?

Thanks In advance
Luis Montiel

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: scala -> Cannot figure out how to run target

On 5/13/11 11:31 AM, luismmontielg wrote:
> I've just installed scala 2.9.0 from jar on the website. Im on ubuntu
> linux 11.04
> I've set my PATH and SCALA_HOME vars accordingly.

Don't set SCALA_HOME. Best case, the runner ignores you and determines
it from the filesystem. Worst case is anything else.

> But scala Echo is throwing this:
>
> Exception in thread "main" java.lang.RuntimeException: Cannot figure
> out how to run target: Echo

That means it isn't on your classpath.

Philippe Lhoste
Joined: 2010-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: scala -> Cannot figure out how to run target

On 13/05/2011 20:37, Paul Phillips wrote:
> Don't set SCALA_HOME. Best case, the runner ignores you and determines
> it from the filesystem. Worst case is anything else.

What is "anything else"? Yes, I know, just "anything else", but how bad is it?
I have set my SCALA_HOME from the beginning (only 2.8.0, to be honest) and so far I
haven't seen bad effects on my little experiments (no big project yet).

I don't mind that the runner just ignore it, that's fine, but I don't see why this
particular name must be banned. I find it convenient to build my path (on Windows, easier
to edit that the whole path in the provided GUI...), to use it in tools (text editor,
Gradle scripts, etc.) and so on.
Of course, I can change the name, but why should I break from this long tradition? (I have
SciTE_HOME, JAVA_HOME, JAVAFX_HOME (no more used), GROOVY_HOME (not much used yet),
BZR_HOME and some others.)

luismmontielg
Joined: 2011-05-13,
User offline. Last seen 42 years 45 weeks ago.
Re: scala -> Cannot figure out how to run target

Thank you very much, I had changed my CLASSPATH on bashrc, its fixed
now

On May 13, 1:37 pm, Paul Phillips wrote:
> On 5/13/11 11:31 AM, luismmontielg wrote:
>
> > I've just installed scala 2.9.0 from jar on the website. Im on ubuntu
> > linux 11.04
> > I've set my PATH and SCALA_HOME vars accordingly.
>
> Don't set SCALA_HOME.  Best case, the runner ignores you and determines
> it from the filesystem.  Worst case is anything else.
>
> > But scala Echo is throwing this:
>
> > Exception in thread "main" java.lang.RuntimeException: Cannot figure
> > out how to run target: Echo
>
> That means it isn't on your classpath.

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