Netbeans Projects For OpenJDK

Version 1

    How to build OpenJDK projects in Netbeans (for Ubuntu 12.04 LTS)

    WARN: As of 11/Aug/2012 I have not tried these detailled instructions yet (Martijn Verburg)

    Hotspot

    For Hotspot there is no NetBeans project. To build Hotspot you can run “make all” command from a Terminal

     cd ~/sources/jdk8_tl/hotspot/make ; make all &> hotspotBuild.log ; 

    or use Eclipse IDE.

    CORBA

    For CORBA project there is no NetBeans project. To build it you can run

     vi ~/.bachrc 

    from a Terminal and append:

     export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-7-openjdk-amd64 

    Then execute

     source ~/.bashrc ; cd ~/sources/jdk8_tl/corba/make ; make all ; 

    The built files that will be imported into the jdk build will be in the ~/sources/jdk8_tl/corba/dist directory.

    JAXP

    To build JAXP project from NetBeans you should:

    1. Run NetBeans. Open jaxp project using File–>Open Project. It is located here

     ~/sources/jdk8_tl/ 

    2. (Optional) Create a file with name “build.properties” at the

     ~/sources/jdk8_tl/jaxp/nbproject/private 

    with following content:

     #PATH to JDK7 bootstrap.jdk=/usr/lib/jvm/java-7-openjdk-amd64 

    3. In jaxp NetBeans project right click on “build.xml” file, then select “Run Target” and click on “dist” target. The built files that will be imported into the jdk build will be in the “~/sources/jdk8_tl/jaxp/dist” directory.

    JAXWS

    To build JAXWS project from NetBeans you should:

    1. Run NetBeans. Open jaxws project using File–>Open Project. It is located here: ~/sources/jdk8_tl/

    2. (Optional) Create a file with name “build.properties” at the

     ~/sources/jdk8_tl/jaxws/nbproject/private 

    with following content:

     #PATH to JDK7 bootstrap.jdk=/usr/lib/jvm/java-7-openjdk-amd64 

    3. In jaxws NetBeans project right click on “build.xml” file, then select “Run Target” and click on “dist” target. The built files that will be imported into the jdk build will be in the “~/sources/jdk8_tl/jaxws/dist” directory.

    Langtools

    To build Langtools project from NetBeans you should:

    1. Run NetBeans. Open langtools project using File–>Open Project. It is located here: ~/sources/jdk8_tl/langtools/make/netbeans

    2. In langtools NetBeans project open “Build files” folder and then “build.properties” file. In this file uncomment line #32 and set

     boot.java.home =/usr/lib/jvm/java-7-openjdk-amd64 

    3. In langtools NetBeans project right click on “build.xml” file, then select “Run Target” and click on “build” target. The built files that will be imported into the jdk build will be in the “~/sources/jdk8_tl/langtools/dist” directory.

    How to build JDK (J2SE)

    NOTE To build this project you should have Hotspot, JAXP, JAXWS, Langtools and CORBA builds.

    To build JDK (J2SE) project from NetBeans you should: 1. Run NetBeans. Open j2se project using File–>Open Project. It is located here: ~/sources/jdk8_tl/jdk/make/netbeans/

    2. Create a file with name “build.properties” at the

     ~/sources/jdk8_tl/jdk/make/netbeans/j2se/nbproject/private 

    with following content:

     bootstrap.jdk=/usr/lib/jvm/java-7-openjdk-amd64 make.options=\ ALT_BOOTDIR=/usr/lib/jvm/java-7-openjdk-amd64 \ ALT_LANGTOOLS_DIST=~/sources/jdk8_tl/langtools/dist \ ALT_CORBA_DIST=~/sources/jdk8_tl/corba/dist \ ALT_JAXP_DIST=~/sources/jdk8_tl/jaxp/dist/ \ ALT_JAXWS_DIST=~/sources/jdk8_tl/jaxws/dist/ \ ALT_HOTSPOT_IMPORT_PATH=~/sources/jdk8_tl/hotspot/build/linux/export-linux-amd64 \ OPENJDK=true 

    3. In jdk (j2se) NetBeans project right click on “build.xml” file, then select “Run Target” and click on “build” target.

    4. Wait near one or two hours

    Swing

    To build Swing from NetBeans you should:

    1. Run NetBeans. Open Swing project using File-->Open Project. It is located here:

    ~/sources/jdk8_tl/jdk/make/netbeans/

    1. Create a file with name build.properties at:
     ~/sources/jdk8_tl/jdk/make/netbeans/swing/nbproject/private 

    with following content:

     #PATH to JDK8 bootstrap.jdk=~/sources/jdk8_tl/build/linux-amd64_backup/j2sdk-image 
    1. Run the Build of Swing project
    2. Wait for 10 min - 1 hour (it depends on performance of your computer)

    JMX

    To build JMX from NetBeans you should:

    1. Run NetBeans. Open JMX project using File-->Open Project. It is located here:

    ~/sources/jdk8_tl/jdk/make/netbeans/

    1. Create a file with name "build.properties" at:
     ~/sources/jdk8_tl/jdk/make/netbeans/jmx/nbproject/private 

    with following content:

     #PATH to JDK8 bootstrap.jdk=~/sources/jdk8_tl/build/linux-amd64_backup/j2sdk-image 
    1. Run the Build of Swing project
    2. Wait for 10 min - 1 hour (it depends on performance of your computer)

    jconsole

    To build JConsole from NetBeans you should:

    1. Run NetBeans. Open JConsole project using File-->Open Project. It is located here:

    ~/sources/jdk8_tl/jdk/make/netbeans/

    1. Create a file with name "build.properties" at:
     ~/sources/jdk8_tl/jdk/make/netbeans/jconsole/nbproject/private 

    with following content:

     #PATH to JDK8 bootstrap.jdk=~/sources/jdk8_tl/build/linux-amd64_backup/j2sdk-image 
    1. Open file:

    ~/sources/jdk8_tl/jdk/make/netbeans/common/shared.xml

    and change values of java source and target to 1.7 in lines 130 and 132.

    Otherwise you will get following errors during build phase:

    error: multi-catch statement is not supported in -source 1.5

    1. Run the Build of JConsole project
    2. Wait for 10 min - 1 hour (it depends on performance of your computer)
    3. Open file:
     ~/sources/jdk8_tl/jdk/make/netbeans/common/shared.xml 

    and return values of java source and target in lines 130 and 132 to their previous values (1.5 and 1.6)