Showing posts with label Netbeans. Show all posts
Showing posts with label Netbeans. Show all posts

Tuesday, July 29, 2008

Netbeans: where is the servlet-api?

I am currently writing a sample servlet for x2svg. And I am also trying to use NetBeans for it (as you probably remember, I am normally using Eclipse for my daily work). Actually I even downloaded 6.5M1 as Adam Bien sounded enthusiastic about it (and the editor really feels somewhat snappier than the 6.1 one).

To be able to include javax.servlet.* I need the servlet-api.
So I went to Tools->Libraries and expected it to be there. I have downloaded the EE edition of NetBeans, that should have it, but I just can't find it. There are tons of stuff like JSF libs etc. that all depend on it in some way, but I can't just pull in the basic servlet api.

For now I ended up with including the external servlet-api jar from tomcat, but this can't be the real solution.

What am I doing wrong? Where is the servlet-api in the NetBeans distribution?

Monday, April 28, 2008

NetBeans 6.1. is here !

Last time I was asking where NetBeans 6.1 is, as its release got delayed.

I got a comment on my blog entry that it will be released today (4/28). And here it is!

Nice!

Friday, April 25, 2008

So where is Netbeans 6.1 ?

When I was recently testing NetBeans, I also saw that 6.1 GA was supposed to be released on Apr 23th. Now it is two days later and still no sign of it (or why it is delayed). So I will postpone further testing in that area until 6.1 is out.

Monday, April 21, 2008

Testing NetBeans (coming from Eclipse)

Inspired by Adam Bien's praise on NetBeans and its Maven support, I was looking at NetBeans again.
NetBeans basically was my first Java IDE, but somehow I never got infected by it and switched to Eclipse relatively soon thereafter.

I downloaded NetBeans 6.0.1 for Mac OS X from the website and started ..

First a little test



So I first tried to import a simple Eclipse project like x2svg with the "Open Project..." and "from existing build file" option, but this wasn't really as I wanted it. Ok, back to the dialog and searching for "from Eclipse project" - nothing. A quick search in help showed that I first have to download and install the respective plugin. That was quick and this time the import worked well.

The next thing that I changed was the key bindings. I am so used to the Eclipse ones, that I don't want to learn new ones. This was equally simple. Just go to preferences and the key bindings section, then choose Eclipse from the drop down. Done (Note to Mac users: Save is on Ctrl-S in that binding, but can be easily changed).

One drawbacks for me is that run/debug options have not been transferred (I am currently trying to improve the XSD parser and have a longish command line).

One irritating thing is that it seemed like the SVN settings also have not been imported. But it turned out that as soon as I specified the location of the svn executable (actually SVN_HOME is the directory where it resides in), svn integration worked as supposed. Interestingly, as I have three source trees in the project, NetBeans is connecting three times to the svn server, while Eclipse uses one connection only on a svn up.

Another thing that is irritating (but which I find a good think after I know what is going on) is the fact that NetBeans is storing its information in a separate folder in the filesystem and uses this folder as default root directory when running an executable, which will make some tests fail. But the I am very happy, that it doesn't just write stuff in my existing project that I would need to remove later.

When I tried to open my two GUI files, I received a (well known) NPE both times - actually I was hoping to get some sort of visual Swing editor instead. The website that took my error report told me that this is probably already resolved and that I should download the latest NB 6.1 milestone (RC2 in my case).

Updating to 6.1 RC 2



The update was painless, and installed a new version next to the 6.0 one in /Applications/NetBeans. Having seen this, I did not expect the plugins that I installed earlier to be present - and I was right.

The NPE was gone too, but I still have no GUI editor - perhaps because NB is just not able to parse GUI elements that were not created using NB?

But from that little test I have to say that I like it much more than when I was looking at it the last time. Now lets go on to something heavier.

Testing with a mavenized project



In RHQ we are using maven a lot. So the next test is to see if the maven support is really as good as Adam is saying.

Checkout from http://svn.rhq-project.org/repos/rhq was painless and NetBeans was asking what project I want to open. I've chosen the root and it now showed me a structure of maven poms, that I could open as project afterwards. This again is very different from how Eclipse is handling things (I mean, RHQ is one project with a bunch of modules). But ok, that import was painless as well.
And then: a build from within NetBeans fails because of some wrong maven version. But this is not fatal for me, as I am used to build from the command line anyway.

Speed



In total NB doesn't feel slow, but with RHQ, auto completion is slower than in Eclipse, the "member view" is slower than the Outline view and the fan of my MacBook is much more active. I can imagine that this comes from the usage of the mavenized project. I will try to import this as Eclipse project as well to see if that changes things to the better.

My friend, the problem view



Eclipse has a problem view that just works. Period. IntelliJ 6 had its issues with it. And now I am finding basically the same in NB 6.1. Perhaps I am missing something obvious - dunno. I have already enabled the "track java dependencies" setting:



(I am not even sure if this setting is supposed to do what I want it to do).

In x2svg I have three source trees src, gui-src and test-src. When I now e.g. rename a method in src (by hand, not via re-factoring), only the errors in the src tree show in the project explorer and in the task list. Even when I have a file from gui-src open and the editor shows the error for that file, it doesn't appear in the task list nor the projects explorer.



When I switch back to the other file, the error will eventually show.

When I then fix the issue in src/ , the error will still show up for the file(s) in gui-src/.

Profiler



Just to mention that as a big plus for NetBeans: it comes with a built in profiler. I don't know how much I'll look at it or even use it, as we are using jProfiler in RHQ, but nevertheless this is a big plus.



Conclusion



NetBeans has gained a lot since I was last looking at it and the Maven integration is really so much better than in Eclipse, which saves me from the pain to always update the .classpath file when we pull in a different library version.

I will keep an eye on NB in the upcoming weeks to see if it could be an alternative to what I now have with Eclispe. But the issue with the problem view / task list, that I mentioned, really is close to a show stopper for me. Perhaps it will just be fixed in NB 6.1 GA.