了解了51.0 这个数字的意义后,继续google,看到这条:解决Unsupported major.minor version 51.0问题的感悟,涉及到build path 和compiler compliance level的问题:the version number shown describes the version of the JRE the class file is compatible with.The reported major numbers are: J2SE 8 = 52, J2SE 7 = 51, J2SE 6.0 = 50, J2SE 5.0 = 49, JDK 1.4 = 48, JDK 1.3 = 47, JDK 1.2 = 46, JDK 1.1 = 45 (source: http://en.wikipedia.org/wiki/Java_class_file ) To fix the actual problem you should try to either run the Java code with newer version Java JRE or
specify target parameter to the Java compiler to instruct the compiler to create code compatible with
earlier Java versions. For example in order to to generate class files compatible with Java 1.4, use the following command line: javac -source 1.4 HelloWorld.java
With newer versions of Java compiler you are likely to get a warning about bootstrap class path not
being set. More information about this error is available at:
https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
昨天偶然又维护一个新浪微博同步的代码,突然发现自己的测试类同步不出去了~,报错如下:
1 |
ERROR: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: basic constraints check failed: pathLenConstraint violated -
this cert must be the last cert in the certification path |
看见security下面的异常就心里一紧,这貌似是oauth2.0协议的https请求导致的,而且请求没有发送出去就报错了。然后google,百度,微博各种搜索
微博的开放平台提问上看到有大神回复:强制httpclient信任任何证书就可以了。
但是纯文字的微博我用的jdk里的urlconnection,不知道怎么强制信任证书,http头文件中也没找到相关设置,大神们看到可以教下小菜我试一下这个方法可不可行。
PKIX path validation failed 以及Unsupported major.minor version 51.0问题
原文:http://blog.csdn.net/ye1992/article/details/18410117