[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to manage multiple JVMs



[Joe, a 72-column word-wrap would make reading your email significantly
easier.... I have word-wrapped it in order to make my response at all
intellegible...]

* Joe Emenaker <joe@emenaker.com> [001019 01:34]:
> As things stand now, I either have to keep them on separate machines
> or wrestle with the stuff in /etc/alternates.

I solved this by creating a subdirectory in my $HOME, ~/bin, where I put
symlinks to `javac', `java', and `javap'. (I don't switch often. :) A
small script could be written to manage symlinks like this. (I have
~/bin in my path before anything else, this may be unacceptable for
you.)

> After having to add about 7 or 8 items like
> "/usr/share/java/javax.activation.jar" to my classpath variable in
> .bash_profile AND .bashrc, you get a little sick of it.

Well, you could call one from the other, and get it overwith. :)

> Another nifty thing would be if there were a directory where a user
> could put jars (or symlinks to them, of course) and the directory
> would be scanned and all jars would automatically be put in the
> classpath that gets passed to the JVM.

Yeah, that does sound sort of cool. I don't know sh well enough to write
a script for this, but the perl would look a bit like this:

$all = `ls ~/.jars`;
split($all);
foreach $jar in @_ {
	$CLASSPATH += $CLASSPATH . $jar;
}

print $CLASSPATH;

you could call this by "export CLASSPATH=`perl_script`". At least, this
is the gist of the script. I haven't done anything beyond trivial with
perl in a year. :) (And yes, I am sure this could be written much
smarter. :)

> Is there going to be any development of the Debian Java Policy towards
> something like this?

I would be surprised, mainly since there isn't much demand for Java in
the free software community -- newer versions of the API come with JDK
licenses unacceptable to many people, and older versions of the API just
aren't wonderful. Also, the free software community is largely built on
Unix, and C is much happier under Unix than Java... so there are also
many more users of C than Java, and users translates directly to
software to handle the wierd cases users will ask their machines to
handle.



Reply to: