Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

Saturday, November 17th, 2007

Just a little Google fodder. Should you encounter this uncommon error message when trying to compile or run a Java program:

$ javac -version
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

it means that your installation of the JDK, and likely your original download is corrupt. Delete it, download again, and reinstall. This can occur with essentially any Java program: the interpreter, the compiler, jar, or a program merely written in Java such as LimeWire.

For reasons that aren’t especially clear, this bug seems to occur most frequently on Ubuntu Linux 7.10 Gutsy Gibbon when running in a virtualized environment such as VMWare. At least those seem to be the common factors for everyone else I found with this problem when googling it myself.

SQLAlchemy for Java

Thursday, June 28th, 2007

Anyone know of an equivalent of the SQLAlchemy Python data binding library for Java? SQLAlchemy maps Python classes to the records in a table. What distinguishes it from Java-based ORM tools that I’ve seen such as Hibernate is that in SQLAlchemy you can map any table, not just ones that actually exists in the database.

SQLAlchemy doesn’t view databases as just collections of tables; it sees them as relational algebra engines. Its object relational mapper enables classes to be mapped against the database in more than one way. SQL constructs don’t just select from just tables—you can also select from joins, subqueries, and unions. Thus database relationships and domain object models can be cleanly decoupled from the beginning, allowing both sides to develop to their full potential.

(more…)

Choosing a Continuous Integration Server

Saturday, June 2nd, 2007

I’ve been tasked with setting up a continuous integration server for a team Java project. Options are:

We don’t have a strong opinion about any of these. Anyone care to comment on which one we should use and why?

NetBeans 6.0 M9 and JavaFX Script

Tuesday, May 22nd, 2007

Quick tip: if you’re playing with JavaFX Script, stick to NetBeans 5.5. The JFX plugin is pretty throughly broken in 6.0, as are several other unrelated features. 6.0 M9 is way too buggy to be used in production just yet.

Another Reason Java is Faster than C (maybe)

Monday, March 12th, 2007

Paul S. R. Chisholm points out a new reason virtual machine based languages such as Java may sometimes outperform statically optimized languages such as C:

Portability depends on architecture (for example, x86 vs. PowerPC), but high performance depends on microarchitecture (for example, Pentium M vs. Athlon 64 X2). Today’s Core 2 chips have many high performance features missing from the 1993 original Pentiums. A good compiler like gcc can take advantage of those additional features. This is bad news if you’re using a binary Linux distribution, compiled to a lowest common denominator. It’s good news if you’re building and installing Linux from source, with something like Linux From Scratch or Gentoo/Portage. It’s also good news for just-in-time compilers (think Java, .NET, and Mono); they’re compiling on the “target” machine, so they can generate code tailored for the machine’s exact microarchitecture.

This sounds plausible in theory. What I don’t know is whether Java takes advantage of this in practice. Has anyone looked at the JIT source code lately? Can anyone say whether it makes any microarchitecture-specific optimizations?

PDF Killed the Programming Language

Sunday, February 25th, 2007

It’s a slow Sunday morning so I was going to browse around a new language I’d been hearing rumors of, and maybe send them a little link love if I liked what I saw. However it seems all their tutorials, manuals, white papers, and almost everything else are in PDF. Yuck. Not worth my time.

They’re complaining that they can’t get any thought leaders to pay attention to them. If they insist on publishing on the Web in a format designed for paper books, it’s no wonder no one has noticed them. Write back when you start noticing this little thing called HTML, guys. I’ve got a feeling it’s going to be big one of these days.
(more…)