Netbeans and a subset of a JDK workspace

Dmitri Trembovetski Dmitri.Trembovetski at Sun.COM
Wed Oct 15 20:48:23 PDT 2008


   Hi Brad,

Brad Wetmore wrote:
> Thanks Daniel.
> 
> One of the other current limitations of the default projects was that 
> the "j2se" project didn't index the build/<arch>/gensrc directory where 
> java/nio/ByteBuffer and friends live (bug 6628175).  I was able to get 
> the directories to show up in the file lister, but not hooked into the 
> auto-completion/compilation mechanism.  I ended up talking to David 
> Bristor, this group's moderator.  He had started working on the gensrc 
> problem, but got 1/2 of it finished before he left Sun.  I was able to 
> get the second half, so it's working now.
> 
> I am now hooking in all the closed source directories as well.
> 
> Once everything gets auto-compiled (15-20 minutes) and loaded into 

   What is this "auto-compilation" is actually doing? I mean, if I have
   a fully built j2se workspace, shouldn't everything be compiled already?

> memory, it's surprisingly fast.  Restarting/scanning current project is 
> just under a minute, and expanding the node for the shared sources is 
> just under two.  :)  Fortunately, it's not crashing all the time like my 
> first experience with NetBeans 4.1!  I don't really have to restrict to 
> the files of interest once everything's loaded, it's responsive enough.

   I find that tweaking the default heap settings (doubling them) improves
   things. Otherwise sooner or later you'll run into OOE.

> 
> Unless I find something that's a showstopper, I'll probably start using 
> netbeans for my day-day work.

   Welcome to to the club =) I've been using netbeans exclusively for
   jdk development for last couple of years. I also setup a project for
   the native code, using C/C++ plugin, works OK, even with autocompletion
   (if it feels like it).

   Thanks,
     Dmitri


> 
> Brad
> 
> 
> 
> daniel fuchs wrote:
>> Hi Brad,
>>
>> You could have a look at how the make/netbeans/jmx project is
>> defined.
>> This is a project that only compiles a subset of the jdk sources
>> (the JMX sources) put them in a jmx.jar and then prepend that jar
>> to the bootclasspath.
>>
>> For us using the latest promoted JDK7 build with our work-in-progress
>> jmx.jar in the bootclasspath is usually sufficient for 
>> developing/testing/debugging purposes.
>>
>>
>> Hope this helps,
>>
>> -- daniel
>> http://blogs.sun.com/jmxetc
>>
>> Brad Wetmore wrote:
>>> 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