bd338 0 Light Poster

I'm running Mac OS X Lion on my 64-bit MacBook, and I can't run any of the QT Jambi applications I create. Here's the code of the test program I'm trying to deploy.

import com.trolltech.qt.gui.QApplication;
import com.trolltech.qt.gui.QPushButton;

public class GUI {

    public static void main(String[] args) {
        QApplication.initialize(args);
        QPushButton b = new QPushButton("test button");
        
        b.setWindowTitle("test window");
        b.resize(150, 30);
        b.show();
        QApplication.exec();
    }
}

I've built this in NetBeans adding the following .jar files to my custom created QTJambi library:

  1. qtjambi-4.6.3.jar
  2. qtjambi-designer-4.6.3.jar
  3. qtjambi-examples-4.6.3.jar
  4. qtjambi-macosx-gcc-4.6.3.jar
  5. qtjambi-util-4.6.3.jar

This is what comes out into the console when I run the application:

run:
Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.trolltech.qt.gui.QApplication.<clinit>(QApplication.java:12)
	at GUI.main(GUI.java:7)
Caused by: java.lang.RuntimeException: Loading library failed, progress so far:
Unpacking .jar file: 'qtjambi-macosx-gcc-4.6.3.jar'
Checking Archive 'qtjambi-macosx-gcc-4.6.3.jar'
 - cache key='gcc-20100817-1815'
 - adding 'libQtCore.4.dylib' to library map
 - library: name='lib/libQtCore.4.dylib', 
 - adding 'libQtGui.4.dylib' to library map
 - library: name='lib/libQtGui.4.dylib', 
 - adding 'libQtXml.4.dylib' to library map
 - library: name='lib/libQtXml.4.dylib', 
 - adding 'libQtSql.4.dylib' to library map
 - library: name='lib/libQtSql.4.dylib', 
 - adding 'libQtSvg.4.dylib' to library map
 - library: name='lib/libQtSvg.4.dylib', 
 - adding 'libQtHelp.4.dylib' to library map
 - library: name='lib/libQtHelp.4.dylib', 
 - adding 'libQtScript.4.dylib' to library map
 - library: name='lib/libQtScript.4.dylib', 
 - adding 'libQtScriptTools.4.dylib' to library map
 - library: name='lib/libQtScriptTools.4.dylib', 
 - adding 'libQtMultimedia.4.dylib' to library map
 - library: name='lib/libQtMultimedia.4.dylib', 
 - adding 'libQtNetwork.4.dylib' to library map
 - library: name='lib/libQtNetwork.4.dylib', 
 - adding 'libQtOpenGL.4.dylib' to library map
 - library: name='lib/libQtOpenGL.4.dylib', 
 - adding 'libQtWebKit.4.dylib' to library map
 - library: name='lib/libQtWebKit.4.dylib', 
 - adding 'libQtXmlPatterns.4.dylib' to library map
 - library: name='lib/libQtXmlPatterns.4.dylib', 
 - adding 'libphonon.4.dylib' to library map
 - library: name='lib/libphonon.4.dylib', 
 - adding 'libQtDBus.4.dylib' to library map
 - library: name='lib/libQtDBus.4.dylib', 
 - library: name='plugins/phonon_backend/libphonon_qt7.dylib', never load
 - library: name='plugins/imageformats/libqjpeg.dylib', never load
 - library: name='plugins/imageformats/libqgif.dylib', never load
 - library: name='plugins/imageformats/libqmng.dylib', never load
 - library: name='plugins/imageformats/libqtiff.dylib', never load
 - library: name='plugins/imageformats/libqsvg.dylib', never load
 - library: name='plugins/iconengines/libqsvgicon.dylib', never load
 - library: name='plugins/codecs/libqcncodecs.dylib', never load
 - library: name='plugins/codecs/libqjpcodecs.dylib', never load
 - library: name='plugins/codecs/libqkrcodecs.dylib', never load
 - library: name='plugins/codecs/libqtwcodecs.dylib', never load
 - library: name='plugins/accessible/libqtaccessiblewidgets.dylib', never load
 - library: name='plugins/sqldrivers/libqsqlite.dylib', never load
 - adding 'libqtjambi.jnilib' to library map
 - library: name='lib/libqtjambi.jnilib', 
 - adding 'libcom_trolltech_qt_core.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_core.jnilib', 
 - adding 'libcom_trolltech_qt_gui.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_gui.jnilib', 
 - adding 'libcom_trolltech_qt_xml.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_xml.jnilib', 
 - adding 'libcom_trolltech_qt_sql.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_sql.jnilib', 
 - adding 'libcom_trolltech_qt_svg.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_svg.jnilib', 
 - adding 'libcom_trolltech_qt_help.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_help.jnilib', 
 - adding 'libcom_trolltech_qt_script.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_script.jnilib', 
 - adding 'libcom_trolltech_qt_scripttools.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_scripttools.jnilib', 
 - adding 'libcom_trolltech_qt_multimedia.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_multimedia.jnilib', 
 - adding 'libcom_trolltech_qt_network.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_network.jnilib', 
 - adding 'libcom_trolltech_qt_opengl.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_opengl.jnilib', 
 - adding 'libcom_trolltech_qt_phonon.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_phonon.jnilib', 
 - adding 'libcom_trolltech_qt_webkit.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_webkit.jnilib', 
 - adding 'libcom_trolltech_qt_xmlpatterns.jnilib' to library map
 - library: name='lib/libcom_trolltech_qt_xmlpatterns.jnilib', 
 - adding 'classes.nib' to library map
 - library: name='lib/Resources/qt_menu.nib/classes.nib', 
 - adding 'info.nib' to library map
 - library: name='lib/Resources/qt_menu.nib/info.nib', 
 - adding 'keyedobjects.nib' to library map
 - library: name='lib/Resources/qt_menu.nib/keyedobjects.nib', 
 - plugin path='plugins'
 - using cache directory: '/var/folders/4p/s98fh7114t5g3y05fh59ctpm0000gn/T/QtJambi_b-dahse_x86_64_4.6.3_gcc-20100817-1815'
 - cache directory exists
Loading library: 'libQtCore.4.dylib'...
 - using deployment spec
 - ok!
Loading library: 'libqtjambi.jnilib'...
 - using deployment spec
 - ok!
Loading library: 'libQtCore.4.dylib'...
 - already loaded, skipping...
Loading library: 'libcom_trolltech_qt_core.jnilib'...
 - using deployment spec
 - ok!
Loading library: 'libQtGui.4.dylib'...
 - using deployment spec

	at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(NativeLibraryManager.java:431)
	at com.trolltech.qt.internal.NativeLibraryManager.loadQtLibrary(NativeLibraryManager.java:355)
	at com.trolltech.qt.Utilities.loadQtLibrary(Utilities.java:145)
	at com.trolltech.qt.Utilities.loadQtLibrary(Utilities.java:141)
	at com.trolltech.qt.gui.QtJambi_LibraryInitializer.<clinit>(QtJambi_LibraryInitializer.java:7)
	... 2 more
Caused by: java.lang.UnsatisfiedLinkError: /private/var/folders/4p/s98fh7114t5g3y05fh59ctpm0000gn/T/QtJambi_b-dahse_x86_64_4.6.3_gcc-20100817-1815/lib/libQtGui.4.dylib:  Library not loaded: /opt/local/lib/libpng12.0.dylib   Referenced from: /private/var/folders/4p/s98fh7114t5g3y05fh59ctpm0000gn/T/QtJambi_b-dahse_x86_64_4.6.3_gcc-20100817-1815/lib/libQtGui.4.dylib   Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
	at java.lang.Runtime.load0(Runtime.java:770)
	at java.lang.Runtime.load(Runtime.java:758)
	at com.trolltech.qt.internal.NativeLibraryManager.loadLibrary_helper(NativeLibraryManager.java:458)
	at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(NativeLibraryManager.java:426)
	... 6 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

And I am adding -XstartOnFirstThread to the VM Options field in Properties->Run

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.