Posts Tagged ‘java’
ojdbc vs. gcj
If, upon your travels, you should encounter this error:
java.lang.ClassNotFoundException: oracle.security.pki.OracleWallet
you probably want to double-check your java executable:
# java -versionjava version "1.4.2"gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)Copyright (C) 2006 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you see the gcj, kill it with fire and install the Sun version (or remove the gcj-based /usr/bin/java that was ahead of your Sun executable in the $PATH):
# java -versionjava version "1.4.2_13"Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06)Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode)
Then all will be well in the world again.
Java5 Formatting Goodness
Back when I was researching how to format strings in java, I was dismayed that there wasn’t built-in sprintf() functionality. There was a non-standard class written by some folks at Sun called PrintfFormat. Still, not the same.
Yesterday I was reminded that such a thing was supposed to have been implemented in Java5, and indeed it was. The Formatter class provides just what I want, and it is all made even easier by just calling the static String.format() method. Oh, RAPTURE!



