installing netbeans in ubuntu

30 June 2008 at 12:55 pm 1 comment

The major issue you may encounter while installing netbeans in ubuntu is enabling the visual effect while the installation process.

The error message will be as :

/usr/share/themes/Glossy/gtk-2.0/gtkrc:35: error: lexical error or unexpected token, expected valid token

All you have to do is to just disable the visual effect and try installation again.

Attempt the following instructions from the netbeans wiki page:

Introduction

The guide will cover installation of the Java(TM) Development Kit 6.0 and NetBeans 6.0 on Ubuntu 7.10 code name Gutsy Gibbon release. Before commencing download NetBeans 6.0 to your desktop.

Steps To Reproduce

Installing JDK 6.0

Fortunately installing the Java(TM) Development Kit on Ubuntu is a breeze!

1. Ensure your repository’s are up-to-date. In the Terminal (found in Applications>Accessories Menu on GNOME desktop):

$sudo apt-get update

2. Install the JDK 6.0 and Java-plugin for Firefox using the terminal:

$sudo apt-get install sun-java6-jdk sun-java6-plugin

*Note this will take a while depending on your connection speed.

Update Java(TM) Alternatives

3. Update the Java(TM) alternatives so Suns virtual machines is the default:-

sudo update-java-alternatives -s java-6-sun

4. Open the jvm file located at /etc/jvm:-

gksudo gedit /etc/jvm

5. Now add the line “/usr/lib/jvm/java-6-sun” to the top of the entries, then save and exit. The file should look something like this below:-

/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr

This step ensures that the Sun JVM is the default JVM used by NetBeans.

Check The Java(TM) Environment

6. You can check the Java(TM) Environment has been installed and set up correctly by doing the following command in the terminal:

java -version

If all is well the output from the above command should be similar to below:-

java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

Installing NetBeans 6.0

Use the NetBeans installer you downloaded earlier to your desktop to install NetBeans 6.0. Depending on the version of NetBeans downloaded will depend on your file name! Open a terminal and change directory to the desktop:

cd Desktop

Check your file name is present by issuing a list command:-

ls -l

Still in the same terminal install Netbeans 6.0:

sudo ./netbeans-6.0-javaee-linux.sh

Now a dialogue box will pop up asking for your preferred options. When the options are presented for your NetBeans install location /opt is usually a good place, and the same goes for the server (if you installed the J2EE bundled version that is). If in doubt see the images below!

If you see a blank grey window after running the netbeans installer shell script and see the following message:

/usr/share/themes/Glossy/gtk-2.0/gtkrc:35: error: lexical error or unexpected token, expected valid token

This is a problem involving visual effects. Temporarily disable them in Gnome by going to System :: Preferences :: Appearance :: Visual Effects, and selecting none. You will still see the error message but a installation wizard will appear and you will be able to install Netbeans.

  • Enter your preferences

netbeansLocation.png

  • Server Location

netbeansServerLocation.png

When all has been done hit “install” and then wait for a while and finally click the “finish” button. To run NetBeans either run from your /opt/netbeans6.0/bin directory or create a menu link using the “Main Menu” tool in Ubuntu (System>Preferences>Main Menu).

Look And Feel

You may notice that NetBeans 6.0 implements a GTK interface to integrate into your current GNOME desktop, however there are some things that aren’t quite right yet, such as the drop down menus button and most importantly the overall speed. If you want to change the theme back to the Java(TM) cross-platform look and feel see Netbeans Hacks.

Good Luck & Best Regards 🙂

Entry filed under: Linux. Tags: , , , .

شلل النوم ubuntu problem with Java GUI applications

1 Comment Add your own

  • 1. brian ho  |  19 March 2009 at 4:45 am

    thanks mate, just solved my problem about the valid token

    Reply

Leave a comment

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

June 2008
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930  

Most Recent Posts