Ubuntu Rebuild Environment(1)

iamjiyu 2014-07-09

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.
>make prefix=/home/carl/tool/git-2.0.1 all
>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
>git config --global credential.helper "cache --timeout=360000"

Install JAVA
>sudo add-apt-repository ppa:webupd8team/java
>sudo apt-get update
>sudo apt-get install oracle-java6-installer

if you want to install java 7

>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]---> [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]----> [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
>sudo apt-add-repository ppa:chris-lea/node.js
Update the source and install the nodejs again. Then we should have the latest version.
>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:
>grunt --version
axconfig: port 1 not activeaxconfig: port 2 not active
Solution:
>sudo apt-get remove --purge node
>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
>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?
>sudo apt-get install ia32-libs

Setup Mysql 5.6
>sudo apt-get install software-properties-common
>sudo add-apt-repository ppa:ondrej/mysql-5.6
>sudo apt-get update>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/

相关推荐