Date: Mon, 10 Oct 2005 16:20:22 GMT From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr> To: freebsd-eclipse@FreeBSD.org Subject: Re: ports/86860: [patch] Align java/eclipse invocation with javavmwrapper Message-ID: <200510101620.j9AGKMfa002778@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/86860; it has been noted by GNATS. From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr> To: Panagiotis Astithas <past@ebs.gr> Cc: bug-followup@FreeBSD.org Subject: Re: ports/86860: [patch] Align java/eclipse invocation with javavmwrapper Date: Mon, 10 Oct 2005 18:16:06 +0200 On Mon, Oct 10, 2005 at 07:02:52PM +0300, Panagiotis Astithas wrote: > >-PATH=${JAVA_HOME}/bin:$PATH exec "${ECLIPSE_HOME}/eclipse" $@ > >+JAVA_VERSION="%%JAVA_VERSION%%" JAVA_OS="%%JAVA_OS%%" > >PATH=${JAVA_HOME}/bin:$PATH exec "${ECLIPSE_HOME}/eclipse" $@ > > Why do you think this is necessary? What the eclipse executable does is > invoke the java executable it finds in the PATH. Since we have made sure > the javavmwrapper's symlink will get chosen as the default, it will > honour the JAVA_VERSION and JAVA_OS variables, right? Am I missing > something here? The port will pick a suitable JDK at *install* time depending on JAVA_VERSION and JAVA_OS in the Makefile. What your patch is about is the ability for the eclipse launcher to pick up a suitable JDK at *run* time. And you patch does this well, that is javavmwrapper will be used to find a JDK. Anyway, javavmwrapper will find a JDK depending on JAVA_HOME, JAVA_VERSION, JAVA_OS and JAVA_VENDOR (any of those which are defined). With my suggested changes, you still allow the launcher to let javavmwrapper pick a JDK but you enforce the policy of the java/eclipse port by restricting the choice of the JDK depending on JAVA_VERSION and JAVA_OS that were specified while installing the port, namely: JAVA_VERSION= 1.4+ JAVA_OS= native Without these changes, it is possible that Eclipse is run with a non-suitable JDK. For example: $ unset JAVA_HOME $ unset JAVA_VENDOR $ unset JAVA_OS $ export JAVA_PREFERRED_PORTS=JAVA_PORT_NATIVE_BSDJAVA_JDK_1_1 $ eclipse --> This will have the launcher to pick java/jdk11 which is not a suitable JDK (as per the JAVA_VERSION variable specified in java/eclipse/Makefile). Herve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510101620.j9AGKMfa002778>