Skip to main content
Last updated January 09, 2013 00:14, by neomatrix369


Building via CLI

To build Swing via the command-line interface (Old Build)* perform the below actions:

Ensure both 'ant 1.8' or higher and 'gawk 4.0.1' or higher are installed under Ubuntu by performing the below commands:

 sudo apt-get install ant
 sudo apt-get install gawk

Go to the folder where the Swing build files are:

 cd ~/sources//jdk8_tl/jdk/make/eclipse/swing

Change the in this folder by adding the below entries:

       ARCH_DATA_MODEL=64 \

Perform the below action at the command prompt to start the ant build.

 ant clean build -propertyfile &> swingAntBuild.log

*Note: at the time of the writing of these instructions JMX could only be built using the Old Build system, ant build and make files for the build-infra system are not yet available.

Configurating and building in Eclipse

Before importing any project make the following amendments

Insert the below lines to the ~/sources/jdk8_tl/jdk/make/eclipse/swing/ file:

 #PATH to JDK8
 #PATH to JDK8

If file already exists check if the contents have the above lines, if not add these lines to the bottom of the file.

Run Eclipse and do the below:

Import a project using the Import a project from existing Ant BuildFile option from New > Project > Other, click on Browse, go to the ~/sources/jdk8_tl/jdk/make/eclipse/swing folder and select build.xml.

Once the build file is loaded, select the ‘Link to buildfile in the file system’ option. The project gets loaded as expected and gets the name defined in the script.

Open the build.xml properties by selecting the file, and selecting the Run As > Build Ant… option from the menu. Set the Target to “shared-clean, build” by selecting shared-clean from the list of targets and changing the order using the Order button.

Run the Build of Swing project by selecting the build.xml file and right mouse click on the Run as > Ant build option.

Observe the messages in the Console tab in Eclipse and wait for sometime till the build is complete (depends on performance of your computer).

Build messages: logs

- A successful run of the ant build results in the output of the following log messages:


Build output: artefacts

The general Swing build artefact can be found at ~/sources/jdk8_tl/jdk/dist/lib/swing.jar

Next Step

Back to How to build the Swing project in Eclipse

Please Confirm