javah task fails

Bug #361578 reported by LCID Fire
2
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: ant

In my build.xml I have a javah task for 2 classes. The Javah aborts with:

    [javah] Exception in thread "main" java.lang.ExceptionInInitializerError
    [javah] at gnu.classpath.tools.common.ClasspathToolParser.getVersionString(ClasspathToolParser.java:65)
    [javah] at gnu.classpath.tools.common.ClasspathToolParser.<init>(ClasspathToolParser.java:81)
    [javah] at gnu.classpath.tools.javah.Main.getParser(Main.java:193)
    [javah] at gnu.classpath.tools.javah.Main.run(Main.java:342)
    [javah] at gnu.classpath.tools.javah.Main.main(Main.java:466)
    [javah] at com.sun.tools.javah.Main.main(Main.java:50)
    [javah] Caused by: java.util.MissingResourceException: Can't find bundle for base name gnu.classpath.tools.common.Messages, locale en_US
    [javah] at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1539)
    [javah] at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1278)
    [javah] at java.util.ResourceBundle.getBundle(ResourceBundle.java:733)
    [javah] at gnu.classpath.tools.common.Messages.<clinit>(Messages.java:50)
    [javah] ... 6 more
    [javah] Caused by: java.lang.ClassCastException: gnu.classpath.tools.common.Messages cannot be cast to ResourceBundle
    [javah] at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2409)
    [javah] at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1424)
    [javah] at java.util.ResourceBundle.findBundle(ResourceBundle.java:1383)
    [javah] at java.util.ResourceBundle.findBundle(ResourceBundle.java:1310)
    [javah] at java.util.ResourceBundle.findBundle(ResourceBundle.java:1310)
    [javah] at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1252)
    [javah] ... 8 more

Revision history for this message
LCID Fire (lcid-fire) wrote :

It works under jdk not under openjdk

affects: ant (Ubuntu) → openjdk-6 (Ubuntu)
Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Looking at the exceptions it looks like the java environment set on your machine is GCJ and not openjdk.

Can you please paste output of command 'ls -l /etc/alternatives/javah'?

Revision history for this message
LCID Fire (lcid-fire) wrote :

It says: /etc/alternatives/javah -> /usr/lib/jvm/java-6-openjdk/bin/javah

I even tried
sudo update-java-alternatives -s java-6-sun
- but the output is still the same. So is it valid to change the symlink manually?

Revision history for this message
LCID Fire (lcid-fire) wrote :

Woah - I just noticed - there is no bin/javah in java-6-sun!?

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Not sure what the problem is. I think the alternatives are messed up eg. some alternatives pointing to one java while some to others.
You can try doing 'update-java-alternatives -s java-6-openjdk'. Please let us know if this makes any difference.

And javah is part of -jdk packages. So if you want to use Sun JRE/JDK make sure you have sun-java6-jdk package installed.

Revision history for this message
LCID Fire (lcid-fire) wrote :

Thanks Onkar for hinting in the right direction.
Seems like I forgot to install the sun-java6-jdk while trying out some configurations. Installing it and setting alternatives to java-6-sun did the trick.
The bug is still valid though - it is not working when I set alternatives to java-6-openjdk.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Do you have any sample build.xml file that I can try out?

Revision history for this message
LCID Fire (lcid-fire) wrote :

Not exactly a sample - but you can try out my original at http://github.com/LCID-Fire/areca/tree/ubuntu.
It's located underneath src

Revision history for this message
Matthias Klose (doko) wrote :

I'm unable to reproduce this. Is there a downloadable package (.dsc) file?

Changed in openjdk-6 (Ubuntu):
status: New → Incomplete
Revision history for this message
Matthias Klose (doko) wrote :

unreproducible, no feedback. closing the report

Changed in openjdk-6 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.