I installed Kaffe-1.1.4 and tried to compile a standard Java "Hello World" program: public class hello { public static void main(String[] args) { System.out.println("Hello, World!"); } } However, it failed with the following error message: $ javac hello.java Internal error: caught an unexpected exception. Please check your CLASSPATH and your installation. java/lang/NullPointerException Aborted I compiled the program using another Java compiler (from Blackdown JDK) and tried to run it with Kaffe, but I got the same error message: $ java hello Internal error: caught an unexpected exception. Please check your CLASSPATH and your installation. java/lang/NullPointerException Aborted I thought it might be a problem with Kaffe itself, but version 1.1.4 installed from sources works out-of-the-box, so I guess there must be something wrong with the ebuild. While trying to work around it, I also noticed that I am able to run the compiled program if I launch it using the plain kaffe-bin binary with a specific LD_LIBRARY_PATH: $ LD_LIBRARY_PATH=/opt/kaffe-1.1.4/jre/lib/i386 kaffe-bin hello Hello, World! This might suggest that the problem is caused by incorrect path settings. Reproducible: Always Steps to Reproduce: 1. Create hello.java 2. Try to compile it with Kaffe's javac
Please try 1.1.5 (~x86). If your problem persists, reopen this bug. We'll mark it stable very soon.
The problem is still there for Kaffe 1.1.5. It does compile the hello.java program, but only because version 1.1.5 uses a different Java compiler (jikes). When I try to execute the compiled hello.class, I get the same error message. But I think I tracked down the problem: it is obviously caused by my CFLAGS settings (-O2 -march=pentium4 -pipe -fomit-frame-pointer). When I emerged Kaffe 1.1.4 using its default CFLAGS taken from the original Makefile (-g -O2 -Wall -Wstrict-prototypes), the problem was gone and both compilation and execution worked fine.
Could you please use your original CFLAGS, but without -fomit-frame-pointer. (There seems to be a common misconception that -fomit-frame-pointer will give a performance boost. I recommend you remove it from your CFLAGS, since it breaks a lot of stuff, and also hampers debugging.)
Yes, removing -fomit-frame-pointer did it.
since -fomit-frame-pointer is used by many people i've added a strip-flags lime to the ebuild. therefor i'm going to mark this one as fixed. thanks for reporting and for supporting our development.