Sunday, October 28, 2012

Installing Maven 3 on Ubuntu 12.04

Prerequisites:
Must already have a jdk installed. In my case: java-7-oracle.

Open a terminal and execute the commands below.

  1. wget http://apache.petsads.us/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
  2. tar -zxf apache-maven-3.0.4-bin.tar.gz  
  3. sudo cp -R apache-maven-3.0.4 /usr/local
  4. open the ~/.profile and add the following lines:
    1. M2_HOME="/usr/local/apache-maven-3.0.4"
    2. M2="$M2_HOME/bin"
    3. PATH="$M2:$PATH"
  5. Save the file and re-log to load the new environment variables.
  6. Make sure that java is in your path. This should have been done while setting up a jdk.
  7. mvn –version  to verify maven.

I've recently found that depending upon your ubuntu flavor, that the .profile file may not be used. Instead the .bashrc file may get loaded. I've seen this in Lubuntu (LXDE) and Bodhi (Enlightenment). The process is the same, just add the files to the ~/.bashrc instead.

Download Mirrors:
http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz

Sources:
http://java.dzone.com/articles/installing-maven-304-ubuntu

https://help.ubuntu.com/community/EnvironmentVariables

http://maven.apache.org/download.htmlhttp://maven.apache.org/download.html

Sunday, October 14, 2012

Installing Netbeans on Ubuntu 12.04


The catch with doing anything in Java on Ubuntu is always the same - Ubuntu doesn't ship with Oracle’s Java installed. Instead, Ubuntu ships with Open JDK installed. Open JDK is an open source version of Java.

Some may argue that you can develop with and probably run Netbeans with Open JDK. That may be the case, for me I find the Oracle Java to be more trustworthy for production environment so will be using the Oracle bits. This is simply a matter of opinion.

Installing Netbeans on Ubuntu then requires two steps - installing the latest Oracle JDK and then installing Netbeans.

Installing Oracle JDK


Apt-get needs to be configured to point to a ppa that will take care of the heavy lifting. Note that I am running the 32 bit version. The 64 bit version is likely different. Open a terminal and execute the following:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


Installing Netbeans


  1. Grab the version of Netbeans you are looking for here: http://netbeans.org/downloads/
  2. Use the File Manager to navigate to the Downloads folder and locate the *.sh file.
  3. Make the file executable (you can also do this with chmod +x):
    1. Right-click the file and open Properties.
    2. Click the Permissions tab and check “Allow executing file as program.”
    3. Apply
  4. Rename the file to something easier to manage (i.e. netbeans7.sh)
  5. Open a Terminal and cd to Downloads.
  6. run ./netbeans.sh
  7. Follow the on-screen prompts.
  8. Note that Netbeans will put a shortcut on the Desktop for you.




Sources:

http://www.ubuntugeek.com/how-to-install-oracle-java-7-in-ubuntu-12-04.html