There is two ways to compile Jambi, depending of environment where you work. For Windows and maybe Mac OS X, easiest way is to use downloaded Qt, where on Linux often there is Qt provided by distribution of user, in which case compiling Jambi against system Qt is viable option.
There is an environment variable which is useful across platforms, that is MAKEOPTS.
So for example on Linux you could run
env MAKEOPTS="-j8" ant all in order to fully build Jambi.
Download links and repository url can be found at Downloads section.
Jambi depends of Java and Qt, and building also depends on . For Java any version after 1.5 should work. For Qt any version from 4.0 up to latest 4.x release should work. For Ant version 1.8 or later is needed.
For Windows, it may be useful to set JAVA_HOME to point your JDK’s root directory, and if not already present,
%JAVA_HOME%\bin to PATH.
Using official Qt packages
If you want to use official Qt packages or Qt compiled from source, you need to use QTDIR based solution. Windows is used as example platform.
Maybe easiest way is to download Qt SDK and use its MinGW to build Jambi. If you want to use other package of Qt or your self-built Qt, please note that compiler version must match for both MinGW and MSVC packages. That is, if your Qt is compiled with MinGW 4.4, your Jambi must be compiled with MinGW 4.4 too!
You need to set a few environment variables for this:
- QTDIR: points to the base directory of Qt (TODO: where this is in the SDK?)
- PATH: must contain QTDIR/bin in itself, before other paths that contains Qt tools.
- LD_LIBRARY_PATH: contains the directory which has Qt libraries. Used at linking stage; Good guess for the value is $QTDIR/lib (On Windows this doesn't need to be set).
Then you should configure build.properties. For most, qtjambi.configuration should
release. Then uncomment correct row of generator.includepaths. Since you are
using QTDIR, qtjambi.* library properties does not need to be set. Also rest can be left
Then you’re ready to compile:
Using system Qt
When you are on Linux or otherwise have some kind of special Qt setup, you may want to consider building Jambi against Qt preexisting in your system. This way you could build a package that could be more easily deployed across separate instances of your distriction, too, without that package being cluttered by extra dependencies that are already available in the system.
For this kind of building, it’s important to check that QTDIR environment variable is not set. If it is, paths are going to picked from there, which most of time will render to compilation errors.
- qtjambi.qt.libdir should point to the directory where the Qt libraries
libQtCore.so) is. For me it is
- qtjambi.qt.includedir should point to the root directory where Qt includes are. For example
/usr/include/qt4, in it there should be
QtGui, .. directories.
- qtjambi.qt.pluginsdir should point to the directory where Qt's plugins are. Most often they are at the same place as qtjambi.qt.libdir.
There is also some Phonon specific paths. These allow compiling against KDE phonon, and it seems
certain distros even have Qt phonon in random places. These settings are unnecessary unless your
system has KDE phonon and should qtjambi.phonon.kdephonon be set to
Then you’re ready to compile:
Building Qt on Windows
If you are compiling Qt for MSVC compiler by yourself, you should configure Qt with following command:
C:\Qt\qt-everywhere-opensource-src-4.7.1>configure -no-qt3support -release -shared -fast -nomake demos -nomake examples -nomake docs -DQT_JAMBI_BUILD -plugin-manifests
The noteworthy part is
After it has configured itself, just follow instructions of the configure process to compile Qt. While waiting Qt to compile itself, you can go to lunch, party, whatever you want to do while Qt is compiling itself. It takes a lot of time.
After compilation is done, return to section above this one.
Mac OS X
OSX building guide can be found from Redmine wiki.
Testing the packages
Often you want to test the packages, to see if they work. It is optional though, giving untested packages for end users to test seems to be the trend. You can do it by launching the examples.
In Linux you can just run qtjambi.sh which is in the dist/linux directory.
In Windows you can either build the package, install it, and then run the examples, or just run
java -cp "qtjambi.jar;qtjambi-win32-msvc2008-4.7.1.jar;qtjambi-util-4.7.1.jar;qtjambi-examples.jar" com.trolltech.launcher.Launcher.
This method works for Linux too. Note the ";" must be changed to ":". For 64-bit Linux, that would be
java -cp "qtjambi-4.7.1.jar:qtjambi-linux64-gcc-4.7.1.jar:qtjambi-util-4.7.1.jar:qtjambi-examples-4.7.1.jar:qtjambi-designer-4.7.1.jar" com.trolltech.launcher.Launcher
Note: (possible) line break is not intended, after : there is no space or newline.
For more rigorous testing, you can also run our test suite. For fully running all tests, you should adjust your build.properties, to have test related
settings enabled and debug mode build. Tests can then be compiled and ran with
ant all tests.compile tests.run.