Subject: pkg/17825: PKG_JVM=sun-jdk forces 1.4 _JAVA_HOME even for sun-jdk13
To: None <>
From: Jaromir Dolecek <>
List: netbsd-bugs
Date: 08/03/2002 20:35:58
>Number:         17825
>Category:       pkg
>Synopsis:       PKG_JVM=sun-jdk forces 1.4 _JAVA_HOME even for sun-jdk13
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 03 11:37:00 PDT 2002
>Originator:     Jaromir Dolecek
>Release:        NetBSD 1.6D
System: NetBSD 1.6D NetBSD 1.6D (SARUMAN) #231: Thu Jul 25 21:10:37 CEST 2002 i386
Architecture: i386
Machine: i386
	When a package (experienced with misc/openoffice) uses PKG_JVM
	sun-jdk, user has sun-jdk13 installed, but doesn't have sun-jdk14
	installed, the dependencies succeeed, but _JAVA_HOME isn't set
	properly. This is due to unconditional use of jdk14 JAVA_HOME.
	pkg_delete sun-jdk14
	pkg_delete sun-jre14
	pkg_add sun-jdk13
	cd /usr/pkgsrc/misc/openoffice && make

	realize (after a while), that correct JDK was not found
	(need rev. 1.19 of the openoffice Makefile, which uses _JAVA_HOME)

	Workaround I'm going to commit for openoffice is that I use
	PKG_JVM=sun-jdk13. This is needed anyway, since some Java code
	doesn't compile with sun-jdk14.

	However, "sun-jdk" should work the supposed way, i.e. setup
	environment for either sun-jdk13 or sun-jdk14 depending on which
	one is installed. It's entirely possible I understood "sun-jdk"
	purpose wrong way, but I think this _is_ the intent.

	One of ways would be to do something like following in
	for the "sun-jdk" case:

.if ${_J13:!pkg_info sun-jdk13 >/dev/null 2>&1 && echo YES || echo NO!} == "YES"

	I'm suggesting this way (i.e. use 1.3 base if sun-jdk13 is
	installed, without regard to whether or not sun-jdk14 is
	installed), since the depends regex favours 1.3 to
	1.4 (it's sun-jdk1[34], rather than sun-jsk1[43]).