Menu

Compiling the source

Willem3141 Thom Castermans

Before you can compile the code, you must first get it. See [Downloading the source].

The code is divided in two parts.

  • src contains the actual source code of the look and feel.
  • test contains some utilities for testing. For example the test GUI resides in this folder. If you are compiling Joxy, you can drop this folder if you don't need these utilities.

To compile, you will of course need the Java Development Kit. We test Joxy with the OpenJDK version 6 and 7. For example, for Debian or Ubuntu,

$ apt-get install openjdk-6-jdk

or

$ apt-get install openjdk-7-jdk

You can compile Joxy with javac, or you can import the source code in your favourite IDE. Compilation should be easy, because there are no dependencies except for the core Java libraries (and JUnit if you are compiling the test folder too). To create a JAR file for Joxy, you can use the jar command.

Remark: If you do not want to use (or compile) the native text rendering, you should set in joxy.utils.JoxyGraphics the value of NATIVE_TEXT_RENDERING to false. Else, you will get errors because the shared library cannot be found. (Current Joxy versions check for this, however, and just start using Java text rendering.)

To test your compiled code, you can start test.TestGUI. That will launch some GUI that will load Joxy and display some of the many Java components. (This only works if you have compiled the test folder.)

Native text rendering

Remark: native text rendering is only included since Joxy 0.0.3. It was not yet available in Joxy 0.0.2 or earlier.

To use native text rendering, you will also have to compile the C++ code in the src folder to a shared library (a *.so file). This can be done using gcc. To this end, we have created a little script, compile.sh, in the src-folder. The aim of this script is to assist you and make it as easy as possible to enable native text rendering. We are still working on this, so please, if you have suggestions or noted a bug, report this via the section Discussion above.

An example of how to compile the shared library (we suppose the current working directory is the root of the git repository):

$ cd src/
$ ./compile.sh
compile.sh: [II] JAVA_HOME='/usr/lib/jvm/java-7-openjdk-amd64'
compile.sh: [II] Now compiling...
compile.sh: [II] Done. File 'libnativeTextRenderer.so' created.
compile.sh: [II] You should move this file to the Java library path.
Currently, the following directories are present in your Java library path:
- /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server
- /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64
- /usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64
- /usr/java/packages/lib/amd64
- /usr/lib/x86_64-linux-gnu/jni
- /lib/x86_64-linux-gnu
- /usr/lib/x86_64-linux-gnu
- /usr/lib/jni
- /lib
- /usr/lib
You should pick one of these folders to move the shared library to.
$ su -
Password: enter password
root$ cd /usr/lib/jni
root$ mv *[location Joxy git-repository root]/src/libnativeTextRenderer.so .
root$ quit
$

Then, in joxy.utils.JoxyGraphics, change the value of NATIVE_TEXT_RENDERING to true (in the Git-repository, this is true by default, so you probably do not have to change this).

Troubleshooting

If you encounter problems in the compilation process, please make note of them in our forum (the section Discussion above). You can always switch native text rendering off by setting NATIVE_TEXT_RENDERING in joxy.utils.JoxyGraphics to false.

You can now move on to [Using Joxy].


Related

Wiki: Downloading the source
Wiki: Questions and answers
Wiki: Using Joxy - Arch
Wiki: Using Joxy - Chakra
Wiki: Using Joxy - Debian
Wiki: Using Joxy - Other OS
Wiki: Using Joxy - Other
Wiki: Using Joxy

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.