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

Bug#212863: java-common: New java policy including tools to manage the changes



Hello Ean,

Tuesday, October 7, 2003, 9:38:20 PM, you wrote:
> I still don't like the findjava idea. What is the goal?

The goal is to provide a search mechnism for the alternatives. The
discussion in debian-java has shown, that the alternative machnism
isn't enough and especial isn't reliable.

findjava will be called with the list of the 'known working' java
implementations and will either return one of them, which is
installed or exit with an error code. This will ensure that the
called java command is known to be working with your package. The
basic equivalent of this code is

for java in /usr/bin/kaffe /usr/lib/j2sdk1.4/bin/java ... ; do
   if [ -x $java ] ; then
      JAVACMD="$java"
      break
   fi
done

Instead you do
JAVACMD="$(findjava kaffe sun-java-1.4 ...)"

So the difference is:
* The code is in one place -> less bugs
* Its abstracted by packaging names and not places, where the binary
  is -> palces can change...
* the java binary automatically get some parameter, which the java
  binary maintainer things usefull.
* you can explicitly ask for a special kind of java binary (one,
  which is able to run in server mode), without putting much more
  logic into the startscript.

>  It looks like
> this script provides a common interface to all of the java execution
> systems (compilers, JITs, interpreters or otherwise)

It only provide an 'search mechanism' to the binary, which can
execute java byte code.

> by concentrating
> shell script adapters into a single file. I think it is much more
> maintainable to define the calling conventions and then require each
> system (in the language of its choice) to provide a "java" file that
> provides the common calling convention.

This is basicly, what the findjava mechnism does.

> With the findjava script it looks like I would need to submit a patch
> anytime Kaffe's command line conventions changed rather than just fixing
> an adaptor that resides in my own package.

Nope, you will change the java-config file in the kaffe package,
which specifies the java command. See the manpage of
java-config-file(5) in the below package.

You, as the maintainer of kaffe, will have the right and power to
change, which kaffe command is called and with which parameter (in
the basic run). You can also specify, how the kaffe binary should be
started if the app should be run in server or client mode (if you
know more interesting cases, I will implement them).

Please have a look at the package available from
deb http://www.katzien.de/debian/java ./
-> new-java-policy package
It includes java-config files examples (this files would be provided
by the package containing the jars/java binary and not one single
package) and the findjava sript and manpage. Please have a look at
it and try it.

Thanks for the comments!

Jan




Reply to: