From: DJ G. <dj...@op...> - 2006-12-23 19:18:56
|
On Dec 22, 2006, at 10:02 AM, Petersen, Mark wrote: > Now that I have all the java sillyness with pbuilder figured out I'm > going to try and switch to using sun java 1.5. Beyond that, when it > comes to JAVA_HOME, I don't really know much. Finally step I guess > would be to try and build it without pbuilder to perfect the build? I don't know how much you don't know about JAVA_HOME, so please excuse me if I'm repeating things that are obvious to you... :-) I'll point out that I'm fairly clueless when it comes to the build process for packages on modern versions of Debian. The JAVA_HOME environment should point to the directory where a Java 1.5 development kit (JDK) is installed. In particular, there should be a Java virtual machine at $JAVA_HOME/bin/java and a Java compiler at $JAVA_HOME/bin/javac. We use this in three places related to OpenNMS: 1) Build time; the "build.sh" script requires JAVA_HOME to be set so that it can invoke Maven 2 (our Java-based build tool) to build OpenNMS. 2) Daemon run time; the "runjava" script in OpenNMS is used to find an appropriate Java virtual machine for OpenNMS (it saves it in a configuration file, $OPENNMS_HOME/etc/java.conf for later use) and for starting up this JVM to start the OpenNMS daemon (and also to call the Java code that produces the output for "opennms status"). When runjava is called with the "-s" option it searches for a JVM and this is part of the standard install procedure. Execute runjava with the "-h" option for help and it will tell you how it searches for a JVM. One of the places where runjava looks for a JVM is in JAVA_HOME. 3) Tomcat run time; the web user interface (webUI) part of OpenNMS runs inside of the Tomcat web server. This, too, is a Java application, so it needs to be started in a JVM. It should be started with the same JVM that OpenNMS uses. Various distributions of Tomcat packages ship with various startup scripts, so you'll have to see what your specific distribution of Tomcat uses to figure out which JVM to use. For building a package, you only really need to care about #1. You can always patch build.sh to set JAVA_HOME explicitly while building, or create a small driver script that you execute which sets JAVA_HOME and then calls build.sh, etc.. I hope this helps, - djg |