If Java had proper garbage collection, most programs would self-delete upon execution. -- Jucius Maximus
FOREWORD: Just because this page is about Java and mentions a bunch of Java-related problems does not mean it will help you to solve them. If you're looking for actual, immediate answers for why you're getting "ocijdbc8 unsatisfied link error", you'll have to look elsewhere. Sorry.
I am not a fan of Java. (The programming
language, not the drink (which I love) or the place.) There are a lot of pages
out there on how and why
Java sucks, but most of them are written by and for programmers, e.g. "Java
sucks because you can only singly inherit dynamic classless initialization
methods!" (Um...yeah! Righteous! Preach it, brother!) I'm
sure they're all valid enough, but Java doesn't just suck for programmers, it
sucks for sysadmins too! There's enough suckiness in it for
I should really specify more carefully exactly what I mean by Java (since this is something even its supporters have to do). I learned a little of Java the language proper back when it was new and the hot thing to learn: it seems like a language like any other, no better or worse than many others. Fussy with the syntax and rather verbose, but that could be said of other languages too. As a sysadmin, I don't have to deal much with it anyway. Java the VM and class library is a different issue. That I do have to deal with. Then there's the whole culture surrounding Java...and that's a whole other can of worms.
That said, the major points against it from this sysadmin's point of view
devweb02:~$ tar xf qwertyuiop tar: qwertyuiop: No such file or directory devweb02:~$ jar xf asdfghjkl java.io.FileNotFoundException: asdfghjkl (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.One of these error messages is helpful. One is not. (Not even "jar: FileNotFoundException". But "java.io.FileNotFoundException". Sure hope you didn't have more than one java process running at once.) And the situation only gets worse when you're dealing with larger projects. When a program runs into a problem, a concise description, like "Cannot open connection to host.example.net", is useful. A 100-line stack dump is not. (The beautiful thing about programs in C is that you can easily get a stack dump if you want it -
(FileInputStream.java:64) at sun.tools.jar.Main.run(Main.java:186) at sun.tools.jar.Main.main(Main.java:904)
devweb05:~$ pstack $$ 5454: -bash ff19bcf0 waitid (7, 0, ffbefa30, 7) ff1560c0 _waitpid (7, ffbefb24, 4, ffbefb24, 21638, 39994) + 60 00039994 ???????? (8ccfc, 8c7b4, 38708, 2, 1, 1) 00038b00 wait_for (a8950, 16d6, 0, a7510, 0, 0) + 120 0002cc88 execute_command_internal (8cc00, 0, ffffffff, 0, 0, 0) + 740 0002c308 execute_command (a8890, a8890, 0, 0, 0, 0) + 44 00021970 reader_loop (8c400, 8c400, 0, 1, 1, 1) + 1dc 0001fc08 main (8c400, 1, 8cc00, 8c400, 0, 0) + 890 0001f360 _start (0, 0, 0, 0, 0, 0) + b8- but you don't get it unless you want it. You can use a debugger on a core file or running process if your platform doesn't have pstack or the like.) The general problem is that Java gives you messages which are meaningful in a Java context and not in a system context. I suspect this is because Java was written in a sort of bubble-boy environment, where it had very little to do with the real world (cf. Perl) and it persists because most major Java apps are written by people who are in love with Java, and they are in love with Java because they are programmers; language-related messages are the only things that mean anything to them. Here's a real example:
**** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / a__.n______.N______Resources->cantResolveComponent : Unable to resolve component /a__/d_____/service/jdbc/JTDataSource java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at java.lang.Runtime.loadLibrary0(Runtime.java:749) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at java.lang.System.loadLibrary(System.java:820) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at oracle.jdbc.driver.OracleConnection.Only the first line is relevant to the system administrator, and that only tangentially. In fact, the system tacitly acknowledges the uselessness of the flood of error messages by stopping them after a point.
(OracleConnection.java) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at java.sql.DriverManager.getConnection(DriverManager.java:517) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / at java.sql.DriverManager.getConnection(DriverManager.java:146) **** Error Fri Aug 31 16:04:18 EDT 2001 999288258613 / ....stack trace CROPPED after 10 lines.
Here's another real example:
***ERROR***: Wed Apr 10 15:52:27 EDT 2002 1018468347628 /a__/d_____/servlet/pagecompile/PageCompileServlet The detailed exception is: java.io.IOException: Not enough spaceThat's the "detailed exception"?! "Not enough space"? Not enough what space? Heap? Disk? If that's the detailed one, I don't want to see the short version. (I'm picturing Java just saying "No." and dying.)
yoyodyne:~$ truss 2>&1 java HelloWorld >/dev/null | wc -l 1107One thousand one hundred seven lines of truss output just to run Hello World?
yoyodyne:~$ truss 2>&1 java HelloWorld >/dev/null | egrep -c "sema|mutex" 40Forty lines of semaphore or mutex activity to run Hello World?
yoyodyne:~$ ldd HelloWorld.class ldd: HelloWorld.class: unsupported or unknown file typeOops, can't look at the dependencies either. I've never tried using a library interposer with a Java program, but I don't think it would be much fun.
Other failings of Java are not intrinsic to the environment, but of the way it's been marketed, and why people say everyone should love Java.
sadalsuud:~$ perl perlopen.pl Can't open file: No such file or directory at perlopen.pl line 1.and
sadalsuud:~$ perl perlinc.pl Can't locate NONEXISTENT.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl /usr/lib/perl5/site_perl .) at perlinc.pl line 1. BEGIN failed--compilation aborted at perlinc.pl line 1.Perl is also open-source, so you can actually fix the broken stuff vendors send you, as opposed to waiting around for them to fix their bytecode. (I have run into intentionally obfuscated Perl that is effectively impossible to read; I can't excuse this and won't use it if I have a choice.)
devweb02:~$ java HelloWorld.class Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/class devweb02:~$ java HelloWorld Hello World
Here's another stunning example of the poor integration of Java (with Solaris, anyway).
yoyodyne:~$ pwd /export/home/jdweiner yoyodyne:~$ java HelloWorld Hello World yoyodyne:~$ cd .. yoyodyne:/export/home$ java jdweiner/HelloWorld Exception in thread "main" java.lang.NoClassDefFoundError: jdweiner/HelloWorld (wrong name: HelloWorld)This is jaw-droppingly braindamaged from a Unix POV. You actually aren't allowed to address the class file by its location in the filesystem! This shouldn't be surprising, given the fact that you aren't allowed to address it by its actual filename. I'd be curious to know how Java developers deal with this. It's normal to be able to rename myprogram to myprogram.old if you want to compile a new version of myprogram, and then still be able to invoke myprogram.old. But, of course, you can't do that with java. You can do this:
panix2:~$ env CLASSPATH=~/myjavaprogs java HelloWorldbut that doesn't help if you've renamed the file. It's painfully clear that Java did not begin its life in the Unix world, and simply got bolted on like a sidecar when Sun decided that it would be a nifty tool. To which they basically admit in http://java.sun.com/features/1998/05/birthday.html:
Java technology was created as a programming tool in a small, closed-door project...[for] the convergence of digitally controlled consumer devices and computers.The article goes on to explain that Java was, in fact, originally intended only for things like interactive web pages. At what point they decided an environment so closely tied to interactive TV and web page animations would be appropriate for general-purpose computing is never explained.
In the summer of 1992, they emerged with a working demo, an interactive, handheld home-entertainment device controller with an animated touchscreen user interface.
...says James Gosling. "We were pitching the cable companies on the idea that this is what your network should look like. It was interactive, and users could read and write information into the system. But the companies didn't want to lose that much control." It was too far ahead of its time, and the team, now numbering 70 people, was still searching for a target market.
"After we realized that there wasn't a business in digital cable television, we had a group meeting at The Inn at Squaw Creek near Lake Tahoe. We had to figure out what to do with this technology, or what to do with our lives." There, over the course of three days, John Gage, James Gosling, Bill Joy, Patrick Naughton, Wayne Rosing, and Eric Schmidt had a group epiphany: why not the Internet?"
Another telling quote, this time from http://www.wired.com/wired/archive/3.12/java.saga.html :
In April 1991, the team moved from Sun's main campus to office space above a branch of the Bank of America on Menlo Park's Sand Hill Road, cutting itself off from Sun's internal computer network. The programmers disconnected culturally as well. ''We thought if we stayed over there, we would end up with just another workstation,'' Sheridan says. "I was obnoxious about keeping it secret.''I.e., "we threw out all the existing standards and then expected everybody to change to do things our way."