From owner-freebsd-eclipse@FreeBSD.ORG Mon Oct 10 16:20:23 2005 Return-Path: X-Original-To: freebsd-eclipse@hub.freebsd.org Delivered-To: freebsd-eclipse@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2693616A43C for ; Mon, 10 Oct 2005 16:20:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E28C443D4C for ; Mon, 10 Oct 2005 16:20:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9AGKMQm002779 for ; Mon, 10 Oct 2005 16:20:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9AGKMfa002778; Mon, 10 Oct 2005 16:20:22 GMT (envelope-from gnats) Date: Mon, 10 Oct 2005 16:20:22 GMT Message-Id: <200510101620.j9AGKMfa002778@freefall.freebsd.org> To: freebsd-eclipse@FreeBSD.org From: Herve Quiroz Cc: Subject: Re: ports/86860: [patch] Align java/eclipse invocation with javavmwrapper X-BeenThere: freebsd-eclipse@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Herve Quiroz List-Id: "FreeBSD users of eclipse EDI, tools, rich client apps & ports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 16:20:23 -0000 The following reply was made to PR ports/86860; it has been noted by GNATS. From: Herve Quiroz To: Panagiotis Astithas 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