- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
scalac and classpath handling
Fri, 2010-02-12, 21:05
I see that classpath handling is changing in trunk. My question is about how
to properly set up the classpath now. I need to invoke scalac:
* using only the location of scala-library.jar and scala-compiler.jar
* without scala.home set
* within an existing jvm, so the Scala jars are not in java.class.path
Currently, invocation looks something like:
val args = Array("-bootclasspath", bootCp, "-cp", usersClasspath)
scala.tools.nsc.Main.process(args)
where bootCp includes scala-library.jar and usersClasspath does not.
This worked fine until recent trunk, maybe two days ago or so. What is or will
be the recommended way going forward?
Thanks,
Mark
Fri, 2010-02-12, 23:37
#2
Re: scalac and classpath handling
On Friday 12 February 2010 03:33:41 pm Paul Phillips wrote:
> On Fri, Feb 12, 2010 at 03:04:20PM -0500, Mark Harrah wrote:
> > * using only the location of scala-library.jar and scala-compiler.jar
> > * without scala.home set
> > * within an existing jvm, so the Scala jars are not in java.class.path
>
> OK, I really need to explain what's going on in there and what the
> motivations are, and I realize there is some bustedness at this second.
> I promise these answers will be abundantly clear before too long, but I
> have more than one fire burning. I will be glad to get your input as
> it's just this sort of fine-grained classpath control that I'm trying to
> make easy.
Yes, it is easy to see that it will be an improvement. I arrived at my
current approach partly by trial and error. I append scala-library.jar to
sun.boot.class.path to set -bootclasspath and clear scala.home. I will be
happy to have something more robust and intentional.
I could use a workaround if you will be a while, though, since it means that
sbt can't work with trunk.
Thanks,
Mark
On Fri, Feb 12, 2010 at 03:04:20PM -0500, Mark Harrah wrote:
> * using only the location of scala-library.jar and scala-compiler.jar
> * without scala.home set
> * within an existing jvm, so the Scala jars are not in java.class.path
OK, I really need to explain what's going on in there and what the
motivations are, and I realize there is some bustedness at this second.
I promise these answers will be abundantly clear before too long, but I
have more than one fire burning. I will be glad to get your input as
it's just this sort of fine-grained classpath control that I'm trying to
make easy.