Oracle JDK deb: first attempt.
Dec. 30th, 2011 01:21 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
UPDATE: Don't do the below. I've asked on debian-java and already have a better method.
You can't get the Oracle proprietary JDK with Ubuntu any more. This is slightly annoying as our entire platform setup will shortly be Ubuntu with Oracle JDK. This requires us handrolling a deb. (We plan to shift to OpenJDK in due course for our own sanity, but know to test thoroughly.)
I can't just upload and link a deb here for copyright reasons (otherwise this wouldn't have been a problem in the first place). What I can do is give the recipe I used. This makes a Java which I hope is suitable for the server.
Missing: desktop plugin, menu updates, unixodbc dependency, binfmt registration, MIME types, a postinst thing to "activate class data sharing". Is there anything important I've missed for Java on the server? Specifically, for Tomcat.
This presumes you have fpm installed and in $PATH.
- Start in whatever directory you're doing this in (we'll call it ~/deb-factory/jdk )
- Download Linux x64 latest Java 6 JDK. Run the bin (it's a shell script). Verify it works: do jdk1.6.0_30/bin/java -version (or whatever) and you should get something like:
java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
- Then:
cd ~/deb-factory/jdk mkdir -p usr/lib/jvm mv jdk1.6.0_30/ usr/lib/jvm cd usr/lib/jvm ln -s jdk1.6.0_30 java-6-sun cd ../../..
- Now we get into generating a forest of symlinks for /etc/alternatives. This is done post-install. Nicked from the Debian packages' postinst, the following generates a symlink for each tool and for its manpage. (List is from the Debian packages.) Put this in a file called "postinst".
#!/bin/sh priority=63 basediralias=/usr/lib/jvm/java-6-sun mandir=/usr/lib/jvm/java-6-sun/man srcext=1.gz dstext=1.gz jdk_tools='HtmlConverter appletviewer apt extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc ControlPanel java java_vm javaws jcontrol keytool pack200 policytool rmid rmiregistry unpack200 orbd servertool tnameserv' for i in $jdk_tools; do unset slave1 || true if [ -e $mandir/man1/$i.$srcext ]; then slave1="--slave \ /usr/share/man/man1/$i.$dstext \ $i.$dstext \ $mandir/man1/$i.$srcext" fi update-alternatives \ --install \ /usr/bin/$i \ $i \ $basediralias/bin/$i \ $priority \ $slave1 done
- Then wrap all this up in a nice bundle:
fpm -s dir -t deb -n jdk6handrolled -v `date +%Y%m%d` -C ~/deb-factory/jdk --post-install ~/deb-factory/jdk/postinst usr
This should give a deb called jdk6handrolled_20111230_amd64.deb wherever you did this. This is very hacky and you should not use it unless you accept full responsibility.
That said, I installed Tomcat 6.0.29 (also from our handrolled deb, but pretty much the Apache version) and all the stuff in http://host:8080/examples/jsp/ worked okay. So Tomcat thinks it's Java!
"you should not use it unless you accept full responsibility."
Date: 2011-12-30 01:44 pm (UTC)Happy New Year, etc, btw
(no subject)
Date: 2011-12-30 02:40 pm (UTC)to make it perfect someone one needs to do https://github.com/jordansissel/fpm/issues/74 :)
(no subject)
Date: 2011-12-30 02:42 pm (UTC)(no subject)
Date: 2011-12-30 02:49 pm (UTC)I'd better have a look at that on the off-chance one can mangle the concept in order to make PHP packages ditto.
(no subject)
Date: 2011-12-30 05:37 pm (UTC)(no subject)
Date: 2011-12-30 05:39 pm (UTC)(no subject)
Date: 2011-12-30 11:45 pm (UTC)