You are not logged in.

#1 2005-06-06 19:34:23

shadov
Member
From: Finland
Registered: 2004-02-28
Posts: 40

QT/KDE Java does not run

I decided to learn Qt Java and KDEJava. I found some demo code here but I can't get it to work.

It compiles fine.

$ javac -classpath $CLASSPATH:/opt/kde/lib/java/qtjava.jar ScribbleWindow.java

But does not run.

$ java -classpath $CLASSPATH:/opt/kde/lib/java/qtjava.jar ScribbleWindow
Exception in thread "main" java.lang.UnsatisfiedLinkError: no qtjava in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.kde.qt.qtjava.initialize(qtjava.java:272)
        at org.kde.qt.qtjava.<clinit>(qtjava.java:283)
        at ScribbleWindow.<clinit>(ScribbleWindow.java:300)
$ 

Wiki says that

==> Kdebindings has been built with support for Java and GTK.
==> If you want to use these features use the following pacman commands:
==> 'pacman -S j2sdk'
==> 'pacman -S gtk'

I have kdebindings and j2sdk installed. After searching the forum I'm not sure if Wiki is right. Is kdebindings compiled with java support or not? Am I supposed to install or recompile something to get it working?


Application of abstract techniques and utilities to solving a particular business problem is NOT a patentable idea. It is a fundamental concept of the IT industry.

Offline

#2 2005-06-06 21:27:08

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,261

Re: QT/KDE Java does not run

at least it should work i never tried it.
would you try to install j2re too?
thanks
greetings
tpowa

Offline

#3 2005-06-06 21:47:32

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: QT/KDE Java does not run

shadov wrote:
$ java -classpath $CLASSPATH:/opt/kde/lib/java/qtjava.jar ScribbleWindow

ummm, try it like this:

$ java -classpath $CLASSPATH:/opt/kde/lib/java/ ScribbleWindow

Note the actual jar file has been removed.... but I'm no java guru

Offline

#4 2005-06-07 06:43:02

shadov
Member
From: Finland
Registered: 2004-02-28
Posts: 40

Re: QT/KDE Java does not run

phrakture wrote:

ummm, try it like this:

$ java -classpath $CLASSPATH:/opt/kde/lib/java/ ScribbleWindow

It gives different error:

$ java -classpath $CLASSPATH:/opt/kde/lib/java/ ScribbleWindow
Exception in thread "main" java.lang.NoClassDefFoundError: org/kde/qt/QWidget
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Application of abstract techniques and utilities to solving a particular business problem is NOT a patentable idea. It is a fundamental concept of the IT industry.

Offline

#5 2005-06-07 14:26:02

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: QT/KDE Java does not run

hmmm that error looks like it's not too hard to solve, but I'm not a java pro, so I've never seen it - it's one of those things you kinda pickup when using a library... for instance, in MS.NET you can get AssemblySecurityExceptions with some odd message that doesn't make sense when the assembly is not on a local "mount point" (mounted drive?)...

java pros: does that error look familiar?

Offline

#6 2005-06-07 14:33:49

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: QT/KDE Java does not run

Yeah.

Are there more than one jar file in /opt/kde/lib/java? You probably have to add all of them to the classpath.

Adding /opt/kde/lib/java will only add those classes that have .class extensions, it doesn't add classes inside jar files. You have to add them separately. (It IS a pain).

However, I have never seen that first error. What does 'locate qt.java' give you? If you can find it, you might try the following command:

java -classpath -Djava.library.path=/path/to/directory/containing/qt.java $CLASSPATH:/opt/kde/lib/java/qtjava.jar ScribbleWindow

I can investigate the error further tonight.

Dusty

Offline

#7 2005-06-09 19:49:40

shadov
Member
From: Finland
Registered: 2004-02-28
Posts: 40

Re: QT/KDE Java does not run

/opt/kde/lib/java contains koala.jar and qtjava.jar. Having both of them in classpath does not help (same error as in my firs post). I don't think the demo code uses Koala.

'locate qt.java' finds nothing.

Thanks for help anyway.


Application of abstract techniques and utilities to solving a particular business problem is NOT a patentable idea. It is a fundamental concept of the IT industry.

Offline

#8 2005-06-09 20:02:44

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: QT/KDE Java does not run

You could try to get ahold of this guy and see if he figured it out...:
http://lists.suse.com/archive/suse-linu … /2462.html

I searched for the error you got on google and it keeps suggesting a quicktime for java... ;-)

Dusty

Offline

Board footer

Powered by FluxBB