Return-Path: X-Original-To: apmail-maven-dev-archive@www.apache.org Delivered-To: apmail-maven-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7769419342 for ; Fri, 15 Apr 2016 23:27:58 +0000 (UTC) Received: (qmail 21488 invoked by uid 500); 15 Apr 2016 23:27:58 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 21410 invoked by uid 500); 15 Apr 2016 23:27:58 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 21399 invoked by uid 99); 15 Apr 2016 23:27:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 23:27:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7C968C0C72 for ; Fri, 15 Apr 2016 23:27:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.003 X-Spam-Level: X-Spam-Status: No, score=-0.003 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id qNDlhpF0C_x0 for ; Fri, 15 Apr 2016 23:27:54 +0000 (UTC) Received: from vps.schulte.it (vps.schulte.it [176.28.31.178]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E5CBF5F239 for ; Fri, 15 Apr 2016 23:27:53 +0000 (UTC) Received: from t60.schulte.it (dslb-084-063-170-232.084.063.pools.vodafone-ip.de [84.63.170.232]) (authenticated bits=0) by vps.schulte.it (8.14.3/8.14.3/Debian-9.4) with ESMTP id u3FNRk4I024177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 16 Apr 2016 01:27:47 +0200 X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99 at vps.schulte.it Subject: Re: RFC on MNG-6003: Drastically reduce JAVA_HOME discovery code To: Maven Developers List References: <57115055.6090507@apache.org> From: Christian Schulte Message-ID: <571178F1.6060006@schulte.it> Date: Sat, 16 Apr 2016 01:27:45 +0200 User-Agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <57115055.6090507@apache.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.3.7 (vps.schulte.it [176.28.31.178]); Sat, 16 Apr 2016 01:27:47 +0200 (CEST) Am 04/15/16 um 22:34 schrieb Michael Osipov: > In MNG-6003 [1], I propose to throw away all of this code and solely > rely on the dev's input. If he/she it not able to set it properly, > he/she shouldn't write code at all. Most of the time, on Unix/Linux, > this isn't even necessary because a JDK is installed by default. +1 I would go even further. Just error out if JAVA_HOME is not defined. In my opinion discovery of the 'java' launcher to use based on `which java` should also go away. Just make the scripts require JAVA_HOME to be defined and not try to discover anything automatically. On my machine I have /usr/local/jdk-1.7.0 /usr/local/jre-1.7.0 /usr/local/jdk-1.8.0 /usr/local/jre-1.8.0 The PATH contains /usr/local/jre-1.8.0/bin. The JRE directories have the java jurisdiction policy files installed. The JDK directories do not. The JDK keystores contain certificates the JRE directories do not contain etc. With my setup, `which java` points to a JRE launcher, not a JDK launcher. JAVA_HOME always points to a JDK. So `which java` is useless here and somehow error prone if I screw up JAVA_HOME. Regards, --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org