Posts

Showing posts from July, 2015

How to install and switch between multi JDK?

How to install and switch between multi JDK? Table of Contents How to install and switch between multi JDK? Linux Mac OS X Common incompatible errors between different version 1 How to install and switch between multi JDK? I suppose that you are installed both java 7 and 8 into your system. So how to switch between them. 1.1 Linux # !/bin/ bash # java1.7.sh # source java1.7.sh to switch jdk 1.7 export JAVA_HOME = "/opt/tools/jdk1.7.0_60" export CLASSPATH =.:${ JAVA_HOME }/lib:${ CLASSPATH } export JDK_HOME = "/opt/tools/jdk1.7.0_60" export PATH = "/opt/tools/jdk1.7.0_60/bin" :${ PATH } # !/bin/ bash # source java1.8.sh to switch to JDK 1.8 export JAVA_HOME = "/opt/tools/jdk1.8.0_05" export CLASSPATH =.:${ JAVA_HOME }/lib:${ CLASSPATH } export JDK_HOME = "/opt/tools/jdk1.8.0_05" export PATH = "/opt/tools/jdk1.8.0_05/bin" :${ PATH } 1.2 Mac OS X # ~/.bash_profile

Android UnitTest

Android UnitTest Table of Contents kinds of Unit Tests in Android Android Instrument Test Junit Test the Demo Unit Test was always the most import part of a project, especially for Object-oriented programming like Java codes, and also was the necessary part of Test-Driven Development technology. But how to process test-driven technology in Android app developement, we all know that android app is based on Java code, and the thought of TDD was in the blood of Java. There are must be some ways to do TDD in Android, and this article will guide you to the Unit test in Android Development. 1 kinds of Unit Tests in Android There are two levels of Unit Test in Android, Android Instrument Test, which running in the Android Devices; and Junit Test, which running without any Android environment. The key difference between two of them are the dependency on the android.jar, in other word, the Android API. We develop android app by import the dependency of android.jar, whi