---
title: "Ubuntu Rebuild Environment(1)"
author: "sillycat"
date: "2014-07-09T22:25:36Z"
tags: []
categories: ["企业架构"]
slug: "ubuntu-rebuild-environment-1"
draft: false
lastmod: "2014-07-09T22:25:36Z"
id: 2090147
url: "https://sillycat.iteye.com/blog/2090147"
---

Ubuntu Rebuild Environment(1)

Recently I get a very powerful laptop from my company. 16G memory mac book. So I install ubuntu virtual client on my host machine.

My plan is to working in ubuntu system again. In the old days, I use ubuntu for almost 2 years for work, I like the old days. So I plan to work with grails on ubuntu desktop, hadoop/openstack and other service sides on ubuntu server, ios on macbook, android also on ubuntu desktop. Since our prod environment is debian, maybe in the future, I will use a debian too.

First step is to build the develop environment, let's rock and roll.

**Install and Set up Git**  
Download the source from here.  
https://www.kernel.org/pub/software/scm/git/

Here is the command to build them.  
&gt;make prefix=/home/carl/tool/git-2.0.1 all  
&gt;sudo make prefix=/home/carl/tool/git-2.0.1 install  
After that, link it to my working directory, add it to path

Set git to remember the username and password  
&gt;git config --global credential.helper "cache --timeout=360000"

**Install JAVA**  
&gt;sudo add-apt-repository ppa:webupd8team/java  
&gt;sudo apt-get update  
&gt;sudo apt-get install oracle-java6-installer

if you want to install java 7

&gt;sudo apt-get install oracle-java7-installer

**Install intellij**  
when I start the intellij, I get this error Message  
'tools.jar' seems to be not in IDEA classpath.  
Please ensure JAVA\_HOME points to JDK rather than JRE.

Solution:  
I change the path configuration from  
export JAVA\_HOME=$(dirname $(dirname $(readlink -f /usr/bin/java)))  
to   
export JAVA\_HOME=/usr/lib/jvm/java-6-oracle

alt+1, open the project window.

Open Menu \[File]---&gt; \[Project Structure]

**Install Scala**  
Download different version of Scala from here  
http://www.scala-lang.org/downloads 

And some versions are here.  
http://www.scala-lang.org/files/archive/

**Set up the Sublime3**  
Open the Menu \[Preferences]----&gt; \[Key binding - user], and put these key short-cut there.  
\[ { "keys": \["shift+enter"], "command": "run\_macro\_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, { "keys": \["alt+up"], "command": "swap\_line\_up" }, { "keys": \["alt+down"], "command": "swap\_line\_down" }, { "keys": \["ctrl+alt+j"], "command": "join\_lines" }, { "keys": \["ctrl+alt+down"], "command": "duplicate\_line" }, { "keys": \["shift+ctrl+r"], "command": "show\_overlay", "args": {"overlay": "goto", "show\_files": true} }, { "keys": \["ctrl+shift+s"], "command": "save\_all" }, { "keys": \["ctrl+l"], "command": "show\_overlay", "args": {"overlay": "goto", "text": ":"} }, { "keys": \["shift+ctrl+f4"], "command": "close\_all" }, { "keys": \["shift+ctrl+y"], "command": "lower\_case" }, { "keys": \["shift+ctrl+x"], "command": "upper\_case" }, { "keys": \["ctrl+d"], "command": "run\_macro\_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }]

**Setup NodeJS**  
&gt;sudo apt-add-repository ppa:chris-lea/node.js  
Update the source and install the nodejs again. Then we should have the latest version.  
&gt;node --version  
v0.10.29

**Setup Yoman**  
Follow this blog and install all of them http://sillycat.iteye.com/blog/2077743  
Error Message as follow:  
&gt;grunt --version  
axconfig: port 1 not activeaxconfig: port 2 not active  
Solution:  
&gt;sudo apt-get remove --purge node  
&gt;sudo apt-get clean  
**Setup Eclipse**  
Actually, we are using old grails 1.3.7 which build based on groovy 1.7. The best tool is groovy grails tool suite 3.1.0, but I can not download that from the official website anymore.   
So here is what I did.  
First download eclipse 3.7 from here http://archive.eclipse.org/eclipse/downloads/  
Then install groovy plugin-in from here   
http://groovy.codehaus.org/Groovy-Eclipse+2.5.2+New+and+Noteworthy

http://dist.springsource.org/release/GRECLIPSE/e3.7/  
And do remember to un-check the checkbox 'sort by category', then we can see groovy-compiler 1.7.10. and install it.

Go here and install the grails plugin  
http://spring.io/tools/ggts/all

http://dist.springsource.com/release/TOOLS/update/e3.7/

**Install Gradle**  
Download the file from here  
https://downloads.gradle.org/distributions/gradle-1.12-bin.zip

**Setup Android Tool**  
Download the Android SDK from here  
https://dl.google.com/android/android-sdk\_r23-linux.tgz

Unzip and Install, add to the path  
&gt;android

Download and Install all the tools there.

Error Message:  
Cannot run programe "/opt/android-sdk/build-tools/20.0.0/aapt":java.io.Exception

Solution:  
http://stackoverflow.com/questions/16588969/android-hello-world-compile-error-intellij-cannot-find-aapt

64-bit system can not run the 32-bit aapt. Is that true?  
&gt;sudo apt-get install ia32-libs

**Setup Mysql 5.6**  
&gt;sudo apt-get install software-properties-common  
&gt;sudo add-apt-repository ppa:ondrej/mysql-5.6  
&gt;sudo apt-get update&gt;sudo apt-get install mysql-server  
**Setup sbt**  
Download the version file we need from here  
http://repo.typesafe.com/typesafereadonly/ivy-releases/org.scala-sbt/sbt-launch/  
create a file sbt with these content  
SBT\_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"java $SBT\_OPTS -jar \`dirname $0\`/sbt-launch.jar "$@"

**References:**  
http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-github  
http://blog.icoloma.com/2011/10/eclipse-shortcuts-for-sublime-text-2.html  
http://spring.io/tools/ggts/all  
http://docs.codehaus.org/display/GROOVY/Compiler+Switching+within+Groovy-Eclipse  
http://groovy.codehaus.org/Eclipse+Plugin#EclipsePlugin-GroovycompilerCompatibility  
https://rtcamp.com/tutorials/nodejs/node-js-npm-install-ubuntu/