- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Distributing an application written in Scala
Fri, 2008-12-19, 14:55
I create a small swing based application in Scala. I am really happy on how modular the code turned out to be. However when it came time to distribute it, I ran into some issues. I need the scala-library.jar and scala-swing.jar. I simply added them to the applications ZIP file in the proper directory, and create a simple script to fire the applications. This works fine, but has a draw back. The end file is 4 MB big, despite my jar being only 330K. I'm sending this to people that are not programming and java savvy, so I have the following questions:
1) Do I violate the scala license in doing this?
2) Is there a simple way to download these two files from scala distribution channels?
3) I noticed that the download page has scala.library_2.7.2.final.jar? Can I ask them to download this? What would be the classpath for the java command to use this file (I never specified classpath for jars in a jar)?
4) Anyone have a generic script for linux and windows that figures out the proper jars needed from looking in the disk? (similar to the scala.bat)?
5) Anyone have a "Setup" application for Scala apps that make it easy for an average user to download the requirements?
Thanks,
Thomas
1) Do I violate the scala license in doing this?
2) Is there a simple way to download these two files from scala distribution channels?
3) I noticed that the download page has scala.library_2.7.2.final.jar? Can I ask them to download this? What would be the classpath for the java command to use this file (I never specified classpath for jars in a jar)?
4) Anyone have a generic script for linux and windows that figures out the proper jars needed from looking in the disk? (similar to the scala.bat)?
5) Anyone have a "Setup" application for Scala apps that make it easy for an average user to download the requirements?
Thanks,
Thomas
Sat, 2008-12-20, 01:27
#2
Re: Distributing an application written in Scala
On Fri, Dec 19, 2008 at 12:31 PM, David MacIver <david [dot] maciver [at] gmail [dot] com> wrote:
I tried proguard but ran into a strange issue:
It can find scala.Nothing. Which is in the source tree but not in the scala-library.jar on 2.7.2-final
Any clue?On Fri, Dec 19, 2008 at 8:55 AM, Thomas Sant Ana <mailleux [at] gmail [dot] com> wrote:I create a small swing based application in Scala. I am really happy on how modular the code turned out to be. However when it came time to distribute it, I ran into some issues. I need the scala-library.jar and scala-swing.jar. I simply added them to the applications ZIP file in the proper directory, and create a simple script to fire the applications. This works fine, but has a draw back. The end file is 4 MB big, despite my jar being only 330K. I'm sending this to people that are not programming and java savvy, so I have the following questions:
You should investigate using something like proguard or jar jar links to reduce the application size. You'd probably find that you can bring the entire thing significantly under 1M.
I tried proguard but ran into a strange issue:
It can find scala.Nothing. Which is in the source tree but not in the scala-library.jar on 2.7.2-final
Thomas
Sat, 2008-12-20, 01:57
#3
Re: Distributing an application written in Scala
On Fri, Dec 19, 2008 at 7:20 PM, Thomas Sant Ana <mailleux [at] gmail [dot] com> wrote:
Oh. That's unfortunate. :-( I think that's related to https://lampsvn.epfl.ch/trac/scala/ticket/1254
The easiest workaround would be to create a scala.Nothing class file yourself (just create a file nothing.scala containing package scala, class Nothing). Hopefully that should do the trick.
Any clue?On Fri, Dec 19, 2008 at 12:31 PM, David MacIver <david [dot] maciver [at] gmail [dot] com> wrote:
On Fri, Dec 19, 2008 at 8:55 AM, Thomas Sant Ana <mailleux [at] gmail [dot] com> wrote:I create a small swing based application in Scala. I am really happy on how modular the code turned out to be. However when it came time to distribute it, I ran into some issues. I need the scala-library.jar and scala-swing.jar. I simply added them to the applications ZIP file in the proper directory, and create a simple script to fire the applications. This works fine, but has a draw back. The end file is 4 MB big, despite my jar being only 330K. I'm sending this to people that are not programming and java savvy, so I have the following questions:
You should investigate using something like proguard or jar jar links to reduce the application size. You'd probably find that you can bring the entire thing significantly under 1M.
I tried proguard but ran into a strange issue:
It can find scala.Nothing. Which is in the source tree but not in the scala-library.jar on 2.7.2-final
Oh. That's unfortunate. :-( I think that's related to https://lampsvn.epfl.ch/trac/scala/ticket/1254
The easiest workaround would be to create a scala.Nothing class file yourself (just create a file nothing.scala containing package scala, class Nothing). Hopefully that should do the trick.
Sat, 2008-12-20, 02:07
#4
Re: Distributing an application written in Scala
On Fri, Dec 19, 2008 at 10:20:09PM -0200, Thomas Sant Ana wrote:
> I tried proguard but ran into a strange issue:
>
> It can find scala.Nothing. Which is in the source tree but not in the
> scala-library.jar on 2.7.2-final
I already opened a ticket about this (actually I opened it about something a little different, but
look at my subsequent comments and you'll see it come back around.)
You should investigate using something like proguard or jar jar links to reduce the application size. You'd probably find that you can bring the entire thing significantly under 1M.
You need to keep a copy of the scala license in your distribution, but otherwise it's fine.