X

Geertjan's Blog

  • June 18, 2010

Bye NetBeans IDE

Geertjan Wielenga
Product Manager
It's high time and long overdue, yet here are instructions on how to get started using the NetBeans Platform... without using NetBeans IDE.

  1. Download the NetBeans Platform. Go here, download it, and unzip into a folder:

    http://netbeans.org/downloads/start.html?filename=zip/moduleclusters/netbeans-6.9-201006101454-ml-platform.zip

  2. Download the NetBeans Platform Build Harness. Into the same folder where you downloaded the above, unzip this:

    http://netbeans.org/downloads/start.html?filename=zip/moduleclusters/netbeans-6.9-201006101454-ml-harness.zip

    You now have the NetBeans Platform as well as its build harness. Let's start using it.

  3. Set Up a Project. In a different folder to where the above two have been unzipped, create a folder named "DemoApp". Inside "DemoApp", create a folder called "nbproject" (so that you'll be able to open the project, sometime in the future when you might want to do so, into NetBeans IDE). Inside the 'nbproject' folder you only need to put three files:

    project.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.apisupport.project.suite</type>
    <configuration>
    <data xmlns="http://www.netbeans.org/ns/nb-module-suite-project/1">
    <name>DemoApp</name>
    </data>
    </configuration>
    </project>

    platform.properties

    nbplatform.active.dir=/home/geertjan/projects/platform-zip/
    harness.dir=${nbplatform.active.dir}/harness
    cluster.path=${nbplatform.active.dir}/platform
    disabled.modules=
    app.name=demoapp
    branding.token=${app.name}
    modules=

    The 'nbplatform.active.dir' above points to the folder where I unzipped the two downloads into.

    build-impl.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="DemoApp-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
    <property file="nbproject/platform.properties"/>
    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
    <attribute name="name"/>
    <attribute name="value"/>
    <sequential>
    <property name="@{name}" value="${@{value}}"/>
    </sequential>
    </macrodef>
    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
    <attribute name="property"/>
    <attribute name="value"/>
    <sequential>
    <property name="@{property}" value="@{value}"/>
    </sequential>
    </macrodef>
    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
    <import file="${harness.dir}/suite.xml"/>
    </project>

    The above files, within the 'nbproject' folder, are all that's needed to hook the 'platform' and 'harness' downloads into your project.

  4. Add a Build Script. On the same level as the 'nbproject' folder, i.e., the root directory, add your build.xml file. A starting point would be as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="DemoApp" basedir=".">
    <description>Builds the module suite DemoApp.</description>
    <import file="nbproject/build-impl.xml"/>
    </project>

That's it. Go to the project's root directory and do 'ant run'. The NetBeans Platform will start up and you'll see the main window. When troubleshooting the above scenario, make sure the 'platform' and 'harness' folders are really in a different folder to where the 'DemoApp' is in, e.g., 'home/nbplatform/platform' and 'home/nbplatform/harness', with 'home/mywork/DemoApp' is what is needed.

Next time, we'll look at how to add a module to the application.

Join the discussion

Comments ( 6 )
  • Dmitry Lipin Friday, June 18, 2010
  • Jacek Friday, June 18, 2010

    Is there a way this could be accomplished via a Maven archetype instead (no Ant build.xml)?

    We use Maven as our build system, which is one of the main reasons we're not tied to a particular IDE going forward.


  • Aljoscha Rittner Monday, June 21, 2010

    Hi Jacek!

    Yes, the NetBeans platform is available as maven artifacts. I build my rcp projects with maven and hudson (in conjunction with artifactory).

    br, josh.


  • Martin Wildam Monday, June 21, 2010

    That post title was too shocking for me. Please be careful - you could cause heart attacks...


  • NicolasDumoulin Tuesday, June 22, 2010

    Martin> Yes, mee too!


  • mathieu Thursday, November 3, 2011

    Thanks, that was really useful!

    I found a way for having the nbplatform folder in the project folder and not to have to put an absolute path as active dir. Simply add this at the top of your build.xml file:

    <property name="nbplatform.active.dir" value="${basedir}/nbplatform" />

    And set your platform.properties like this:

    nbplatform.active.dir=${suite.dir}/nbplatform

    harness.dir=${nbplatform.active.dir}/harness

    cluster.path=${nbplatform.active.dir}/platform


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.