{"id":13644715,"url":"https://github.com/OmixVisualization/qtjambi","last_synced_at":"2025-04-21T10:34:12.683Z","repository":{"id":37841260,"uuid":"42291856","full_name":"OmixVisualization/qtjambi","owner":"OmixVisualization","description":"QtJambi is a wrapper for using Qt in Java.","archived":false,"fork":false,"pushed_at":"2025-04-02T18:56:14.000Z","size":42802,"stargazers_count":407,"open_issues_count":0,"forks_count":43,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-08T11:07:02.039Z","etag":null,"topics":["java","kotlin","language-bindings","qt"],"latest_commit_sha":null,"homepage":"http://www.qtjambi.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmixVisualization.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"OmixVisualization","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2015-09-11T06:33:03.000Z","updated_at":"2025-04-06T17:56:13.000Z","dependencies_parsed_at":"2024-01-12T18:15:01.267Z","dependency_job_id":"4cbd8cbf-c0c4-4184-94cb-4ae81a9c66ca","html_url":"https://github.com/OmixVisualization/qtjambi","commit_stats":{"total_commits":156,"total_committers":2,"mean_commits":78.0,"dds":0.4423076923076923,"last_synced_commit":"34ee3f89d2f452778d035d8f4332f890f9d56f24"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmixVisualization%2Fqtjambi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmixVisualization%2Fqtjambi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmixVisualization%2Fqtjambi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmixVisualization%2Fqtjambi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmixVisualization","download_url":"https://codeload.github.com/OmixVisualization/qtjambi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040708,"owners_count":21365153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","kotlin","language-bindings","qt"],"created_at":"2024-08-02T01:02:11.408Z","updated_at":"2025-04-21T10:34:07.670Z","avatar_url":"https://github.com/OmixVisualization.png","language":"C++","readme":"![QtJambi - Java Bindings for Qt](https://github.com/OmixVisualization/qtjambi/raw/master/www/images/QtJambi_eyecatcher.png \"QtJambi - Java Bindings for Qt\")\r\n\r\n# QtJambi - Java Bindings for Qt\r\n\r\n## Overview\r\n\r\nQtJambi is Qt bindings for the Java programming language originally developed by Trolltech, the predecessor of The Qt Company. \r\nThe successive open source project provides bindings of Qt5 and Qt6 releases for latest Java JDK versions.\r\n\r\nThe bindings are generated by inspection of the C++ header files of the Qt implementation then emitting code to provide the \r\nnecessary JNI (Java Native Interface) and .java files to provide linkage to Java. An application programmer using QtJambi \r\nwould simply add the corresponding Java libraries (.jar files) to their Java project to be able to develop and deploy their application.\r\n\r\n## Availability\r\n\r\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.qtjambi/qtjambi/badge.svg)](https://search.maven.org/artifact/io.qtjambi/qtjambi)\r\n[![Release (latest by date)](https://img.shields.io/github/v/release/OmixVisualization/qtjambi)](https://github.com/OmixVisualization/qtjambi/releases)\r\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/OmixVisualization)](https://github.com/sponsors/OmixVisualization)\r\n\r\nQtJambi is available for Java 8 or 11 and higher using Qt5.15 and Qt6 in Java on Windows, Android Linux and macOS. \r\nMost Qt modules are available as QtJambi module as [listed here](www/Modules.md). All modules are published as Maven Artifact.\r\n**The native components for Windows available on Maven require Qt binaries for MSVC (msvc2019_64). Mingw Qt is not compatible with QtJambi unless you build it from scratch with Mingw.**\r\n**By default, the native components of only essential modules are made available on Maven. Please make a request via [/issues](Issues) if you require native components not yet available.**\r\n\r\n## Support\r\n\r\nQtJambi is an open source project making the power of Qt available for your Java projects free of charge. However, this project is causing ongoing costs. \r\nPlease consider supporting this project by donation. Your support is highly appreciated.\r\n\r\n[Sponsor this project](https://github.com/sponsors/OmixVisualization)\r\n\r\n## How To Build From Sources\r\n\r\nIf you just want to use QtJambi for your application development you can skip these instructions \r\nand simply use the provided binaries from the [list of modules](www/Modules.md).\r\nMake yourself familiar with [developing applications with QtJambi](www/How-to-develop-Qt-in-Java.md).\r\n\r\n### Requirements\r\n* [Apache Ant](https://ant.apache.org/) (min. 1.10.x)\r\n* Java Development Kit (e.g. [OpenJDK](https://adoptopenjdk.net/), tested with Java 1.8, 11 and 21)\r\n* Qt 5.15 or 6.x (using the Qt Online Installer)\r\n* Minimum required Qt modules: QtCore, QtQml, QtNetwork, QtConcurrent and QtXml\r\n* C++ compiler and make (Gcc, Clang, MSVC2022)\r\n* XCode command line tools (macOS only)\r\n\r\nWhen building for Android all required SDK and NDK components are downloaded automatically.\r\nQtJambi build system has been tested on Linux (Ubuntu x64 and arm64, OpenSUSE x64, Fedora x64), Windows (with MSVC2022 for x64 and amd64), macOS (x64 and amd64) and FreeBSD (x64).\r\n\r\n### Building QtJambi\r\n\r\nIf you don't need the entire set of Qt modules available in Java edit property `qtjambi.skipped.modules` in `build.properties` and exclude Qt modules you don't need.\r\nThis saves compilation time. Although QtJambi build process requires the availability of QtQml, QtNetwork, QtConcurrent and QtXml, you can skip them from being generated as QtJambi module.\r\n\r\nOn Windows open the Visual Studio command prompt for x64 architecture (to be found in: --\u003e Start Menu --\u003e Programs --\u003e Visual Studio 2022 --\u003e Visual Studio Tools --\u003e VC).\r\nOn Linux, macOS or if you intend to use Mingw instead of MSVC open a plain terminal.\r\n\r\nChange to directory of your QtJambi clone.\r\n\r\nAdd Apache Ant to your `PATH` variable for easy access:\r\n\r\n`\u003e set PATH=\u003cpath to..\u003e\\apache-ant\\bin;%PATH%`\r\n\r\nIf the command line does not find the program `java` by default or if you intend to use specific Java installation add this variable:\r\n\r\n`\u003e set JAVA_HOME_TARGET=path to your java jdk`\r\n\r\nStart the build process by following command:\r\n\r\n`\u003e ant all`\r\n\r\n(This step may take several hours.)\r\n\r\nQtJambi's build process will automatically detect installed Qt:\r\n\r\n* On Windows it expects Qt to be installed in `C:\\Qt`.\r\n\r\n* On Linux and macOS it searches for Qt installation in `/opt/Qt`.\r\n\r\n* On macOS it additionally searches in `/Library/Qt` and `/System/Qt`.\r\n\r\nIf Qt has not been found at these locations the build process searches in the user's home directory and in QtJambi's parent directory for Qt installation.\r\n\r\nIf a Qt installation has been found the build process starts building QtJambi for all Qt versions available.\r\n\r\nIf no Qt installation has been found the build process tries to detect `qmake` executable (on Linux additionally `qmake-qt5`/`qmake-qt6`).\r\n\r\nThe generated QtJambi version is based upon the Qt version linked against. Be aware that the patch version number (third) is not necessarily the same for Qt and QtJambi.\r\n\r\nFinally, find all Java libraries in directory `\u003cqtjambiversion\u003e/deployment` and native bundles in `\u003cqtjambiversion\u003e/deployment/native`. Additionally, the platform-dependent libraries can be found in `\u003cqtjambiversion\u003e/deployment/platforms`.\r\n\r\n#### Additional Options\r\n\r\nYou can call ant with additional properties as listed below. Therefore use the `-D` command line argument: `ant -Dkey=value all`.\r\n\r\n* `qt` - specify comma-separated Qt versions to be used, e.g. `-Dqt=\"6.5,6.7\"`.\r\n* `qtbase` - specify Qt installer's base directory, e.g. `-Dqtbase=/var/Qt`. Can be combined with `qt`.\r\n* `qtdir` - specify Qt version and platform directory, e.g. `-Dqtdir=/var/Qt/6.5.3/macos`. This option allows multiple directories separated by path separator. (If this option is specified `qt` and `qtbase` have no effect.)\r\n* `qmake` - specify a path to a `qmake` program to be used for building QtJambi. (If this option is specified `qt`, `qtbase` and `qtdir` have no effect.)\r\n* `android` - specify `true` to build QtJambi for Android. Therefore, Qt for Android has to be installed. By specify `-Dandroid=only` ant skips building QtJambi for the build platform. When compiling for Android all required NDK and SDK components are downloaded automatically. Alternatively, specify the Android NDK install path with `-Dndk=...`.\r\n\r\nAll these properties could also be placed in `build.properties` file.\r\n\r\nAlternatively, ant reads following environment variables:\r\n\r\n* `QTVERSIONS` - may soecify comma-separated Qt versions to be used\r\n* `QTBASE` - may specify Qt installer's base directory\r\n* `QTDIR` - may specify Qt version and platform directory\r\n* `ANDROID_NDK` - path to installed Android NDK\r\n\r\n#### Unit Tests\r\n\r\nOptionally, you could create and run unit tests:\r\n\r\n`\u003e ant tests.generate tests.run`\r\n\r\nFind unit test results in directory `TestResults`.\r\n\r\n#### Cross-Compilation\r\n\r\nAfter building QtJambi for the running operation system you can additionally cross-compile QtJambi for other platforms.\r\nFor instance if you want to build for Linux arm:\r\n\r\n`\u003e ant -Dqmake=/opt/Qt/6.5.3/arm-gnueabi/bin/qmake library.native`\r\n\r\nJust specify the third-platform cross-compiled qmake with `-Dqmake=path`.\r\n\r\nIf you are using Qt from Qt installer located at default installation path (e.g. `C:\\Qt`)\r\nand Android binaries are installed you can simply use the `-Dandroid=true` argument to \r\nbuild Qtjambi for Android along with the platform-soecific binaries:\r\n\r\n`\u003e ant -Dandroid=true all`\r\n\r\n## How To Use QtJambi\r\n\r\n### Example\r\n\r\nAdd **qtjambi-VERSION.jar** to the classpath of your Java project containing the most \r\nessential Qt Core, Gui and Widgets modules. If you use Maven to build your application simply add following dependency\r\nto your project:\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003eio.qtjambi\u003c/groupId\u003e\r\n  \u003cartifactId\u003eqtjambi\u003c/artifactId\u003e\r\n  \u003cversion\u003e$VERSION\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n(exchange `$VERSION` either by `6.5.8` or by `6.7.2`).\r\n\r\nOtherwise, download QtJambi JAR file from [Maven Central Repository](https://search.maven.org/artifact/io.qtjambi/qtjambi/).\r\n\r\nCreate a file **Test.java** containing the following code:\r\n\r\n```java\r\nimport io.qt.widgets.*;\r\npublic class Test {\r\n    public static void main(String[] args) {\r\n        QApplication.initialize(args);\r\n        QMessageBox.information(null, \"QtJambi\", \"Hello World!\");\r\n        QApplication.shutdown();\r\n    }\r\n}\r\n```\r\n\r\nCompile the file:\r\n\r\n``` powershell\r\njavac -cp qtjambi-6.5.8.jar Test.java\r\n```\r\n\r\n### Execute Example\r\n\r\nFor execution you need the platform dependent binaries of QtJambi either as self-extracting bundle or as library file (e.b. dll). \r\nFor instance, if you are working on Windows download **qtjambi-native-windows-x64-VERSION.jar**\r\nfrom [Maven Central Repository](https://search.maven.org/artifact/io.qtjambi/qtjambi-native-windows-x64/) and add it to java class path. \r\n\r\nAdditionally, you need *Qt*. Use the [Qt installer](https://www.qt.io/download-qt-installer) to install Qt on your system. Make sure you are using the same Qt version and QtJambi version (the first and second version digit needs to be the same).\r\nWhen using Maven artifacts for Windows you need to select MSVC 2019 64-Bit (msvc2019_64), as they are not compatible with Mingw Qt.\r\n\r\nWhen running a QtJambi application you have to make the locations of Qt libraries known to Java.\r\nTherefore, use the `PATH` environment (`LD_LIBRARY_PATH` on Linux, `DYLD_FRAMEWORK_PATH` on macOS) \r\nor the Java runtime property `java.library.path`. \r\nBy default, on Windows Qt libraries are located in `bin` directory and on Linux and macOS in `lib` directory.\r\n\r\nThe example program can be executed this way on Windows:\r\n``` powershell\r\njava -cp qtjambi-6.5.8.jar;. -Djava.library.path=C:\\Qt\\6.5.3\\msvc2019_64\\bin Test\r\n```\r\nOn Linux it looks this way:\r\n``` bash\r\njava -cp qtjambi-6.5.8.jar:. -Djava.library.path=\u003cpath to\u003e/Qt/6.5.3/gcc_64/lib Test\r\n```\r\nOn macOS you additionally need to use the start parameter `-XstartOnFirstThread`:\r\n``` bash\r\njava -cp qtjambi-6.5.8.jar:. -Djava.library.path=\u003cpath to\u003e/Qt/6.5.3/macos/lib -XstartOnFirstThread Test\r\n```\r\n\r\nOn Linux of your distribution provides Qt (of correct version) as system library you don't need to specify library path at all.\r\nHowever, since Maven-published binaries for Linux have been built with Qt from installer they might be incompatible to your system-specific Qt.\r\nIn this case it is recommended to build QtJambi on your Linux system by using the installed `qmake` or install Qt by using Qt installer.\r\n\r\nIf the example fails with a `UnsatisfiedLinkError` QtJambi libraries and Qt libraries seem to be incompatible.\r\n[Read here about library requirements and compatibility.](www/Modules.md)\r\n\r\nIn general, you can start learning how to use Qt in Java [as it is introduced for C++](https://doc.qt.io/qt-6/gettingstarted.html#create-your-first-applications). \r\nThere are a couple of specifics for QtJambi that are [introduced here](/www/Characteristics-of-QtJambi.md). \r\nInstead of starting your program with a java command as shown above you can deploy your application as executable as [described here](/www/How-to-deploy-QtJambi-applications.md).\r\n\r\n## Licenses\r\n\r\n```\r\n            GNU LESSER GENERAL PUBLIC LICENSE\r\n\r\n QtJambi is Copyright (C) 1992-2009 Nokia. All rights reserved.\r\n            Copyright (C) 2009-2024 Dr. Peter Droste, \r\n                                    Omix Visualization GmbH \u0026 Co. KG. \r\n                                    All rights reserved.\r\n\r\n You may use, distribute and copy QtJambi under the terms of\r\n [GNU Lesser General Public License version 2.1](LICENSE.LGPLv21).\r\n```\r\n\r\n```\r\n            GNU GENERAL PUBLIC LICENSE\r\n\r\n QtJambi is Copyright (C) 1992-2009 Nokia. All rights reserved.\r\n            Copyright (C) 2009-2024 Dr. Peter Droste, \r\n                                    Omix Visualization GmbH \u0026 Co. KG. \r\n                                    All rights reserved.\r\n\r\n You may use, distribute and copy QtJambi under the terms of\r\n GNU Lesser General Public License version 3. That license references\r\n the [General Public License version 3](LICENSE.GPLv3). Other\r\n portions of the QtJambi may be licensed directly under this license.\r\n```\r\n\r\n\r\n## Further Reading\r\n\r\n* [QtJambi modules](www/Modules.md)\r\n* [What's new in QtJambi](www/Whats-New.md)\r\n* [How to develop with QtJambi](www/How-to-develop-Qt-in-Java.md)\r\n* [How to Create Android Apps](www/Android.md)\r\n* [Characteristics of QtJambi](www/Characteristics-of-QtJambi.md)\r\n* [How to deploy QtJambi applications](www/How-to-deploy-QtJambi-applications.md)\r\n* [How to bundle Qt](www/How-to-bundle-Qt-libraries.md)\r\n* [How to debug QtJambi applications](www/How-to-debug.md)\r\n* [QtJambi API Reference Documentation](https://doc.qtjambi.io/latest)\r\n","funding_links":["https://github.com/sponsors/OmixVisualization"],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOmixVisualization%2Fqtjambi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOmixVisualization%2Fqtjambi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOmixVisualization%2Fqtjambi/lists"}