Eclipse Build Swing Project

Version 1

    Swing

     

    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 build.properties in this folder by adding the below entries:

     javac.version.source=1.5 javac.version.target=1.7 basedir=/home/openjdk/sources/jdk8_tl/jdk/make/eclipse/swing/ bootstrap.jdk=/home/openjdk/sources/jdk8_tl/build/linux-x86_64-normal-server-release/images/j2sdk-image make.options=\ ARCH_DATA_MODEL=64 \ ZIP_DEBUGINFO_FILES=0 

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

     ant clean build -propertyfile build.properties &> 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/build.properties file:

     Old_Build #PATH to JDK8 bootstrap.jdk=/home/openjdk/sources/jdk8_tl/build/linux-amd64_backup/j2sdk-image basedir=~/sources/jdk8_tl/jdk/make/eclipse/swing/ javac.version.source=1.5 javac.version.target=1.7 
     InfraBuild #PATH to JDK8 bootstrap.jdk=/home/openjdk/sources/jdk8_tl/build/linux-x64-normal-server-release/images/j2sdk-image basedir=~/sources/jdk8_tl/jdk/make/eclipse/swing/ javac.version.source=1.5 javac.version.target=1.7 

    If file already exists check if the contents have the above lines, if not add these lines to the bottom of the build.properties 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:

     swingAntBuild.log 

     

    Build output: artefacts

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