Discussion:
Gtk.init throws exception when run on Ubuntu 13.04
Johan Groth
2013-07-19 23:38:37 UTC
Permalink
Hi,
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only Linux
dist I've got available). Fired up Eclipse Juno, added the library to my
project (and the docs of course) and tried to run it but I'm getting an
exception! What is going on here?
The program is this:

package uk.org.linuxgrotto.ui;

import org.apache.log4j.Logger;
import org.gnome.gtk.Gtk;

/**
* The class instantiates the main window.
*
* @author jgroth
*
*/
public class DesktopFileCreator {

private static Logger log = Logger.getLogger(DesktopFileCreator.class);

public static void main(String[] args) {
Gtk.init(args);
}
}

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.gnome.gtk.Gtk.init(Gtk.java:95)
at
uk.org.linuxgrotto.ui.DesktopFileCreator.main(DesktopFileCreator.java:63)
Caused by: java.lang.NullPointerException
at org.freedesktop.bindings.Plumbing.loadNativeCode(Plumbing.java:192)
at org.freedesktop.bindings.Plumbing.<clinit>(Plumbing.java:110)
... 2 more

This is so minimal it can't be any smaller and yet an exception.

Regards,
Johan
Guillaume Mazoyer
2013-07-20 12:37:39 UTC
Permalink
Hi,
Post by Johan Groth
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only Linux
Do you have libjava-gnome-jni installed too?

Regards,

--
Guillaume Mazoyer - https://respawner.fr/
Johan Groth
2013-07-20 15:24:35 UTC
Permalink
Post by Guillaume Mazoyer
Hi,
Post by Johan Groth
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only Linux
Do you have libjava-gnome-jni installed too?
I do indeed.

$ ll /usr/lib/lib*jni*
lrwxrwxrwx 1 root root 22 Jul 19 22:53 /usr/lib/libgtkjni-4.1.2.so ->
jni/libgtkjni-4.1.2.so

$ ll /usr/lib/jni/lib*
-rw-r--r-- 1 root root 1208816 Sep 10 2012 /usr/lib/jni/libgtkjni-4.1.2.so
-rw-r--r-- 1 root root 72232 Jun 6 2011 /usr/lib/jni/libjnidispatch.so

Regards,
Johan
Andrew Cowie
2013-07-21 01:20:17 UTC
Permalink
Post by Johan Groth
Hi,
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only
Linux dist I've got available). Fired up Eclipse Juno, added the
library to my project (and the docs of course) and tried to run it but
I'm getting an exception! What is going on here?
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.gnome.gtk.Gtk.init(Gtk.java:95)
This is bizarre.
Post by Johan Groth
Caused by: java.lang.NullPointerException
at
org.freedesktop.bindings.Plumbing.loadNativeCode(Plumbing.java:192)
at org.freedesktop.bindings.Plumbing.<clinit>(Plumbing.java:110)
... 2 more
Ok, that's more interesting.

This means the code at line 191 returned null. [which is why I'm so
particular about not chaining method calls]. So ProtectionDomain's
getCodeSource() is returning null. That's annoying; . It doesn't here.

What version of Java are you using? And, can you describe how you're
running the program (from within Eclipse? from the command line?).

AfC
Sydney
Johan Groth
2013-07-21 08:26:12 UTC
Permalink
Post by Andrew Cowie
Post by Johan Groth
Hi,
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only
Linux dist I've got available). Fired up Eclipse Juno, added the
library to my project (and the docs of course) and tried to run it but
I'm getting an exception! What is going on here?
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.gnome.gtk.Gtk.init(Gtk.java:95)
This is bizarre.
Post by Johan Groth
Caused by: java.lang.NullPointerException
at
org.freedesktop.bindings.Plumbing.loadNativeCode(Plumbing.java:192)
at org.freedesktop.bindings.Plumbing.<clinit>(Plumbing.java:110)
... 2 more
Ok, that's more interesting.
This means the code at line 191 returned null. [which is why I'm so
particular about not chaining method calls]. So ProtectionDomain's
getCodeSource() is returning null. That's annoying; . It doesn't here.
What version of Java are you using? And, can you describe how you're
running the program (from within Eclipse? from the command line?).
I'm running it from within Eclipse and using java7.
Same code running from within Netbeans 7.3.

DANGER: (null)-WARNING, Couldn't connect to accessibility bus: Failed to
connect to socket /tmp/dbus-OZp7FBDLKz: Connection refused
Exception in thread "main" org.gnome.glib.FatalError: (null)-WARNING
Couldn't connect to accessibility bus: Failed to connect to socket
/tmp/dbus-OZp7FBDLKz: Connection refused
at org.gnome.gtk.GtkMain.gtk_init(Native Method)
at org.gnome.gtk.GtkMain.init(GtkMain.java:54)
at org.gnome.gtk.Gtk.init(Gtk.java:95)
at
uk.org.linuxgrotto.ui.DesktopFileEditor.main(DesktopFileEditor.java:15)
Java Result: 1

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Regards,
Johan
Johan Groth
2013-07-22 17:32:17 UTC
Permalink
Post by Andrew Cowie
Post by Johan Groth
Hi,
I've just installed libjava-gnome-java on a Ubuntu 13.04 box (only
Linux dist I've got available). Fired up Eclipse Juno, added the
library to my project (and the docs of course) and tried to run it but
I'm getting an exception! What is going on here?
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.gnome.gtk.Gtk.init(Gtk.java:95)
This is bizarre.
Post by Johan Groth
Caused by: java.lang.NullPointerException
at
org.freedesktop.bindings.Plumbing.loadNativeCode(Plumbing.java:192)
at org.freedesktop.bindings.Plumbing.<clinit>(Plumbing.java:110)
... 2 more
Ok, that's more interesting.
This means the code at line 191 returned null. [which is why I'm so
particular about not chaining method calls]. So ProtectionDomain's
getCodeSource() is returning null. That's annoying; . It doesn't here.
What version of Java are you using? And, can you describe how you're
running the program (from within Eclipse? from the command line?).
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I simply
can't get it to work. Oh, well, back to using Swing.

Regards,
Johan
Guillaume Mazoyer
2013-07-22 20:30:53 UTC
Permalink
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I simply
can't get it to work. Oh, well, back to using Swing.
Did you try the version from the PPA[1]?

[1] https://launchpad.net/~java-gnome/+archive/ppa

--
Guillaume Mazoyer - https://respawner.fr/
Johan Groth
2013-07-22 23:39:54 UTC
Permalink
Post by Guillaume Mazoyer
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I simply
can't get it to work. Oh, well, back to using Swing.
Did you try the version from the PPA[1]?
[1] https://launchpad.net/~java-gnome/+archive/ppa
No, I didn't. I thought PPA packages were unstable.

Regards,
Johan
Andrew Cowie
2013-07-23 01:15:06 UTC
Permalink
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I simply
can't get it to work. Oh, well, back to using Swing.
Please feel free to do what ever makes you happy, but keep in mind that
many of the other people else using java-gnome are using it on Ubuntu.
It works fine for them, so it's possible that something about your
environment is different. Personally, I'd like to find out what that is,
because it's entirely possible that other people will encounter the same
problem. But since *I* can't see the problem, I need your help. Will you
help us?
Post by Johan Groth
Post by Guillaume Mazoyer
Did you try the version from the PPA[1]?
[1] https://launchpad.net/~java-gnome/+archive/ppa
No, I didn't. I thought PPA packages were unstable.
Not when they're from the upstream project you're trying to use.

AfC
Sydney
Johan Groth
2013-07-23 07:41:46 UTC
Permalink
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I simply
can't get it to work. Oh, well, back to using Swing.
It might be that java-gnome 4.1.2 is just fine and Unbuntu 13.04 is
broken. I just don't have the time to make an extensive investigation
right now to find out if that is the case, though.
Post by Andrew Cowie
Please feel free to do what ever makes you happy, but keep in mind that
many of the other people else using java-gnome are using it on Ubuntu.
It works fine for them, so it's possible that something about your
environment is different. Personally, I'd like to find out what that is,
because it's entirely possible that other people will encounter the same
problem. But since *I* can't see the problem, I need your help. Will you
help us?
Certainly, no problem.
So my environment is:
HW:
Lenovo W500, 8 GB RAM

SW:
Ubuntu 13.04.
Eclipse Juno
Java 7 (OpenJDK7 which is the default version of Java on Ubuntu 13.04).
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Did you try the version from the PPA[1]?
[1] https://launchpad.net/~java-gnome/+archive/ppa
No, I didn't. I thought PPA packages were unstable.
Not when they're from the upstream project you're trying to use.
Ok, I've never installed a PPA package so some help with that would be
much appreciated.

Regards,
Johan
cyber python
2013-07-23 17:42:46 UTC
Permalink
It's fairly easy - just open a terminal and give:
*sudo add-apt-repository ppa:java-gnome/ppa*
*sudo apt-get update*
*sudo apt-get install java-gnome*

The first command adds the PPA to your software sources.
The second one updates the package index of your system.
The third one actually installs the software.
Post by Johan Groth
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu 13.04. I
simply
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
can't get it to work. Oh, well, back to using Swing.
It might be that java-gnome 4.1.2 is just fine and Unbuntu 13.04 is
broken. I just don't have the time to make an extensive investigation
right now to find out if that is the case, though.
Post by Andrew Cowie
Please feel free to do what ever makes you happy, but keep in mind that
many of the other people else using java-gnome are using it on Ubuntu.
It works fine for them, so it's possible that something about your
environment is different. Personally, I'd like to find out what that is,
because it's entirely possible that other people will encounter the same
problem. But since *I* can't see the problem, I need your help. Will you
help us?
Certainly, no problem.
Lenovo W500, 8 GB RAM
Ubuntu 13.04.
Eclipse Juno
Java 7 (OpenJDK7 which is the default version of Java on Ubuntu 13.04).
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Did you try the version from the PPA[1]?
[1] https://launchpad.net/~java-gnome/+archive/ppa
No, I didn't. I thought PPA packages were unstable.
Not when they're from the upstream project you're trying to use.
Ok, I've never installed a PPA package so some help with that would be
much appreciated.
Regards,
Johan
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
java-gnome-developer mailing list
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
Niranjan Rao
2013-07-23 19:31:56 UTC
Permalink
I do use/have used java gnome on all 3 versions of Ubuntu starting from
Ubuntu 12.04 namely 12.04, 12.10, 13.04. It does work fine on all of
these versions.

Only difference I can think of is our jar file is built locally and
deployed to internal maven repository where all other developers access
it. If I remember correctly, the jar is built on 12.04 and used on all
other versions of ubuntu.

We do use Oracle JDK.

Regards,

Niranjan
**sudo add-apt-repository *ppa:java-gnome/ppa*
*sudo apt-get update*
*sudo apt-get install java-gnome*
The first command adds the PPA to your software sources.
The second one updates the package index of your system.
The third one actually installs the software.
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
It seems to me that java-gnome 4.1.2 is broken on Ubuntu
13.04. I simply
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Post by Johan Groth
can't get it to work. Oh, well, back to using Swing.
It might be that java-gnome 4.1.2 is just fine and Unbuntu 13.04 is
broken. I just don't have the time to make an extensive investigation
right now to find out if that is the case, though.
Post by Andrew Cowie
Please feel free to do what ever makes you happy, but keep in
mind that
Post by Andrew Cowie
many of the other people else using java-gnome are using it on
Ubuntu.
Post by Andrew Cowie
It works fine for them, so it's possible that something about your
environment is different. Personally, I'd like to find out what
that is,
Post by Andrew Cowie
because it's entirely possible that other people will encounter
the same
Post by Andrew Cowie
problem. But since *I* can't see the problem, I need your help.
Will you
Post by Andrew Cowie
help us?
Certainly, no problem.
Lenovo W500, 8 GB RAM
Ubuntu 13.04.
Eclipse Juno
Java 7 (OpenJDK7 which is the default version of Java on Ubuntu 13.04).
Post by Andrew Cowie
Post by Johan Groth
Post by Guillaume Mazoyer
Did you try the version from the PPA[1]?
[1] https://launchpad.net/~java-gnome/+archive/ppa
<https://launchpad.net/%7Ejava-gnome/+archive/ppa>
Post by Andrew Cowie
Post by Johan Groth
No, I didn't. I thought PPA packages were unstable.
Not when they're from the upstream project you're trying to use.
Ok, I've never installed a PPA package so some help with that would be
much appreciated.
Regards,
Johan
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
java-gnome-developer mailing list
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
java-gnome-developer mailing list
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
Johan Groth
2013-07-24 07:49:23 UTC
Permalink
Post by Niranjan Rao
I do use/have used java gnome on all 3 versions of Ubuntu starting from
Ubuntu 12.04 namely 12.04, 12.10, 13.04. It does work fine on all of
these versions.
Only difference I can think of is our jar file is built locally and
deployed to internal maven repository where all other developers access
it. If I remember correctly, the jar is built on 12.04 and used on all
other versions of ubuntu.
We do use Oracle JDK.
So do I, openjdk 7 which is the default Java on Ubuntu 13.04. Mind you,
I've tried openjdk 6 with no difference.
Could it be I'm on a 64 bit version of Linux?

Regards,
Johan
Andrew Cowie
2013-07-24 13:36:27 UTC
Permalink
Post by Johan Groth
Could it be I'm on a 64 bit version of Linux?
No, not that (though always a likely candidate). We've been 64-bit safe
for years.

AfC
Sydney
Niranjan Rao
2013-07-31 20:12:02 UTC
Permalink
Sorry for the late reply.

We use both 32bit and 64bit though we are in process of migrating to
64bit completely.

Not that it should make any difference, but the code runs on standalone
boxes and diverse virtual host.

You may want to look at dependencies on 13.04. If I remember correctly
we had some minor trouble getting it work on 13.04 because of libwebp2
not easily available on 13.04

You might have already taken care of it, but can you confirm its really
using oracle jdk? I have bean burned couple of times on ubntu because
default points openjdk and even after setting java home it was still
picking up oracle jdk. Proper fix turned out to be update-altenatives
and point /usr/bin/java to oracle java. Things do fail mysteriously on
openjdk, at least in my observation. Since I use openjdk only
accidentally never investigated why/where etc.

Regards,

Niranjan
Post by Johan Groth
Post by Niranjan Rao
I do use/have used java gnome on all 3 versions of Ubuntu starting from
Ubuntu 12.04 namely 12.04, 12.10, 13.04. It does work fine on all of
these versions.
Only difference I can think of is our jar file is built locally and
deployed to internal maven repository where all other developers access
it. If I remember correctly, the jar is built on 12.04 and used on all
other versions of ubuntu.
We do use Oracle JDK.
So do I, openjdk 7 which is the default Java on Ubuntu 13.04. Mind you,
I've tried openjdk 6 with no difference.
Could it be I'm on a 64 bit version of Linux?
Regards,
Johan
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
java-gnome-developer mailing list
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
Loading...