2013/11/18

Install Mahout on VirtualBox ubuntu under MAC OS

Environments:
MAC OS X 10.9
VirtualBox 4.3.0
ubuntu-13.10-server-i386.iso

1.Install ubuntu on VirtualBox.2GB RAM, 8GB hard disk.
http://www.ubuntu.com/download/server
2.In ubuntu, check the prerequisites for building Mahout.
 
smims@ubuntu:~$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3)
OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)
We have JDK1.7 and it's ok.
 
smims@ubuntu:~$ mvn -version
The program 'mvn' can be found in the following packages:
 * maven
 * maven2
Try: sudo apt-get install <selected package>
The default system environment does not has the maven package.
3.Start to install the Maven package.

 
smims@ubuntu:~$ sudo apt-get install maven
It may takes few minutes to download.
check again after install completed.

 
smims@ubuntu:~$ mvn -version
Warning: JAVA_HOME environment variable is not set.
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: en_HK, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-12-generic", arch: "i386", family: "unix"
4.There is a warning in the first line. JAVA_HOME environment variable is not set.
Add lines to /etc/environment. And exit shell and re-login.
 
smims@ubuntu:~$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
smims@ubuntu:~$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: en_HK, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-12-generic", arch: "i386", family: "unix"
5.Install subversion.
 
smims@ubuntu:~$ sudo apt-get install subversion
6.Download mahout, using svn to get the latest version.
https://cwiki.apache.org/confluence/display/MAHOUT/BuildingMahout
 
smims@ubuntu:~$mkdir mahout
smims@ubuntu:~$cd mahout
smims@ubuntu:~/mahout$ svn co http://svn.apache.org/repos/asf/mahout/trunk
...
smims@ubuntu:~/mahout$ ls -la
total 12
drwxrwxr-x  3 smims smims 4096 Nov 18 12:14 .
drwxr-xr-x  5 smims smims 4096 Nov 18 12:14 ..
drwxrwxr-x 12 smims smims 4096 Nov 18 12:15 trunk
7.Compiling the Mahout using maven.
 
smims@ubuntu:~$ cd mahout/trunk
smims@ubuntu:~/mahout/trunk$ mvn install 
...
But there is a error message.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
...
To fix this, just re-install the jdk and install again. It works just fine.
 
smims@ubuntu:~/mahout/trunk$ sudo apt-get install openjdk-7-jdk
...
smims@ubuntu:~/mahout/trunk$ mvn install 
...
8.At the last few steps, it will automatic test some examples.
 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Mahout Build Tools ................................ SUCCESS [1.373s]
[INFO] Apache Mahout ..................................... SUCCESS [0.368s]
[INFO] Mahout Math ....................................... SUCCESS [2:12.007s]
[INFO] Mahout Core ....................................... SUCCESS [23:55.232s]
[INFO] Mahout Integration ................................ SUCCESS [2:35.669s]
[INFO] Mahout Examples ................................... SUCCESS [9.259s]
[INFO] Mahout Release Package ............................ SUCCESS [0.016s]
[INFO] Mahout Math/Scala wrappers ........................ SUCCESS [1:29.086s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30:23.327s
[INFO] Finished at: Mon Nov 18 13:12:10 CST 2013
[INFO] Final Memory: 42M/129M
[INFO] ------------------------------------------------------------------------

12 comments:

  1. Hey thanks for the step by step tutorial. It went well till near the end and failed at the mahout math test and skipped the rest of the steps there after. Could you have a solution to this?

    ReplyDelete
  2. Maybe you can post the error messages?

    ReplyDelete
  3. whoa! sorry for the late reply. I shall do paste bin.

    ReplyDelete
  4. As promised here is the paste. http://paste.ubuntu.com/7169913/ what could the problem be?

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.

    angularjs Training in chennai
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    ReplyDelete
  7. It was worth visiting your blog and I have bookmarked your blog. Hope to visit again
    Python training in marathahalli | Python training institute in pune

    ReplyDelete
  8. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    advanced excel training in bangalore

    ReplyDelete
  9. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    blueprism training in chennai | blueprism training in bangalore | blueprism training in pune | blueprism online training

    ReplyDelete
  10. I’ve desired to post about something similar to this on one of my blogs and this has given me an idea. Cool Mat.

    Java training in Indira nagar | Java training in Rajaji nagar

    Java training in Marathahalli | Java training in Btm layout

    ReplyDelete
  11. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.

    Data Science training in Chennai | Data science training in bangalore

    Data science training in pune | Data science online training

    Data Science Interview questions and answers

    ReplyDelete