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

Re: New VM Selection Method



Once more forgot to post to list- thanks Jerry.

Hi Jerry,

Jerry Haltom wrote:
Anybody interested in this at all?

Yes :-)

Sorry, I am currently away and have on sporadic and
short access to my email.

On Sun, 2005-04-03 at 11:12 -0500, Jerry Haltom wrote:

We need a standard, nice, easy to extend way for binary wrappers
in /usr/bin and/or startup scripts to locate their VM. There are a few
requirements that I had:

1) Whatever we do should be GUI configurable. I want to write a "System
VM Selection" control panel of some sort allowing the user to choose
which VM is used system-wide and also program specific.

That would be nice - especially as users are should be allowed to
override the vm. But I think we should put the scripts first in
java-common - to have something to test etc. - and then at a later
stage put the GUI stuff in place.

Just to ensure that the feature doesn't need to wait till a
working GUI is written.

BTW, should the GUI be in Java ?


2) It would be nice if a user (or us, as maintainers) could set the
system up so that a certain VM is used by default for a certain program.
There is a very obvious use case for wanting to run something like
Eclipse on Sun's VM, yet everything else on GCJ (at least until we are
feature complete with Sun!)

3) It should be overridable per user. If only one user wants to run
Eclipse on Sun, he should be able to.

No comment - just fine.

So the obvious way to implement this is to write a shell script fragment
which queries a number of files and returns a valid path to a JAVA_HOME.
We then include this fragment at the top of existing wrappers, or such
as in the case of Ant, just replace the wrapper (the Ant wrapper sucks
really badly.)

Here's my idea. A JVM selection file is just a file listing JAVA_HOME
paths in order of preference. We put the default system one here:

/etc/jvm

Additionally, we create a directory to hold per program files.

/etc/jvm.d

A file in here would be for example named 'ant'. I'd like to talk about
this naming convention for these files. I'm thinking we'd use the same
stuff as like, /usr/share/$prog, not the specific package name.

The script would test for /etc/jvm.d/prog, test each JAVA_HOME listed
within, then, if it hasn't found a jvm yet, proceed with /etc/jvm.

We could also have it check ~/.jvm.d and ~/.jvm in the same manor.

Because I like doing things before I talk about them, I did this. This
file would be cleaned up, placed in java-common, perhaps
in /usr/share/java-common/jvm.sh, and jvm_find would be called in each
wrapper.


[...]


Then a wrapper just sources it, JAVA_HOME=`jvm_find myname`, and goes
on.


I vote for it :-)

Regards,

Wolfgang

PS: Some further extensions to selection per arch - or arch preferences
for the free vm's come to my mind - but I have not the time currently
to discuss - will come back later.




Reply to: