David Coldrick's Weblog

     
 
Java Development on Ubuntu - Part 2 - Installing NetBeans
In Part 1, we got the Java JDK installed on Ubuntu. Pretty easy. Now we want an IDE, and my favourite is NetBeans. Lots of good stuff in the recently released beta of version 5, so let's do that one. [Update: Of course, you can do this with the second beta, or any of the development builds].

Download netbeans-5_0-beta-bin-linux.bin, make sure JAVA_HOME is defined, and run the .bin. For example:

export JAVA_HOME=/usr/lib/j2sdk1.5-sun/
./netbeans-5_0-beta-bin-linux.bin

Note: If the installer can't find the jdk - because you haven't set JAVA_HOME - you might get the message: "The wizard cannot continue because of the following error: could not load wizard specified in /wizard.inf (104)". Hmmm. Could be deemed rather obscure.

All going well, not only have you installed a fantastic IDE, but you even have an eye-catching little double-clickable launcher on your desktop. Sweet.

Java Application Server: If the only J2EE you're doing is servlets and JSPs, you can use the Tomcat server builtin to NetBeans. However, if you want to get into EJBs and Web Services, install this: it's very well integrated into NetBeans, it's free, and the next version, which will be supported by a future version of NetBeans, is open source.

Download, choosing "Sun Java System Application Server Platform Edition 8.1 2005Q2 UR2". The file will be something like sjsas_pe-8_1_02_2005Q2-linux.bin.

Make sure it's executable (chmod +x sjsas_pe-8_1_02_2005Q2-linux.bin if necessary), and run it. It will probably not be able to find your copy of java, so you can do either:

sudo ./sjsas_pe-8_1_02_2005Q2-linux.bin -javahome /usr/lib/j2sdk1.5-sun

or, as we did above:

export JAVA_HOME=/usr/lib/j2sdk1.5-sun/
sudo ./sjsas_pe-8_1_02_2005Q2-linux.bin

An install wizard will start, and away you go. Note that you can install without sudo, in which case the app server will be installed by default in your home directory, rather than in /opt.

To make the app server available from NetBeans, fire up NetBeans, go to Tools/Server Manager and Add… your server. Almost all of the server-related tasks you'll want to do can be done from within the IDE now, including – of course – deploying and debugging applications.

Other optional extras:

  1. If desired, change the memory available to NetBeans: edit {install directory}/etc/netbeans.conf, and change the line starting with "netbeans_default_options" to have the desired setting for min/max heap size. For example, on my 2GB laptop, I specify:
    "-J-Xms128m -J-Xmx256m"
  2. If you're interested in development for mobile devices, Download and install the mobility pack: for this beta, the file to download is netbeans_mobility-5_0-beta-linux.bin. Just run it, and the next time you run the IDE, you'll be able to create mobile projects. Lukas is on the mobility team, and has interesting and relevant blog entries
  3. A plugin you'll definitely want to install is the profiler: profiler-m9-linux.bin. Again, just run this to install the latest in profiling capabilities .
  4. Finally, by default, NetBeans uses the Metal look and feel on Linux. If you're a keen Ubuntu Gnome person, you might try the GTK L&F, by adding "-J-DuseGtk=true" (without the quotes) to the "netbeans_default_options" line in {install directory}/etc/netbeans.conf. So this line on my system now looks like:
    netbeans_default_options=”-J-Xms128m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-ea -J-DuseGtk=true”

    Note that this is unsupported, but hey, so is running NetBeans on Ubuntu. One glitch I've found is that with the default "Human" theme in Ubuntu, menu items in Java using this L&F, when selected, disappear (or turn white on white, dunno which). My workaround, until I find out where the problem is, is to change the Ubuntu theme to Glider, which seems to work fine.

    Tags: NetBeans : Java : Ubuntu

    @ 02:33 PM EST    Permalink [ Comments [26] ]
 
 
 
 
Trackback URL: http://blogs.sun.com/coldrick/entry/java_development_on_ubuntu_part1
Comments:

Hi! It's a great HowTo, Now I know how to resolve the ./wizard.inf problem when installing netbeans :) Thanks a lot.

Posted by Belutz on October 26, 2005 at 07:48 PM EST #

I've installed Java and Netbeans (including Mobility Pack) without problems. But when it came to the sjsas_pe-8_1_02_2005Q2 i got stuck. Here is the error msg i got.

P.S.: I'm a newbie in Linux (Ubuntu Hoary Hedgehog) - in fact, i was using Win98 and migrated to Linux just to start learnig J2EE, PHP and using free math tools (pari, maxima...,latex). Any advice will be welcome! Thanks! For the great job with Netbeans too!

</BR>

franzroot@ubuntuFranz:~$ ls -l -a *.bin

-rwxrwxrwx 1 franzroot franzroot 48836045 2005-10-25 21:02 jdk-1_5_0_05-linux-i586.bin

-rwxrwxrwx 1 franzroot franzroot 49038055 2005-10-25 22:09 netbeans-4_1-linux.bin

-rwxrwxrwx 1 franzroot franzroot 20468814 2005-10-25 22:51 netbeans_mobility-4_1-linux.bin

-rwxrwxrwx 1 franzroot franzroot 57782699 2005-10-25 23:33 sjsas_pe-8_1_02_2005Q2-linux-ml.bin

franzroot@ubuntuFranz:~$ chmod +x sjsas_pe-8_1_02_2005Q2-linux-ml.bin

franzroot@ubuntuFranz:~$ ./sjsas_pe-8_1_02_2005Q2-linux-ml.bin

./sjsas_pe-8_1_02_2005Q2-linux-ml.bin: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

Posted by Franz Maikaefer on October 29, 2005 at 06:10 PM EST #

I found the answer to my problem. I just had to install this package in my Ubuntu: libstdc++2.10-glibc2.2

I found in the Debian site that it was in this package that i could get the missing library. I installed it - no problems with conflicting packages - and followed the installation of sjsas_pe-8_1_02_2005Q2. Now everything ran right!!!

Posted by Franz Maikaefer on October 29, 2005 at 07:25 PM EST #

You don't have to define JAVA_HOME in Ubuntu Breezy Badger. After install the JDK, you just need to run the command.

sudo update-alternatives --config java

Posted by Jun Zhang on October 30, 2005 at 09:54 PM EST #

Hello there. Very cool how-to, thank you :D.

It seems though, that most people (and just those who use ubuntu linux) have a strange problem with libfontmanager.so and Java 1.5. The truth is that I could find any workarrounds except for removing jdk1.5 and going back to 1.4. This ofcourse makes sad many java developers including me. Have you got any clues about is going on?

Thanks in advance,
Kostas

Here's is a part of the error message (very huge so I don't include it all)

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xb1173d03, pid=8872, tid=2884103088
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_05-b05 mixed mode, sharing)
# Problematic frame:
# C [libfontmanager.so+0x2ed03]
#

--------------- T H R E A D ---------------

Current thread (0x0836a768): JavaThread "AWT-EventQueue-1" [_thread_in_native, id=8896]

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libfontmanager.so+0x2ed03]
C [libfontmanager.so+0x34ec6]
C [libfontmanager.so+0x3524e]
C [libfontmanager.so+0x3768a]
C [libfontmanager.so+0x35a92]
C [libfontmanager.so+0x35faa]
C [libfontmanager.so+0x225c6]
C [libfontmanager.so+0x24326]
C [libfontmanager.so+0x463c6] Java_sun_font_FileFont_getGlyphImage+0x120
j sun.font.FileFont.getGlyphImage(JI)J+0
j sun.font.FileFontStrike.getGlyphImagePtrs([I[JI)V+92
j sun.font.GlyphList.mapChars(Lsun/java2d/loops/FontInfo;I)Z+37
j sun.font.GlyphList.setFromString(Lsun/java2d/loops/FontInfo;Ljava/lang/String;FF)Z+47
j sun.java2d.pipe.GlyphListPipe.drawString(Lsun/java2d/SunGraphics2D;Ljava/lang/String;DD)V+148
j sun.java2d.SunGraphics2D.drawString(Ljava/lang/String;II)V+25
j org.netbeans.beaninfo.editors.FontEditor.paintValue(Ljava/awt/Graphics;Ljava/awt/Rectangle;)V+137
j org.netbeans.modules.form.FormPropertyEditor.paintValue(Ljava/awt/Graphics;Ljava/awt/Rectangle;)V+15
j org.openide.explorer.propertysheet.RendererFactory$StringRenderer.delegatedPaint(Ljava/awt/Graphics;)V+150
j org.openide.explorer.propertysheet.RendererFactory$StringRenderer.paint(Ljava/awt/Graphics;)V+61
j org.openide.explorer.propertysheet.ButtonPanel.paint(Ljava/awt/Graphics;)V+64
j javax.swing.CellRendererPane.paintComponent(Ljava/awt/Graphics;Ljava/awt/Component;Ljava/awt/Container;IIIIZ)V+124
j javax.swing.plaf.basic.BasicTableUI.paintCell(Ljava/awt/Graphics;Ljava/awt/Rectangle;II)V+110
j javax.swing.plaf.basic.BasicTableUI.paintCells(Ljava/awt/Graphics;IIII)V+133
j javax.swing.plaf.basic.BasicTableUI.paint(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V+244
J javax.swing.plaf.ComponentUI.update(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V
J javax.swing.JComponent.paintComponent(Ljava/awt/Graphics;)V
v ~RuntimeStub::alignment_frame_return Runtime1 stub
j org.openide.explorer.propertysheet.BaseTable.paintComponent(Ljava/awt/Graphics;)V+2
j org.openide.explorer.propertysheet.SheetTable.paintComponent(Ljava/awt/Graphics;)V+18
J javax.swing.JComponent.paint(Ljava/awt/Graphics;)V
v ~RuntimeStub::alignment_frame_return Runtime1 stub
j org.openide.explorer.propertysheet.BaseTable.paint(Ljava/awt/Graphics;)V+15
J javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V

Posted by Kostas Papadopoulos on November 19, 2005 at 08:18 PM EST #

Thanks a lot for this information. I was very suspicious about java performance in Ubuntu! Also some problems with the hardware in the beginning made me almost cancel everything about it. But i decided to loose this day, and the result is Wow! i can't believe that netbeans is that fast in Ubunto! what happened? is it Java improved on linux or it is Ubunto? I remember the dependency hell in Mandrake, Suse and RedHat, and the poor performance for almost all java apps. But now i see netbeans (4.1) much faster than in windows! it is like a native app! Well, this is refreshing and very nice surprise! This combination will make me sleep with a smile. :)

Posted by N. Gailani on December 13, 2005 at 04:18 PM EST #

I installed JAVA running the jdk bin directly. Afterwards I added the export line at the end of my bash.bashrc file... I don't know if it is a good idea to modify that file but I'm a newbie and that did the trick for me. My problem now is that I tried installing netbeans in a bundle with the sjsas package... In other OSs it has installed the sjsas stuff in a folder inside the netbeans installation folder, however in ubuntu it doesn't showup anywhere. What am I doing wrong?????? Should I install the package separatly? Other than this I managed to install pretty much everything I needed in ubuntu to start working and am happy with it's performance. Could you please give me a hand with this? Thanks

Posted by Javier Tibau on December 29, 2005 at 11:05 PM EST #

I can never remember whether the .bashrc file always gets executed, or just for new interactive processes. Certainly the sjas - when you're installing the bundle - should appear in a subfolder of the nb install.

Try uninstalling nb, then do an explicit export, followed by a reinstall. If that doesn't work, try installing the app server separately.

Let us know how you go.

Posted by David Coldrick on December 30, 2005 at 07:55 AM EST #

thank you, thank you. I now have jdk1.5, netbeans5, and subversion running on ubuntu 6.04 alpha4. I'm really impressed with Ubuntu and now I can develop completely in java on linux and have a nice easy to use DESKTOP to boot. thanks again! rob

Posted by robert chou on February 23, 2006 at 06:52 AM EST #

Hello! I've just download and installed Netbeans 5.5 on Kubuntu and it all works fine. The problem is it's using that god-awful metal them and the screen fonts make my skin crawl! I have tried your suggestion editing the netbeans conf file
netbeans_default_options=”-J-Xms128m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-ea -J-DuseGtk=true”
but that doesn't make any difference. Any other ideas I could try? cheers!!!

Posted by dave on June 17, 2006 at 06:13 AM EST #

Dave, I don't know why that wouldn't change it totally, *unless* it's the fact that you're using Kubuntu, rather than Ubuntu. Maybe some Gtk libraries aren't installed? You can run NetBeans with an arbitrary theme (again, unsupported), by invoking nb like this:<p/> {installdir}/bin/netbeans --cp:p {L&F jar name} --laf {L&F name}.<p/> Take a look at http://www.netbeans.org/kb/41/substance-look-and-feel.html for an example. Regards, David

Posted by coldrick on June 17, 2006 at 08:05 AM EST #

Thanks for the speedy reply. I'm not sure where these "other" L&F jar files are supposed to come from (I'd really prefer not to use something worse than metal ;-) Incidently, Im pretty sure my gtk libraries are installed ok as other programs e.g. Gtkpod work fine. I even tried running this, although I suspect it is incorrect: $ /usr/local/bin/netbeans-5.5beta/bin/netbeans --cp:p {Gtk} --laf {Gtk} UI class not found, using default UI...

Posted by Dave on June 17, 2006 at 08:14 AM EST #

You might try some of the JGoodies Looks L&Fs to see if they appeal: downloads at https://looks.dev.java.net/servlets/ProjectDocumentList

Posted by coldrick on June 17, 2006 at 08:26 AM EST #

I think maybe I'm still not quite getting this:

./netbeans --cp:p {looks-2.0.3.jar} --laf {looks-2.0.3}
UI class not found, using default UI... I got some of the demo jar's up and running and they look ok but kinda remind me of Windows 3.11 a little :-( I've been programming java on windows for a small while and am impressed with the advances that have been made. It's a shame linux isn't as widely supported.

Posted by Dave on June 17, 2006 at 08:44 AM EST #

The first bit is right, but the second --laf parameter has to be the name of the l&f class within the jar. In looks, there are several to choose from, for example com.jgoodies.looks.plastic.Plastic3DLookAndFeel WRT linux support, Java SE 6 (mustang) is *far* better, particularly as regards GTK L&F. Still (one build ago, at least) has a few bugs, tho, so I use jgoodies for now on Ubuntu. Regards, David

Posted by coldrick on June 17, 2006 at 11:07 AM EST #

Appreciate the help but still not good:
$ ./netbeans --cp:p {looks-2.0.3.jar} --laf {com.jgoodies.looks.plastic.Plastic3DLookAndFeel}
UI class not found, using default UI...

I also spent all morning trying to install Mustang using this guide but didn't really even know what I was attempting to do. I think it perhaps time to throw in the towel! :-(

Posted by Dave on June 17, 2006 at 09:50 PM EST #

Don't give up yet: you took me literally with the braces - lose { and } and you should be right. So you command should be: $ ./netbeans --cp:p looks-2.0.3.jar --laf com.jgoodies.looks.plastic.Plastic3DLookAndFeel Good luck! Regards, David

Posted by coldrick on June 19, 2006 at 08:52 AM EST #

Hey, I feel pretty stupid now! Thanks a lot.
Wonder if I'll ever get to the bottom of the Gtk problems...

Posted by Dave on June 20, 2006 at 07:11 AM EST #

if anyone has problems with libfontmanager.so in ubuntu, see: http://ubuntuforums.org/showthread.php?t=351689

Posted by lenooh on February 07, 2007 at 08:08 PM EST #

Just thought you might like to know, this fixes the JDK not found error on Suse 10.2 as well. Havn't tried Breezy, but suse 10 seemed way more polished to me than dapper drake.. maybe worth a look.

Posted by Lou Calderone on April 01, 2007 at 05:00 PM EST #

Also, thought you might like to know that I think there is an error in the math question authentication when there is a zero involved. Also, it was just by chance that I decided to scroll down to see if my message posted, I almost did not do this and I would have never noticed that the comment did not post, I personally would put them at the top of the page, maybe you have already considered it. Anyway, thanks for the post.

Posted by Lou Calderone on April 01, 2007 at 05:03 PM EST #

Hi Lou: glad it helped. Wrt Suse, I don't think I could live without apt-get package management. Besides, Dapper is (almost) two releases ago: we've had Edgy, and I've been on the dev builds of Feisty for quite a while. Feisty should release this month, and it's pretty nice. Finally, I was worried that perhaps you'd been caught by our sometimes over-eager comment spam-catcher, but you weren't. I haven't seen any other reports in our internal bloggers mailing list of a problem like that. I'll report it.

Posted by David Coldrick on April 01, 2007 at 06:39 PM EST #

For anybody with the "white menus" bug in netbeans 6.1 in ubuntu, all you need to do is customize your theme and pick controls other than clearlooks. Changing to ClearlooksClassic fixed it for me.

I didn't have quite the same bug as mentioned at the bottom of the article. My menus could select properly, but the menu background was white with no outline around it.

Posted by Josh P on May 31, 2008 at 03:22 AM EST #

http://www.batteryfast.co.uk/hp/dv9000.htm hp dv9000 battery,
http://www.batteryfast.co.uk/hp/dv9200.htm hp dv9200 battery,
http://www.batteryfast.co.uk/hp/dv9100.htm hp dv9100 battery,

Posted by laptop battery on October 24, 2008 at 05:51 PM EST #

I Got One From http://www.batterygoshop.co.uk/hp/dv9200-battery.htm hp dv9200 battery

Posted by battery on February 09, 2009 at 08:25 PM EST #

Do you want to own some betteries which have more function , more economical and long life? Please visit the following Web site:http://www.adapterlist.com/hp/dv9200.htm hp dv9200 battery,it will help you find the ideal battery.

Posted by laptop bettery on March 03, 2009 at 01:30 PM EST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed
 
« December 2009
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

[RSS Newsfeed]

Valid XHTML or CSS?

[This is a Roller site]
Theme by Rowell Sotto.
 
© David Coldrick's Weblog