Bouncy castle Configuration for JDK 7

Bouncy castle Configuration for JDK 7

Download the JDK 7 first from official website.
The file name is jdk-7u65-macosx-x64.dmg right now, that is the latest version.

After Install that dmg file, then remove all the java command file in my current path
>sudo rm -fr /usr/bin/java*

Add these things to class path
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
export PATH="$JAVA_HOME/bin:$PATH"

If we plan to rollback to jdk1.6, just find the first line, and change the version to -v 1.6.

Check the JAVA_HOME and java version
>echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home
>java -version java version "1.7.0_65" Java(TM) SE Runtime Environment (build 1.7.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Do not forget to link java file again for eclipse and other IDE.
>sudo ln -s /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java /usr/bin/java

But after change my jdk to 1.7, my grails test-app can not pass anymore.
Error Message
 should have failed with an exception of type com.digby.lmm.reports.exceptions.InvalidSpecificationException, instead got Exception java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile 

Solution:
There is some solutions in 
http://www.pongasoft.com/blog/yan/java/2013/03/31/how-to-fix-incompatibleclasschangeerror-with-groovy-on-jdk7/

But I do not think I will change codes.

By the way, the latest bouncy castle file is here: http://downloads.bouncycastle.org/java/bcprov-jdk15on-150.jar



References:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
http://www.pongasoft.com/blog/yan/java/2013/03/31/how-to-fix-incompatibleclasschangeerror-with-groovy-on-jdk7/


猜你喜欢

转载自sillycat.iteye.com/blog/2092962