This Tutorial is currently being written. Please come back later for a final version.

Contents

Goals

  • learn how to set up the required environment for creating standalone MT4j applications
  • learn how to create stand alone executable .jar files for platform independent distributions
  • learn how to create a standalone Windows application with an .exe from a MT4j project

Required Environment

  • Eclipse IDE
  • FatJar Eclipse PlugIn
  • JSmooth .exe Wrapper


Download and install FatJar Eclipse Plugin

FatJar is a Plugin for the Eclipse Java IDE which bundles a complete java application (including all required libraries) into one java archive file (.jar file).

Download Fat Jar Plugin here. Unzip the downloaded Fat Jar zip file and copy the content of the zip file's plugin folder into eclipse at [YourEclipseLocation]/plugins. After copying the jar file, close your eclipse (if running). Start eclipse with option -clean from the command line:

eclipse -clean

Otherwise, Eclipse will not find the Fat Jar Plugin. This has to be performed only once after installation. If installation was successful, a "Build Fat Jar" item should appear in the context menu, when you right click on your MT4j project:

image:ExportTutorial-CreateFatJar01.png

Download and install JSmooth .exe Wrapper

Download and install http://jsmooth.sourceforge.net/download.php. Follow installation instructions of JSmooth.

Bunlde application and libraries with Fat Jar plugin

To create an executable .jar file, we right click on the MT4j project in eclipse and click on the "Build Fat Jar" item in the context menu. The next step is to choose the main class that shall be run when executing the .jar file. In this example, we select the TouchTail example from the examples included in MT4j. Then, we create a folder with the name "distribution" and select it as export target by changing Jar-Name to "distribution\TouchTails.jar". For further information on Fat Jar, you can have a look at the Fat Jar Tutorial.

image:ExportTutorial-CreateFatJar02_config.png

After that we click finish and the file TouchTails.jar is created in the distribution folder by the Fat Jar Plugin. Now, we copy all files from our MT4j folder to our distribution folder. This includes required files like .dlls or the MT4j settings in Settings.txt.

image:ExportTutorial-CopyRequiredFiles.png

Create a windows executable with JSmooth

Having bundled all libraries and our MT4j application in one jar file makes it much easier to configure JSmooth.

image:ExportTutorial-JSmooth01.png

image:ExportTutorial-JSmooth02.png

image:ExportTutorial-JSmooth03.png

image:ExportTutorial-JSmooth04.png

image:ExportTutorial-JSmooth05.png

Powered by MediaWiki contact