yum install java? Not so fast...

by Chris DiBona

yum search Java?


No packages found.


yum search JVM?


Some stuff found, but no JVMs....


Hmm, okay....I looking at what it takes to get a JVM loaded on my fedora core laptop...I'm looking to write some routines that allow java programs to authenticate off of a gforge user database. I've written these same routines in python already, so a part of me wants to try the jython route, as it might be fast and fun to do so, but either way I'll need a JVM on this laptop, so I download the SDK from sun.


Additionally, I want to hack up some j2me stuff for the game, sooner or later, to run on phones like my Treo and other phones (and yes, my head is in the sand regarding midp quality and such, but allow me my illusions, okay?), but for now I'm sticking with regular old j2se for the gforge project.


Gforge project leader Tim Perdue keeps threatening to switch from php to Java for gforge 4.0. Although most people don't think it will happen that way, it is worth my time to look into it. Tony Guntharp and I service Real Network's helixcommunity.org site, HC.org runs Gforge, means we care about the future directions of the codebase. Gforge is currently written in PHP and since mailman is so fundamental to its mail operation, some python.


Which brings up an interesting point, python is scary fast....and while I'm not looking to revive the java is slow debate, python, speed wise, is to php what php is to mod_perl and that is saying something. All three are pretty terrific scripting languages, so don't read too much into that, but the speed differences are really something. Mind you this is based on php 4.x numbers and not 5.x which I haven't installed yet.


Of course this brings up Java Server Pages and such, but for now, I just want to write some routines to query against gforge. The download, which is some 33 megabytes or so, is almost complete, Now Installing (timing it for our information)...


It would be really worthwhile for sun to provide packages in a yum or apt repository, but its probably pretty obvious that I feel that way, it's how we do things, I wonder why they don't do that, or for that matter where is IBM and the other JVM shops? It's so much easer to keep up with security patching on the rest via these kinds of systems, anyhow...


I'm probably missing something, likely someone has a yum repository up for java, but as I mentioned in an earlier post, I'm a java neophyte by any real measure, and I'm writing on LJN because of my Linux background, so much of this will be very beginner to some readers..


Oh, and while it is downloading, one more thing.... For shame, JBoss, that's really lame, I didn't mention this before, but for shame. When I worked at Slashdot, we'd see these kinds of campaigns all the time, and that's why moderation was developed. But super lame. Ah, looks like the download is done (yay DSL!)!


Do I agree? Again? Didn't I agree when I downloaded? "yes" ... Extracting rpm... rpm -Uvh etc.... done...


K, lets test the install a little bit...helloworld works... excellent...total time to install to this point: 15 minutes or so, not so bad, of that most was hacking about on suns site and such, I think the actual install time post download could have been around 3 minutes if it were properly integrated into yum/apt/etc...


It is fair to compare these against PHP and python, which can be loaded very easily via the various package mangers like yum and apt, including extra features like MySQL (yum install php-MySQL) and imap (install php-imap). Java would benefit from this kind of installation procedure:


yum install j2se

yum install j2me


You get the point, yum and those tools will even add paths properly for you and the rest that you must do by hand with sun's downloads, but all in all it went smoothly enough, no segfaults on my strangely updated fedora core laptop, so I'm happy. When deploying linux machines into data centers, I can say with confidence that I'd rather use a decent, updating package management system like yum than have to download things like java seperately from those processes.


Anyhow, next time: Querying against MySQL & PostgreSQL, how fast and easy is it to make that work, and maybe a little jython.

yum install java? Not so fast...


9 Comments

marklussier1
2004-05-21 15:27:45
java via yum
Actually jpackage.org maintains a large set of java tools (including the JDK) and makes them available to yum


http://jpackage.org/repos.php

chromatic
2004-05-21 18:03:38
Python versus PHP versus mod_perl

I thought I'd seen benchmarks somewhere that put mod_perl above mod_php for similar tasks. It'd certainly be interesting to see GForge ported to PHP 5, though!

cdibona
2004-05-22 11:33:33
java via yum
I knew it had to be true, thanks Mark!


Chris

perrin
2004-05-22 14:32:10
mod_perl speed
Every benchmark I've ever seen (inlcuding ones from Yahoo) shows mod_perl running faster than PHP at equivalent tasks. My own benchmarks of simple servlets doing database selects from Oracle showing mod_perl running faster than Java as well. (Don't believe Resin's benchmark -- their mod_perl code is flawed.) Basic language benchmarks still show that Perl has a significant speed advantage over Python. Nothing against Python -- I'm sure it's fast enough for nearly any practical application -- but your speed claims are just not accurate.
jwenting
2004-05-24 03:15:20
Python versus PHP versus mod_perl
you can get benchmarks to prove just about anything you want (except maybe that PHP is suited for enterprise scale applications).
cdibona
2004-05-24 17:03:13
mod_perl speed
What I've experienced is that I can run handle more clients using mod_php than mod_perl, and more still using mod_python in cgi or publisher mode, whcih is what I based my comment on (and other personal experience), but I didn't want that to be read as a slam on either, I love perl, php and python.


ChrisHuntley
2004-05-26 12:53:45
java via yum
Actually, the sun JDK is in the "non-free" section of jpackage. You have to create your own rpm by combining the jpackage "source" rpm with Sun's binary installer.


It's not too painful, but its certainly not as simple as


yum install j2sdk


You'll have to repeat the process for all the standard extensions like JavaMail and such.


Try


yum install tomcat4


to see what I mean.

cdibona
2004-05-27 20:55:16
Python versus PHP versus mod_perl
Are you implying that PHP isn't able to handle enterprise scale applications? May I introduce you to yahoo and sourceforge? Say what you will, PHP is capable.


Chris DiBona

tmo9d
2005-06-21 23:29:27
java via yum
Replying to this post way too late. But, a word to the wise, stay as far away from jpackage as you can, as you will rue the day you got into that mess.


For one, the jpackage RPMs are not updated with any kind of frequency, and unless you are looking to involve yourself and actually learn how to create RPM specs, you are going to just be out of luck on a number of levels.


Second, the directory structures and proliferation of symbolic links to things like jars (which all have fun filenames like [junit.jar] with those wacky brackets). Test 1, install Tomcat 5 through jpackage, use it for a few months, then try to upgrade to a version not in the Jpackage RPM repository. Possible, but nasty. FHS compliant, but annoying as anything.


Third, installing Java via the RPM from Sun is easy enough, sure it isn't being managed by yum, but


Fourth, shared jars are kind of a PITA when it comes to classloader issues. Sharing commons-beanutils with a common install just because you can doesn't make sense.


Go ahead, try it, you'll see - jpackage will make you wish you had just downloaded tgz and followed the simple instructions.