Bye NetBeans IDE

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.

Comments:

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.

Posted by Jacek on June 18, 2010 at 07:16 AM PDT #

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.

Posted by Aljoscha Rittner on June 20, 2010 at 05:49 PM PDT #

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

Posted by Martin Wildam on June 20, 2010 at 10:04 PM PDT #

Martin> Yes, mee too!

Posted by NicolasDumoulin on June 21, 2010 at 07:19 PM PDT #

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

Posted by mathieu on November 03, 2011 at 01:09 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
23
24
25
26
27
28
29
30
   
       
Today