Subject: Re: JAVA_HOME and sun-jre
To: None <tech-pkg@netbsd.org>
From: David Brownlee <abs@netbsd.org>
List: tech-pkg
Date: 09/04/2001 18:41:44
On Tue, 7 Aug 2001, Matthias Scheler wrote:

> On Tue, Aug 07, 2001 at 06:45:15PM +0100, David Brownlee wrote:
> > 	pkgsrc sets JAVA_HOME to ${LOCALBASE}/java/jre if sun-{jdk,jre} is
> > 	selected.
>
> Yes, because that's where "sun-jre" has its JVM binary.
>
	I understand that.

> >      Unfortunately this breaks anything like jakarta-tomcat
> > 	which needs to compile java.
>
> Then fix the package. You could invent a variable pointing to the path
> of the Java compiler. "bsd.pkg.mk" alreadys adds a build dependence
> to the "sun-jdk" package if "USE_JAVA" is defined.

	Setting JAVAC is not enough in many cases - the packages expect
	JAVA_HOME to be pointing to the base of the directory containing
	a full JDK.

	Some options:

	1) Set JDK_HOME, and modify packages where necessary to use it for
	   build depends. This is probably going to be a significant ongoing
	   effort to patch new packages and maintain patches developers
	   will not accept back.

	2) Set JRE_HOME and use in packages that hardcode JAVA_HOME into
	   runtime paths. Could be less maintenance than the above, but
	   is ass-backwards.

	3) Remove the files from sun-jdk which are already in sun-jre and
	   install them both into the same 'JAVA_HOME'. (sun-jdk already
	   depends on sun-jre). This keeps the pain in the split jre-jdk
	   package (currently only sun-jdk). Still allows JAVAC to point
	   to jikes or similar, while keeping all the include and other
	   files in JAVA_HOME.


	While I think 1 is the cleanest option, I don't think its worth
	the effort to be different to everyone else on the planet, and
	I don't have the time to spend checking every single java package
	(particularly as the default install will have JDK_HOME and JAVA_HOME
	the same, so only people using sun-jdk will see any problems).

	I'm inclined to go with 3.




-- 
		David/absolute		-- www.netbsd.org: No hype required --