- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Distributing a Scala application
Fri, 2009-03-27, 18:58
Hello
all,
I need help creating
a distribution for a small Scala app. I have no trouble running it under my
Eclipse environment, but when I try to run it from a jar file, I get the
common "NoClassDefFoundError" for scala/ScalaObject, even if the scala library
is properly added to the classpath.
Any idea of what's
happening? I guess I'm missing something obvious.
BTW, could someone
give me a hint (command-line example...) on how to use the Packloader http://scala.sygneca.com/code/compressed-executable-jar ?
Many thanks in
advance!
Gilles Scouvart
Fri, 2009-03-27, 23:57
#2
RE: Distributing a Scala application
Thanks Mark,
Finally I got my manifest right. And this small packloader is definitely
a good idea!
Gilles.
-----Original Message-----
From: Mark Harrah [mailto:harrah@bu.edu]
Sent: vendredi 27 mars 2009 20:59
To: scala-user@listes.epfl.ch
Subject: Re: [scala-user] Distributing a Scala application
Hi,
I don't know what your command line looks like, but you will get a
NoClassDefFoundError if you are doing:
java -cp scala-library.jar -jar app.jar
The -cp option is ignored when -jar is specified, so you need to do
something like:
java -cp scala-library.jar:app.jar app.Main
-Mark
On Friday 27 March 2009 13:58, Gilles SCOUVART wrote:
> Hello all,
>
> I need help creating a distribution for a small Scala app. I have no
> trouble running it under my Eclipse environment, but when I try to run
> it from a jar file, I get the common "NoClassDefFoundError" for
> scala/ScalaObject, even if the scala library is properly added to the
> classpath.
> Any idea of what's happening? I guess I'm missing something obvious.
> BTW, could someone give me a hint (command-line example...) on how to
> use the Packloader
> http://scala.sygneca.com/code/compressed-executable-jar ?
>
> Many thanks in advance!
>
> Gilles Scouvart
>
>
Sun, 2009-03-29, 11:47
#3
Re: Distributing a Scala application
Mark Harrah wrote:
>
> java -cp scala-library.jar -jar app.jar
>
I start my scala applications with scala itself.
Instead of
java -cp scala-library.jar:app.jar app.Main
I call
scala -cp app.jar app.Main
So the scala libraries are attracted automatically.
Hi,
I don't know what your command line looks like, but you will get a NoClassDefFoundError if you are doing:
java -cp scala-library.jar -jar app.jar
The -cp option is ignored when -jar is specified, so you need to do something like:
java -cp scala-library.jar:app.jar app.Main
-Mark
On Friday 27 March 2009 13:58, Gilles SCOUVART wrote:
> Hello all,
>
> I need help creating a distribution for a small Scala app. I have no
> trouble running it under my Eclipse environment, but when I try to run
> it from a jar file, I get the common "NoClassDefFoundError" for
> scala/ScalaObject, even if the scala library is properly added to the
> classpath.
> Any idea of what's happening? I guess I'm missing something obvious.
> BTW, could someone give me a hint (command-line example...) on how to
> use the Packloader
> http://scala.sygneca.com/code/compressed-executable-jar ?
>
> Many thanks in advance!
>
> Gilles Scouvart
>
>