-
-
Notifications
You must be signed in to change notification settings - Fork 42
How to build QtJambi
QtJambi is an open-source project that provides Java language bindings to the Qt APIs. The bindings are generated by inspection of the C++ header files of the Qt implementation then emitting code to provide the necessary JNI (Java Native Interface) and .java files to provide linkage to Java. An application programmer using Qt Jambi would simply add the coresponding Java libraries (.jar files) to their Java project to be able to develop and deploy their application.
Below is described how to build QtJambi binaries from source. If you just want to use QtJambi for your application development you can skip this page and simply use the binaries from the releases. QtJambi is available for Qt5.15, Qt6.0 and Qt6.1. Make yourself familiar with developing applications with QtJambi.
- Apache Ant (min. 1.10.x)
- Java Development Kit (e.g. OpenJDK, tested with Java 1.8 and 14)
- Qt 5.15 or 6.x (using the Qt Online Installer)
- C++ compiler (XCode, Clang, MinGW, MSVC2019)
- chrpath (Linux only)
Edit property qtjambi.skipped.modules
in build.properties
to exclude Qt modules you don't need to generate.
- Open the Visual Studio command prompt for x64 architecture.
to be found in: --> Start Menu --> Programs --> Visual Studio 2019 --> Visual Studio Tools --> VC
(Alternatively, open a command prompt and set path to MinGW.)
-
Change to directory of your QtJambi clone
-
Set paths:
> set JAVA_HOME_TARGET=path to your java jdk
> set PATH=...\apache-ant-1.10.3\bin;%PATH%
> set QTDIR=C:\Qt\6.0.0\msvc2019_64
-
Open a shell and change to directory of your QtJambi clone
-
Set paths:
> export JAVA_HOME_TARGET=path to your java jdk
> export QTDIR=/opt/Qt/5.15.0/gcc_64
- build QtJambi:
> ant all
(This step may take several hours.)
- optionally, create and run unit tests:
> ant tests.generate tests.run
-
Find unit test results here:
build/tests/TestResults-release
andbuild/tests/TestResults-debug
. -
Finally, find all Java libraries in directory
deployment
and all native libraries in the platform, compiler and configuration specific subdirectory, e.g.win64/msvc2019x64/release
.
If you want to build Java binaries for JDK 1.8 initially set path to a coresponding JDK in addition to a JDK 11 or higher:
> set JAVA8_HOME_TARGET=path to your java jdk 1.8
or
> export JAVA8_HOME_TARGET=path to your java jdk 1.8
Following Qt5 modules are available in QtJambi:
- QtCore, QtGui, QtWidgets and Platform Headers in qtjambi-5.15.jar
- QtMultimedia and QtMultimediaWidgets in qtjambi-multimedia-5.15.jar
- QtNetwork in qtjambi-network-5.15.jar
- QtQml in qtjambi-qml-5.15.jar
- QtQuick in qtjambi-quick-5.15.jar
- QtQuickControls2 in qtjambi-quickcontrols-5.15.jar
- QtSql in qtjambi-sql-5.15.jar
- QtTest in qtjambi-test-5.15.jar
- QtBluetooth in qtjambi-bluetooth-5.15.jar
- QtConcurrent in qtjambi-concurrent-5.15.jar
- QtDBus in qtjambi-dbus-5.15.jar
- QtGamepad in qtjambi-gamepad-5.15.jar
- QtHelp in qtjambi-help-5.15.jar
- QtLocation in qtjambi-location-5.15.jar
- QtNfc in qtjambi-nfc-5.15.jar
- QtNetworkAuth in qtjambi-networkauth-5.15.jar
- QtPositioning in qtjambi-positioning-5.15.jar
- QtPrintSupport in qtjambi-printsupport-5.15.jar
- QtQuickWidgets in qtjambi-quickwidgets-5.15.jar
- QtRemoteObjects in qtjambi-remoteobjects-5.15.jar
- QtScript in qtjambi-script-5.15.jar
- QtScriptTools in qtjambi-scripttools-5.15.jar
- QtScxml in qtjambi-scxml-5.15.jar
- QtSensors in qtjambi-sensors-5.15.jar
- QtSerialBus in qtjambi-serialbus-5.15.jar
- QtSerialPort in qtjambi-serialport-5.15.jar
- QtSvg in qtjambi-svg-5.15.jar
- QtTextToSpeech in qtjambi-texttospeech-5.15.jar
- QtWebChannel in qtjambi-webchannel-5.15.jar
- QtWebEngine in qtjambi-webengine-5.15.jar
- QtWebEngineCore in qtjambi-webenginecore-5.15.jar
- QtWebEngineWidgets in qtjambi-webenginewidgets-5.15.jar
- QtWebSockets in qtjambi-websockets-5.15.jar
- QtWebView in qtjambi-webview-5.15.jar
- QtXml in qtjambi-xml-5.15.jar
- QtXmlPatterns in qtjambi-xmlpatterns-5.15.jar
- QtCharts in qtjambi-charts-5.15.jar
- QtDataVisualization in qtjambi-datavisualization-5.15.jar
- QtQuick3D in qtjambi-quick3d-5.15.jar
- QtDesigner in qtjambi-designer-5.15.jar
- QtMacExtras in qtjambi-macextras-5.15.jar
- QtWinExtras in qtjambi-winextras-5.15.jar
- QtX11Extras in qtjambi-x11extras-5.15.jar
- Qt3DCore in qtjambi-qt3dcore-5.15.jar
- Qt3DRender in qtjambi-qt3drender-5.15.jar
- Qt3DAnimation in qtjambi-qt3danimation-5.15.jar
- Qt3DExtras in qtjambi-qt3dextras-5.15.jar
- Qt3DInput in qtjambi-qt3dinput-5.15.jar
- Qt3DLogic in qtjambi-qt3dlogic-5.15.jar
- Qt3DQuick in qtjambi-qt3dquick-5.15.jar
- Qt3DQuickExtras in qtjambi-qt3dquickextras-5.15.jar
- Qt3DQuickScene3D in qtjambi-qt3dquickscene2d-5.15.jar
Following Qt6 modules are available in QtJambi:
- QtCore, QtGui and QtWidgets in qtjambi-6.0.jar
- QtDBus in qtjambi-dbus-6.0.jar
- QtNetwork in qtjambi-network-6.0.jar
- QtQml in qtjambi-qml-6.0.jar
- QtQuick in qtjambi-quick-6.0.jar
- QtQuickControls2 in qtjambi-quickcontrols-6.0.jar
- QtTest in qtjambi-test-6.0.jar
- QtConcurrent in qtjambi-concurrent-6.0.jar
- QtHelp in qtjambi-help-6.0.jar
- QtOpenGL in qtjambi-opengl-6.0.jar
- QtOpenGLWidgets in qtjambi-openglwidgets-6.0.jar
- QtPrintSupport in qtjambi-printsupport-6.0.jar
- QtQuick3D in qtjambi-quick3d-6.0.jar
- QtQuickWidgets in qtjambi-quickwidgets-6.0.jar
- QtSql in qtjambi-sql-6.0.jar
- QtSvg in qtjambi-svg-6.0.jar
- QtUITools in qtjambi-uitools-6.0.jar
- QtXml in qtjambi-xml-6.0.jar
- QtNetworkAuth in qtjambi-networkauth-6.0.jar
- QtDesigner in qtjambi-designer-6.0.jar
- Qt3DCore in qtjambi-qt3dcore-6.0.jar
- Qt3DRender in qtjambi-qt3drender-6.0.jar
- Qt3DAnimation in qtjambi-qt3danimation-6.0.jar
- Qt3DExtras in qtjambi-qt3dextras-6.0.jar
- Qt3DInput in qtjambi-qt3dinput-6.0.jar
- Qt3DLogic in qtjambi-qt3dlogic-6.0.jar
- Qt3DQuick in qtjambi-qt3dquick-6.0.jar
- Qt3DQuickExtras in qtjambi-qt3dquickextras-6.0.jar
- Qt3DQuickScene3D in qtjambi-qt3dquickscene2d-6.0.jar