How to install JDK and Netbeans?

23,181

Solution 1

Thank you for your help, but I solved my own problem.

When I installed Ubuntu and I installed OpenJDK. I was trying to install the Sun JDK, which led to the error.

I resolved the problem by uninstalling OpenJDK, restarting the machine, and then extracting the file mentioned above. It was successfully extracted and NetBeans easily found the JDK path.

Now I'm enjoying Java Development with NetBeans.

Solution 2

To install Netbeans, you can simply install the netbeans package. This will install everything Netbeans needs, including Java.

sudo apt-get install netbeans

To install Java, but without installing Netbeans

If you want the proprietary version of Java, you need to:

To install these packages, use the Software Centre, which is available from the Applications menu.

Solution 3

Netbeans is available from the Ubuntu software Center, you should install from there unless you have a strong reason to use a different version.

Solution 4

In future use these 2 scripts I wrote :D...

Java before Netbeans...

#!/bin/sh

#Delete the line below if you only want the "open" JDK & JRE
sudo apt-get install openjdk-7-jdk openjdk-7-jre;

#Makes the /usr/lib/jvm in case...
sudo mkdir -p /usr/lib/jvm

#Clean out /tmp...
sudo rm -rf /tmp/*
cd /tmp

#Update this line to reflect newer versions of JDK...
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.tar.gz;
tar -xvf ./*gz;

#Move it to where it can be found...
sudo mv /tmp/jdk1.7.* /usr/lib/jvm/;

#Add the new Java to the bin 
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_01/jre/bin/java 3;

#User chooses
sudo update-alternatives --config java;

exit 0;

Netbeans...

# @author Yucca Nel
# Update as needed for newer Netbeans releases :D

#!/bin/sh

#Clean out /tmp...
sudo rm -rf /tmp/*;
cd /tmp;

#Update this line to reflect newer versions of Netbeans or replace 'javase with 'javaee' or add jee manually via
#Netbeans 'plugins as needed.
wget http://download.netbeans.org/netbeans/7.0.1/final/bundles/netbeans-7.0.1-ml-javase-linux.sh;
sh /tmp/*sh;

#Add Netbeans launcher to your PATH. Doing so allows you to run 'netbeans' command from the terminal
sudo ln -s ~/netbeans-7.0.1/bin/netbeans /usr/local/bin/;

exit 0;
Share:
23,181

Related videos on Youtube

Muhammad
Author by

Muhammad

Updated on September 17, 2022

Comments

  • Muhammad
    Muhammad over 1 year

    I have downloaded a .bin file for JDK and am trying to install it. I have used these commands:

    chmod +x jdk-6u23-linux-i586.bin
    sudo ./jdk-6u23-linux-i586.bin
    

    and got this output:

    sudo: ./jdk-6u23-linux-i586.bin: command not found
    
  • dv3500ea
    dv3500ea over 13 years
    @user8900 - Please answer your own question outlining the steps you took to solve it. After 2 days, you can accept your own answer.
  • Muhammad
    Muhammad over 13 years
    dear i m not understanding what your are saying?..so can you voice chat with me? at skype . i am available at skype.
  • Muhammad
    Muhammad over 13 years
    thnx for guidence.i got your instruction and follow them.
  • Gemtastic
    Gemtastic almost 8 years
    One should be aware though that the ubuntu software centre version is the plain JavaSE version.