Build NetBeans on OpenSolaris

OpenSolaris is on path to become a compelling development environment. Once in a while I use my local installation that runs on my MacBook (under Virtual Box) to experiment with different tasks. Yesterday I tried to build NetBeans on OpenSolaris. With that in mind I knew I'll need the JDK (for the compiler), ant to build the sources, mercurial to pull the sources from the NetBeans open source repositories, etc.

In a terminal I became root and started looking for packages (e.g. pkg install mercurial - but this won't work). I found out that at this point the naming is not yet consistent. You can look for software like netbeans or openoffice by name, however for something like mercurial and ant, one has to use SUNWmercurial and SUNWant respectively.

Pulling from the NetBeans repository is simple:

hg clone http://hg.netbeans.org/main

The next step calls for going into the <nbsourcedir>/main/nbbuild/ directory and looking for build targets using ant -projecthelp. "All" seemed an intuitive so I tried it. The bad part is that NetBeans requires ant version 1.7.0 and the version I installed earlier was 1.6.5 :-(. At this point I gave up and I'll ping the NetBeans community for help.


Comments:

I've found this FAQ entry very helpful when building NB from source:

http://wiki.netbeans.org/WorkingWithNetBeansSources

Although I have not yet done it on OpenSolaris, I would expect you simply need to change to the "nbbuild" directory and run "ant tryme" in order to build and run the IDE.

If the javac command in your path is not from JDK 5, you will need to specify the path to the 1.5 JDK:

$ ant -Dnbjdk.home=/path/to/jdk-1.5 tryme

Posted by Tom Wheeler on June 26, 2008 at 07:43 AM PDT #

In this case you need to install and download Ant 1.7 from http://ant.apache.org/bindownload.cgi

Looks like owner of OpenSolaris ant package (SUNWant) did not ported the latest version. Fortunately ant 1.7 in included inside NetBeans distros. Hope this helps.

Posted by Martin Balin on June 26, 2008 at 04:57 PM PDT #

Hi Octavian.

I think you've run into two main issues here.

1. Querying IPS packages by name is sort of tricky, since as you saw there are some inconsistencies in the naming of the packages. So as Roman points out in http://blogs.sun.com/observatory/entry/querying_ips_packages you probably want to use pkg search -r. Or as an alternative, use the GUI as I describe in http://blogs.sun.com/observatory/entry/getting_java.

2. Just like other operating system repositories, the contents of the OpenSolaris repository lags behind a bit. That is why the version of Ant in the repository is 1.6.5 and the version of NetBeans is 6.0.1. So I would suggest that you go ahead and uninstall SUNWant. And instead of installing NetBeans from the repository, take a look at http://blogs.sun.com/observatory/entry/installing_netbeans_6_1, so that you can get NetBeans 6.1 installed. And as Martin pointed out, then you'll have Ant 1.7.0 since NetBeans 6.1 includes it.

HTH - Gregg

Posted by Gregg Sporar on June 27, 2008 at 12:57 AM PDT #

Very help comment. On #2 - I don't want to install NetBeans, but just get the sources and build.

Posted by Octavian on June 30, 2008 at 03:17 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

octav

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today