From owner-freebsd-ports Wed Nov 1 12: 2: 5 2000 Delivered-To: freebsd-ports@freebsd.org Received: from webcom.it (unknown [213.205.4.2]) by hub.freebsd.org (Postfix) with SMTP id DF47037B4CF for ; Wed, 1 Nov 2000 12:02:00 -0800 (PST) Received: (qmail 42846 invoked by uid 1000); 1 Nov 2000 20:02:06 -0000 Message-ID: <20001101200206.42839.qmail@webcom.it> From: andrea@webcom.it Subject: Re: Using specific JDK from ports In-Reply-To: <3A006AE4.9CE47FF2@freebsd.org> "from Patrick Gardella at Nov 1, 2000 07:11:32 pm" To: Patrick Gardella Date: Wed, 1 Nov 2000 21:02:06 +0100 (CET) Cc: andrea@webcom.it, freebsd-ports@freebsd.org X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Yes, but they are all in specific locations: > /usr/local/jdk1.1.8 > /usr/local/jdk1.2.2 > /usr/local/linux-jdk1.2.2 Anyway, this is what I mean. Yes, they are in specific locations, but for instance at work I set up all servers with linux-jdk1.2.2. If tomorrow I moved to native jdk1.2.2, I'd have to reinstall or reconfigure or whatever, depending on the package requirements. > > This would make it very hard to require a particular version in a port. I had a > > look at javawmwrapper, but it doesn't look very useful, that is, feature > > complete. > > I disagree. Pick *one* (I'd suggest our native 1.2.2), and then use it > in the port, as a RUN_DEPENDS, and have it look for the java executable > in a specific location. Don't give the user too many options. > Take a look at the Makefile in the tya ports for an idea on this. My Enhydra port depends on linux-jdk1.2.2 (production environment at my company suggested not using a too recent native beta port). Now I have to change the port Makefile. My suggested wrapper would avoid this, just install the new JDK, maybe reconfigure the wrapper and reinstall the port. I looked at the tya Makefile, but this doesn't change my point. I want to depend on jdk-1.2.2 and pick whichever one happens to be installed. This doesn't mandate user choise, but allows for it. For example, if each JDK installed a file in /etc/java, the wrapper would be able to know that we have /usr/local/jdk1.1.8 /usr/local/jdk1.2.2 /usr/local/linux-jdk1.2.2 If my port requires jdk1.2.2, the wrapper would choose jdk1.2.2, so no user choise to confuse newbies. Still, in /etc/java/config a knowledgeable user could put: JDK2=/usr/local/linux-jdk1.2.2 and force the wrapper to choose this one instead. In every port using this wrapper would be possible to force choice just by setting an env variable before make; otherwise they'd just use the wrapper. So here again, nothing is forced on the user. > > What I'd like to see is some kind of software, like apxs for Apache or > > glib12-config, which could be called upon in a port's Makefile to determine > > (at least): > > > > - whether there is at least one JDK of required version installed > > - the path to the compiler > > - the path to jre > > - maybe even options to pass > > > > Note that probably most of this stuff could be solved by appropriate symlinks > > (for my setup, /usr/local/jdk1.2 -> /usr/local/linux-jdk1.2.2 would suffice), > > but I would be uncomfortable with updating such symlinks at port installation. > > Instead, each port which installs a new compiler / jre could just update some > > sort of repository (a file in /etc/jdk, for instance) to let the wrapper know > > it is there. It would still be the user responsibility to determine which one > > to use in case there are multiple equivalent. > > > > Please comment. If people are interested, I would probably get down and define > > requirements to send for comments again, and then I should also have time to > > actually implement this. > > I like this idea. A similar idea is the Oracle oraenv command where you > tell it what SID you are going use, and then it configures the > environmental variables (In the java case, JAVA_COMPILER, JAVA_HOME, > etc) It would take setting up a file somewhere that would list the > items for each of the possible configuations. Yes, that's what I was thinking about, except that having one file is hard to maintain automatically without losing user modifications. If each JDK port installed a file, we could then have one configuration file overriding the defaults. Example: /etc/java/config: JDK_DEFAULT=jdk1.2.2 JDK2_DEFAULT=linux-jdk1.2.2 /etc/java/jdk1.8.8: JAVA_COMPILER=/usr/local/jdk1.1.8/bin/javac CLASSPATH=... JAVA_HOME=... whatever quirks for Swift /etc/java/jdk1.2.2: JAVA_COMPILER=/usr/local/jdk1.2.2/bin/javac CLASSPATH=... A JIT port would install a similar file, maybe including the config file for its related JDK. > Do you need to define what compiler you will be using in an Enhydra > config file? Otherwise, you can have the user set that up in the > startup script for Enhydra. The more options you present, the more > opportunities for mistakes. Like when I tried to use a jit compiled for > 1.1.8 in 1.2.2 (it doesn't work). No, there is a configure script in /usr/local/enhydra* which you call with the path to the jdk. This is one time only. Anyway, I think this is a general issue, not Enhydra only. Bye, Andrea -- It is easier to fix Unix than to live with NT. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message