Netbeans and a subset of a JDK workspace

Brad Wetmore Bradford.Wetmore at Sun.COM
Wed Oct 8 18:28:13 PDT 2008


I'd recently drunk a bit (lot?) of the netbeans 6.1 Kool-Aid.  Wow, what 
an improvement over 4.1.  I swore that I'd rather die using vi after 
that initial netbeans experience, but here I am!  ;)

If I open the "jdk/make/netbeans/j2se" project, I might as well walk 
away and have lunch.  The internal indexing/compiling of the entire j2se 
project simply takes forever on my relatively fast machine, with the 
majority of the time being in the internal compilation.  I'd really like 
to just limit the sources to specific code of interest (core libs, 
networking, security).  (What's this Swing thing I hear people talk 
about...  ;) )

A big optimization that seems to be working for me is the following:

0)   Install netbeans 6.1

1)   Clone/build (using gnumake) a jdk workspace (say JSN) as usual.

2)   Go to Tools->Java platforms.

      Add the built platform but do not include links to the sources.
      Call this "jsn-gate:  no sources"  We'll set the source
      locations in the project in the next step.

3)   Create a new project from existing sources (jdk/src/shared,
      jdk/src/solaris, etc).  Include only the JDK
      sources I care about (core libs, networking, security),
      everything else will be excluded.  For
      example:

   =java/lang/, java/math/, java/net/, java/nio/, java/security/,
    java/text/, java/util/, javax/crypto/, javax/net/, javax/security/,
    javax/smartcardio/, javax/xml/crypto/, sun/io/, sun/launcher/,
    sun/misc/, sun/net/, sun/nio/, sun/security/, sun/text/, sun/tools/,
    sun/util/, com/sun/security/, com/sun/crypto/, com/sun/net/

      In the properties menu for this project, link this project to the
      JDK platform just created in step 2 (jsn-gate: no sources).
      This seems to internally compile only the sources I care about, not
      the whole world!

      Use this configuration to do your library development.  When you
      want to compile, do so in a separate window (that is, don't use the
      netbeans ant build, but use gnumake as usual).

4)   For testing:  Like in 2a, create a new jdk platform based on the
      build, but this time include links to all the sources in
      open/shared, open/solaris, etc.  Call this "jsn-gate."

      Now create a new project with a simple test case.  Link with the
      platform "jsn-gate".  Then when you want to debug and step into
      the core libraries, you have *ALL* the sources you need, but
      without them being internally compiled.  Indexing seems to take
      much less time.  This also has all the javadoc as well.

Is there an easier/faster way? This environment comes up in 30 seconds 
or so, and drilling into the source packages takes about 10 seconds the 
first use.

Note I am *NOT* an expert in projects, maybe someone has already figured 
this out?  Looking at a few of these related projects in the 
jdk/make/netbeans directories, they look like they're being done in the 
same way as j2se.

Thanks,

Brad
Potential Netbeans Convert-  ;)



More information about the nb-projects-dev mailing list