Skip to main content

NetBeans, NYC and Springtime

Posted by bleonard on April 8, 2005 at 10:36 AM PDT

I spent this last Wednesday in NYC on what was probably the first nice day of Spring this year. I arrived from Connecticut via Amtrak into Penn Station. Generally, I take the subway up to the Sun offices near Grand Central Station, however, it was too nice of a day to be
underground, so I decided to walk. It was close to lunch time when I
arrived and the parks were overflowing with folks soaking up the sun.



I was in town to speak at the NY
Java SIG
. My presentation, NetBeans 4.0, 4.1 and Beyond, was to a capacity crowd of about 80 developers. There was lots of interactive Q&A, which is
always a good sign, but it did limit the amount of material I could
cover. I was able to demonstrate NetBeans' revamped UI, it's support
for Tiger, the Ant based project system, J2EE (sans Web Services) and
the profiler. I did not have time for JUnit, J2ME/Mobility or the new
GUI builder. Given the same time constraints next time, I would focus
on Web Services rather than EJBs for the J2EE portion, otherwise, I
believe the presentation was well received.



After the presentation, I jotted down all the questions I could
remember, and in some cases, spent some time after I returned coming up with some more thorough answers than I gave Wednesday night. Here they are for all that may be interested:

Q:
Will the editor detect unused import
statements?
A:
Yes, but
I didn't know this myself until I tried it on the fly. I added an
unused
import statement then selected fix imports and poof, it disappeared.
Someone, half-jokingly, pointed out that the line containing the import
statement should also be deleted. Turns out it is, unless that import
statement is added to the bottom of the list. I filed a href="http://www.netbeans.org/issues/show_bug.cgi?id=57635">defect
against this corner case.


Q:
Can you pass parameters into the Ant Script?
A:
Yes, via the Advanced dialog of the Run Target
submenu on an Ant script (you can see the "Advanced..." item on the submenu in the image below).


Q:
My build script has lots of "private
targets", can I prevent
these from appearing in the Run Target menu?
A:
Yes. Target names
that begin with a dash, e.g., "-do-init", will not appear in the Run
Target menu. Also, only targets with a description will appear in the
main Run Target menu. Targets without a description will appear in the
"Other Targets" sub-menu.



targets.PNG
Q:
Does NetBeans support multiple web interfaces
to a project? I
haven't been able to get this to work with any other IDE.
A:
I don't
see why not as you would just create another web-module project. Give
NetBeans a try and let me know if you encounter any problems. (I also
spoke to this guy for about 10 minutes after the session. He mentioned
some pretty wacky stuff, like 3 different web.xmls for a project, but
he liked NetBeans tight Ant integration and is going to give it a try.
He's currently using Eclipse.).


Q:
Which server are you deploying to?
A:
The href="http://java.sun.com/j2ee/1.4/download.html#sdk">J2EE 1.4
Reference
Implementation.


Q: Your J2EE demo was cute, but how does it work
with REAL J2EE
projects?
A: Fine. Try it out and let me know if you run into
any
difficulties.


Q: Are the Enterprise Resource Wizards (e.g.,
Call EJB),
available from JSPs as well as servlets?
A: You can access the
Enterprise Resource wizards from any Java class in an EJB module or web
application. The Enterprise Resource wizards are not available from JSP
files.


Q: Which version control systems do you
support? 
A: CVS, href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/VSS6Anchor.asp">Microsoft
VSS 6.0, href="http://merant.com/Products/professional/vm/home.asp">Merant PVCS
are part of the standard NetBeans 4.x distribution.  There are
also profiles
available
for ClearCase, StarTeam, Subversion and TeamWare.


Q: Does your Unit Testing support the Green/Red
Graphical Result
interface?
A: It is possible to code your test case to launch
JUnit's Swing GUI,
however, it is not integrated into the IDE as you may expect.
Integrated support for this UI is planned for the JUnit module.


Q: XDoclet Support?
A: Yes. Since XDoclet is merely a set of
Ant tasks, and the NetBeans project system is based on Ant, XDoclet
integrates easily into the NetBeans environment.


Q: When selecting part of an application to
profile, is it
possible to set the filter at the package level
(rather than at the method level)?
A: Yes. You can create a Customer
Filter which includes only the packages you're interested in profiling.


Q: Could the API used by JFluid, which injects
bytecodes on the
fly to instrument the code, be used for other intentions, like say, a
virus?
A: JFluid uses the href="http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/">JVMTI API.
JFluid's "attach on the fly" capability will only work when (a) the
user who wants to attach is on the same machine as the target VM and
(b) is the same user who started that VM or a super-user.


Q: Does the IDE generate the necessary Ant
targets to launch my
J2ME app in the various configured emulators?
A: The IDE launches the
application in the emulator based on the config.active
property set in
private.properties. You may either change this setting or override the
properties on the command line to launch your application in other
emulators when running Ant outside the
IDE.


Related Topics >>