Bug#212863: java-common: New java policy including tools to manage the changes
Hello T.,
Tuesday, October 7, 2003, 10:41:52 PM, you wrote:
> 1) Standardize the invocation interface, so that it is feasible to have
> java packages that will have a hope of running on a VM that the
> packager did not directly support.
The discussion has shown, that we can't standardisize this much more
than which is already done. This should have been done by sun or any
other body and I don't think that thjis is possible in a debian
policy.
I hope that all java binaries will implement the basic things like
name <vm-specific-params> -classpath <jarfiles, seperated by ':'>
mainclass <app options>
or react on a set CLASSPATH
This seems to be the case with all tested JVS (and using sablevm
wrapper). Everything else seems to be madness to try, because
everybody has a differenet opinion on where to stop and what would
be better.
> 2) Localize the invocation interface, so that the hunt-and-find-a-good-VM
> logic isn't replicated in all the myriad java packages.
Yes.
> This is all to make it easier on the packagers of end-user java programs,
> not to make it easier for the VM, compiler, etc packagers.
Yes.
> I think that you are right in your assessment of needing to submit a
> patch to findjava whenever Kaffe's command line changes, and I agree that
No. Findjava will output the things, which kaffe specifies in its
/usr/share/java-config/kaffe file, nothing more. If a application
package chooses to play around with other options, it has to
implement the logic for this, based on the findjava output, and hope
that kaffe won't break it with the next version.
> this is suboptimal. I also think it would be good to define a standard
> interface that packages like Kaffe could support, but I do not think that
> is sufficient, because we cannot hope to get Sun (or any of the other
> proprietary vendors) to conform to that standard.
Thats exactly the point. With the findjava implementation it's easy
to do something like
# tests, if sablevm is used directly and not the wrapper.
isSableVM(){
if [ "$1" = /usr/bin/sablevm ] ; then return 0 ; fi return 1;
}
PACKAGES="..."
JAVACMD="$(findjava ...)"
if isSableVM $JAVACMD ; then
CLASSPATH_OPTION="--classpath"
else
CLASSPATH_OPTION="-classpath"
fi
$JAVACMD $CLASSPATH_OPTION `java-config $PACKAGES` com.example.Main
Usually such logic won't be nessesary. The main usecase is looking
like this:
# package, which jars need to be on the classpath
DEPEND_LIST="package1 package2 package3"
# Known working java binaries, which can run this package app.
WORKING_JAVA="kaffe gij sun"
export CLASSPATH="$(java-config --all $DEPEND_LIST):app-main.jar"
JAVACMD="$(findjava $WORKING_JAVA)"
$JAVACMD com.example.Main
Thanks for the comments!
Jan
Reply to: