Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88330 - Kaffe-1.1.4 fails to compile/run a simple program
Summary: Kaffe-1.1.4 fails to compile/run a simple program
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-08 02:29 UTC by Michal Wojciechowski
Modified: 2005-04-11 05:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Wojciechowski 2005-04-08 02:29:23 UTC
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
Comment 1 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2005-04-09 11:54:25 UTC
Please try 1.1.5 (~x86). If your problem persists, reopen this bug. We'll mark it stable very soon.
Comment 2 Michal Wojciechowski 2005-04-10 05:16:57 UTC
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.
Comment 3 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2005-04-10 12:51:40 UTC
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.)
Comment 4 Michal Wojciechowski 2005-04-10 13:14:55 UTC
Yes, removing -fomit-frame-pointer did it.
Comment 5 Jan Brinkmann (RETIRED) gentoo-dev 2005-04-11 05:47:56 UTC
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.