Extreme Netbeans Newbie

One of the goals I set for myself with regard to the Liferay documentation was to show people how to set up Liferay for development (either core, extension or plugins) in both of the leading open source IDEs: Eclipse and Netbeans.

I have been using Eclipse for many years,and so I know my way around that IDE pretty well. Plus that environment has been pretty much covered in the documentation, so I don't have too much work to do there.

But Netbeans is a whole 'nother matter. I've never used Netbeans, but I have to admit that I've admired it from afar. So I figured I'd jump in with the new 6.0 Release Candidate (because it is likely that 6.0 will be out by the time our docs are done).

First I tried setting up Liferay using File -> New Project. I selected a Java Project With Existing Ant Script and made sure the location was the folder to which I pulled the Liferay source from SVN. All looked good at first. I was able to right-click on the project and add all the source folders. So far, so good!

My first hangup came when I needed to get the .jar files from the project's lib folder added to the project. Netbeans has a check box at the top of that dialog labeled: Separate Classpath for Each Source Package Folder. Unfortunately, mine was checked AND grayed out. I did not want to define a separate classpath for every Liferay source folder (have you seen how many there are?), so I desperately wanted to figure out how to uncheck that box. But since it was grayed out, I couldn't. Web searches on this turned up nothing. So I gave up.

I came back to this a couple of days later with an idea: Netbeans has an Eclipse project importer; I'll just use that! I deleted the nbproject folder that had been created inside of the Liferay project, and then used the Eclipse project importer to import the projects from my Eclipse workspace.

It seemed to work better. All of the source folders were recognized, but there were errors in them (according to the icon on the files). However, when I actually opened the files, there were no errors. Strange. The libraries were on the class path now, so I decided not to worry about this until later.

My next problem, however, came when I wanted to try to browse to portal-web, which is the folder where Liferay's JSP files are stored. I could not figure out a way to get there in Netbeans. The Projects folder listed all of my source folders, but I could not see any other folder that's in the project. I figured okay, there's a Files tab here; that should give me access to the rest of the project folders. Nope. That tab shows the top level folder of the project, with the nbproject folder and the build.xml file inside of it, and nothing else. It also shows a bunch of subfolders with the source in them again.

No matter what I tried, I could not find a way to simply browse the files in the project. I did google searches, Netbeans site searches, etc., but found nothing.

So I've given up again. I am sure these problems have to do with the fact that I am an extreme Netbeans newbie, so can anybody help me out here? What am I missing? Surely, Netbeans allows you to work with a freeform Java project like Liferay that has its own layout.

Thanks in advance!

Blogs
Rich -

I'm still trying to get this to work with 6.1 but haven't had any luck. It's looking like I might be going back to Eclipse.
Hey Josh,

Actually, this was solved a long time ago when somebody added the nbproject/project.xml folder to the Liferay source. Now all you need to do is simply open Liferay as a project in Netbeans and it works fine.

I've been using Netbeans on a daily basis now for a good couple of months, and so far, I'm not seeing myself going back to Eclipse. The one thing it solves for me very nicely is I no longer have random workspace rebuilds and refreshes slowing my machine down. :-)