JAVA JDK Version
http://baike.baidu.com/view/25214.htm#sub5047948
版本
|
名称
|
发行日期
|
JDK 1.1.4
|
Sparkler(宝石)
|
1997-09-12
|
JDK 1.1.5
|
Pumpkin(南瓜)
|
1997-12-13
|
JDK 1.1.6
|
Abigail(阿比盖尔–女子名)
|
1998-04-24
|
JDK 1.1.7
|
Brutus(布鲁图–古罗马政治家和将军)
|
1998-09-28
|
JDK 1.1.8
|
Chelsea(切尔西–城市名)
|
1999-04-08
|
J2SE 1.2
|
Playground(运动场)
|
1998-12-04
|
J2SE 1.2.1
|
none(无)
|
1999-03-30
|
J2SE 1.2.2
|
Cricket(蟋蟀)
|
1999-07-08
|
J2SE 1.3
|
Kestrel(美洲红隼)
|
2000-05-08
|
J2SE 1.3.1
|
Ladybird(瓢虫)
|
2001-05-17
|
J2SE 1.4.0
|
Merlin(灰背隼)
|
2002-02-13
|
J2SE 1.4.1
|
grasshopper(蚱蜢)
|
2002-09-16
|
J2SE 1.4.2
|
Mantis(螳螂)
|
2003-06-26
|
Java SE 5.0 (1.5.0)
|
Tiger(老虎)
|
2004-09-30
|
Java SE 6.0 (1.6.0)
|
Mustang(野马)
|
2006-04
|
Java SE 7.0 (1.7.0)
|
Dolphin(海豚)
|
2011-07-28
|
Java SE 8.0 (1.8.0)
|
未知
|
2013-09(预定)
|
JAVA JDK 稳定版本下载 / JAVA JDK 老版本下载 / JAVA JDK 旧版本下载
http://www.oracle.com/technetwork/java/javase/archive-139210.html
http://101.96.10.75/download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-windows-x64.exe
Oracle JAVA JDK 7
http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-windows-x64.exe
http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-macosx-x64.dmg
http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-linux-x64.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u10-b18/jdk-7u10-windows-i586.exe
http://download.oracle.com/otn-pub/java/jdk/7u10-b18/jdk-7u10-windows-x64.exe
http://download.oracle.com/otn-pub/java/jdk/7u10-b18-demos/jdk-7u10-windows-x64-demos.zip
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-i586.rpm
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-i586.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-x64.rpm
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-x64.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-arm.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-macosx-x64.dmg
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-i586.tar.Z
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-i586.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-sparc.tar.Z
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-sparc.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-sparcv9.tar.Z
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-sparcv9.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-x64.tar.Z
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-solaris-x64.tar.gz
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-windows-i586.exe
http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-windows-x64.exe
Oracle JAVA JDK 6
http://download.oracle.com/otn/java/jdk/6u37-b06/jdk-6u37-linux-x64.binhttp://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-x64.bin
http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-windows-x64.exe
http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-windows-i586.exe
IBM JAVA JDK 6 / 7 / 8
id:[email protected]http://www.ibm.com/developerworks/java/jdk/index.html
http://www.ibm.com/developerworks/java/jdk/beta/index.html
http://www.ibm.com/developerworks/java/jdk/linux/download.html
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp
http://publib.boulder.ibm.com/infocenter/java7sdk/v7r0/index.jsp
https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=swg-beta-ibmjte&S_PKG=dl&lang=en_US&cp=UTF-8
SDK Installable package (InstallAnywhere)
ibm-java-x86_64-sdk-ea-8.0-0.0.bin (119 MB)
SDK tgz package (InstallAnywhere)
ibm-java-sdk-ea-8.0-0.0-x86_64-archive.bin (119 MB)
Java SE Version 6 | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
J2SE Version 5.0 | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
J2SE Version 1.4.2 | ||||||||||||||||||||||||||||||||||||
SR13 FP4 is Service Refresh 13 Fix Pack 4. See the FAQ Java Service Refreshes and Service Refresh Fix Packs for more information. J2SE 1.4.1 has been replaced by J2SE 1.4.2. There will be no further 1.4.1 updates. |
||||||||||||||||||||||||||||||||||||
J2SE Version 1.3.1 | ||||||||||||||||||||||||||||||||||||
|
Java7带来的新的语言特性
http://www.iteye.com/topic/1111973
1。二进制字面量值
// An 8-bit 'byte' value:
- byte aByte = ( byte )0b00100001;
- // A 16-bit 'short' value:
- short aShort = ( short )0b1010000101000101;
- // Some 32-bit 'int' values:
- int anInt1 = 0b10100001010001011010000101000101;
- int anInt2 = 0b101;
- int anInt3 = 0B101; // The B can be upper or lower case.
- // A 64-bit 'long' value. Note the "L" suffix:
- long aLong = 0b1010000101000101101000010100010110100001010001011010000101000101L;
2.可以在数字字面量中使用"下划线"("_")
- long creditCardNumber = 1234_5678_9012_3456L;
- long socialSecurityNumber = 999_99_9999L;
- float pi = 3 .14_15F;
- long hexBytes = 0xFF_EC_DE_5E;
- long hexWords = 0xCAFE_BABE;
- long maxLong = 0x7fff_ffff_ffff_ffffL;
- byte nybbles = 0b0010_0101;
- long bytes = 0b11010010_01101001_10010100_10010010;
要注意的是,下划线放在以下几个地方是不正确的:
(1).最前面; 如_52 ,这不是数字字面量,而是也是变量名了
(2).小数点的两边; 如float pi1 = 3_.1415F 和 float pi1 = 3._1415F 都是不正确的
(3).最后面; 如int x3 = 52_;
(4).不能放在0x这样前缀的中间,如:int x5 = 0_x52;
3.可以在switch语句中使用String类型的变量
- public String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) {
- String typeOfDay;
- switch (dayOfWeekArg) {
- case "Monday" :
- typeOfDay = "Start of work week" ;
- break ;
- case "Tuesday" :
- case "Wednesday" :
- case "Thursday" :
- typeOfDay = "Midweek" ;
- break ;
- case "Friday" :
- typeOfDay = "End of work week" ;
- break ;
- case "Saturday" :
- case "Sunday" :
- typeOfDay = "Weekend" ;
- break ;
- default :
- throw new IllegalArgumentException( "Invalid day of the week: " + dayOfWeekArg);
- }
- return typeOfDay;
- }
4.类型推断,泛型构造器和非泛型的Classes
(Type Inference and Generic Constructors of Generic and Non-Generic Classes)
首先看一个泛型构造器和类型推断的例子:
- class MyClass
{ -
MyClass(T t) { - // ...
- }
- }
这里X是泛型类MyClass
那怎么样实例化它呢?
new MyClass
接下来看下面这两种例子:
1.MyClass
在这里例子中,编译器推断Integer为泛型类MyClass
2.MyClass
在这里例子中,编译器推断Integer为泛型类MyClass
5. Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods不知道怎么翻译。 “当在可变长参数方法中使用不可具体化的参数时改良的警告和错误”,行么?
6.带有资源的try语句
The try-with-resources Statement
一个带有资源的try语句就是一个声明了一个或者多个资源的 try语句,资源是指当程序结束后必须关闭的对象。带有资源的try语句保证在语句结束的时候每个资源都会被关闭(调用其close()方法)。任何实现 了java.lang.AutoCloseable 或者 java.io.Closeable接口的对象都可以被用作为一个资源。
下面这个例子的作用是从一个文件中读取第一行。使用了一个BufferedReader从文件中读取数据,在这里BufferedReader就是一个在程序结束后必须关闭的资源。
- static String readFirstLineFromFile(String path) throws IOException {
- try (BufferedReader br = new BufferedReader( new FileReader(path))) {
- return br.readLine();
- }
- }
上面说到可以在try语句中声明一个或多个资源,下面就是一个声明了多个资源的try语句,它的功能是获得打包在zip文件中的所有文件的文件名,然后把这些文件名保存到一个txt文件中。
- public static void writeToFileZipFileContents(String zipFileName, String outputFileName)
- throws java.io.IOException {
- java.nio.charset.Charset charset = java.nio.charset.Charset.forName("US-ASCII" );
- java.nio.file.Path outputFilePath = java.nio.file.Paths.get(outputFileName);
- // Open zip file and create output file with try-with-resources statement
- try (
- java.util.zip.ZipFile zf = new java.util.zip.ZipFile(zipFileName);
- java.io.BufferedWriter writer = java.nio.file.Files.newBufferedWriter(outputFilePath, charset)
- ) {
- // Enumerate each entry
- for (java.util.Enumeration entries = zf.entries(); entries.hasMoreElements();) {
- // Get the entry name and write it to the output file
- String newLine = System.getProperty("line.separator" );
- String zipEntryName = ((java.util.zip.ZipEntry)entries.nextElement()).getName() + newLine;
- writer.write(zipEntryName, 0 , zipEntryName.length());
- }
- }
- }
大家需要知道的是,一个带有资源的try语句和普通的try语句一样可以有catch和finally语句块,但是任何catch或者finally块都是在所有的资源关闭后才执行的。
7.捕捉复合(Multiple)异常类型以及使用改良的类型检查重掷(Rethrowing)异常
在Java6以及以前版本一般我们这样捕获多个类型的异常:
- catch (IOException ex) {
- logger.log(ex);
- throw ex;
- catch (SQLException ex) {
- logger.log(ex);
- throw ex;
- }
在Java7里可以这么干:
- catch (IOException|SQLException ex) {
- logger.log(ex);
- throw ex;
- }
下面看一个抛出异常的例子:
JDK6及以前版本:
- static class FirstException extends Exception { }
- static class SecondException extends Exception { }
- public void rethrowException(String exceptionName) throws Exception {
- try {
- if (exceptionName.equals( "First" )) {
- throw new FirstException();
- } else {
- throw new SecondException();
- }
- } catch (Exception e) {
- throw e;
- }
- }
JDK7:
- public void rethrowException(String exceptionName)
- throws FirstException, SecondException {
- try {
- // ...
- }
- catch (Exception e) {
- throw e;
- }
- }
Java7异常新特性之mutilcatch
http://c-zhiwu.iteye.com/blog/975253
Java7增强了Java的异常处理机制,主要表现为三个方面:捕捉多种异常类型(multicatch);重新抛出(rethrow)异常;简化资源清理(try-with-resources)
捕捉多种异常类型
从Java7开始,你就可以在一个catch块中捕捉多种类型的异常了。增加multicatch的特性的主要是为了降低重复代码和较少过大范围的异常捕捉(例如这样的捕捉 catch(Exception e))。
假如你正开发这样一个应用程序,这个程序可以灵活地将数据复制到数据库或者文件中,清单1(CopyToDatabaseOrFile.java)模拟了这种程序, 展示了在catch模块中存在重复代码的现象:
- // CopyToDatabaseOrFile.java
- import java.io.IOException;
- import java.sql.SQLException;
- public class CopyToDatabaseOrFile {
- public static void main(String[] args) {
- try {
- copy();
- } catch (IOException ex) {
- System.out.println(ex.getMessage()); // additional handler code
- } catch (SQLException ex) {
- System.out.println(ex.getMessage()); // additional handler code that's identical to the previous handler's // code
- }
- }
- static void copy() throws IOException, SQLException {
- if (Math.random() < 0.5 )
- throw new IOException( "cannot copy to file" );
- else
- throw new SQLException( "cannot copy to database" );
- }
- }
清单1: CopyToDatabaseOrFile.java
Java7克服了这种代码重复的问题。你只需在一个catch块中指定多个需要处理的异常,将这些异常按顺序排列,并用“|”分隔每个异常。如:
- try {
- copy();
- }catch (IOException | SQLException ex){
- System.out.println(ex.getMessage());
- }
现在,当copy()方法抛出任何一种类型,都会在catch块中被捕捉。
当在catch中声明多种异常时,被声明的异常默认为final的,也就是说不能再修改异常的引用。如上例中,不能再将ex赋值给另外一个异常(如ex=new MyException())。
java jdk keytool
C:\Program Files\Java\jdk1.7.0_11\bin\keytool.exe
[lindows@Loadrunner19 ~]$ ll /opt/soft/jdk1.7.0_11/bin/keytool
-rwxrwxrwx 1 lindows lindows 7957 Jan 12 18:05 /opt/soft/jdk1.7.0_11/bin/keytool
tomcat7 开启https ,使用JDK 7的keytool 生成tomcat证书
http://lixor.iteye.com/blog/1532655
C:\Program Files\Java\jdk1.7.0_11\bin>keytool -v -genkey -alias tomcat -keyalg RSA -keystore d:/tomcat.keystore
C:\Program Files\Java\jdk1.7.0_11\bin>keytool.exe -help
- 密钥和证书管理工具
- 命令:
- -certreq 生成证书请求
- -changealias 更改条目的别名
- -delete 删除条目
- -exportcert 导出证书
- -genkeypair 生成密钥对
- -genseckey 生成密钥
- -gencert 根据证书请求生成证书
- -importcert 导入证书或证书链
- -importkeystore 从其他密钥库导入一个或所有条目
- -keypasswd 更改条目的密钥口令
- -list 列出密钥库中的条目
- -printcert 打印证书内容
- -printcertreq 打印证书请求的内容
- -printcrl 打印 CRL 文件的内容
- -storepasswd 更改密钥库的存储口令
- 使用 "keytool -command_name -help" 获取 command_name 的用法
C:\Program Files\Java\jdk1.7.0_11\bin>keytool.exe -genkey -help
- keytool -genkeypair [OPTION]...
- 生成密钥对
- 选项:
- -alias
要处理的条目的别名 - -keyalg
密钥算法名称 - -keysize
密钥位大小 - -sigalg
签名算法名称 - -destalias
目标别名 - -dname
唯一判别名 - -startdate
证书有效期开始日期/时间 - -ext
X.509 扩展 - -validity
有效天数 - -keypass
密钥口令 - -keystore
密钥库名称 - -storepass
密钥库口令 - -storetype
密钥库类型 - -providername
提供方名称 - -providerclass
提供方类名 - -providerarg
提供方参数 - -providerpath
提供方类路径 - -v 详细输出
- -protected 通过受保护的机制的口令
- 使用 "keytool -help" 获取所有可用命令
linux jdk7 keytool
[lindows@Loadrunner19 ~]$ /opt/soft/jdk1.7.0_11/bin/keytool --help
- Key and Certificate Management Tool
- Commands:
- -certreq Generates a certificate request
- -changealias Changes an entry's alias
- -delete Deletes an entry
- -exportcert Exports certificate
- -genkeypair Generates a key pair
- -genseckey Generates a secret key
- -gencert Generates certificate from a certificate request
- -importcert Imports a certificate or a certificate chain
- -importkeystore Imports one or all entries from another keystore
- -keypasswd Changes the key password of an entry
- -list Lists entries in a keystore
- -printcert Prints the content of a certificate
- -printcertreq Prints the content of a certificate request
- -printcrl Prints the content of a CRL file
- -storepasswd Changes the store password of a keystore
- Use "keytool -command_name -help" for usage of command_name
[root@Loadrunner19 bin]# /usr/bin/keytool -?
- Unrecognized command: --help
- Usage: keytool [COMMAND] [-- COMMAND]...
- Manage private keys and public certificates.
- Available commands:
- -genkey Generate a Key Entry, eventually creating a key store.
- [-alias ALIAS] [-keyalg ALGORITHM] [-keysize KEY_SIZE]
- [-sigalg ALGORITHM] [-dname NAME] [-keypass PASSWORD]
- [-validity DAY_COUNT] [-storetype STORE_TYPE]
- [-keystore URL] [-storepass PASSWORD]
- [-provider PROVIDER_CLASS_NAME] [-v].
- -import Add Key Entries and Trusted Certificates.
- [-alias ALIAS] [-file FILE] [-keypass PASSWORD]
- [-noprompt] [-trustcacerts] [-storetype STORE_TYPE]
- [-keystore URL] [-storepass PASSWORD]
- [-provider PROVIDER_CLASS_NAME] [-v].
- -selfcert Generate a self-signed Trusted Certificate.
- [-alias ALIAS] [-sigalg ALGORITHM] [-dname NAME]
- [-validity DAY_COUNT] [-keypass PASSWORD]
- [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -identitydb NOT IMPLEMENTED YET. Import JDK1.1 Identity Database.
- [-file FILE] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -certreq Issue a Certificate Signing Request (CSR).
- [-alias ALIAS] [-sigalg ALGORITHM] [-file FILE]
- [-keypass PASSWORD] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v]
- [-attributes].
- -export Export a Certificate from a key store.
- [-alias ALIAS] [-file FILE] [-storetype STORE_TYPE]
- [-keystore URL] [-storepass PASSWORD]
- [-provider PROVIDER_CLASS_NAME] [-rfc] [-v].
- -list Print one or all Certificates in a key store to STDOUT.
- [-alias ALIAS] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME]
- [-rfc] [-v].
- -printcert Print a human-readable form of a Certificate in a FILE.
- [-file FILE] [-v].
- -keyclone Clone a Key Entry in a key store.
- [-alias ALIAS] [-dest ALIAS] [-keypass PASSWORD]
- [-new PASSWORD] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -storepasswd Change the password protecting a key store.
- [-new PASSWORD] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -keypasswd Change the password protecting a Key Entry in a key store.
- [-alias ALIAS] [-keypass PASSWORD] [-new PASSWORD]
- [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -delete Delete a Key Entry or a Trusted Certificate from a key store.
- [-alias ALIAS] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- -cacert Import a CA's Trusted Certificate.
- [-file FILE] [-storetype STORE_TYPE] [-keystore URL]
- [-storepass PASSWORD] [-provider PROVIDER_CLASS_NAME] [-v].
- Standard options:
- -help print this help, then exit
- -version print version number, then exit
- -JOPTION pass argument to the Java runtime
- Please report bugs at http://www.gnu.org/software/classpath/bugs.html
JDK内置工具使用
http://blog.csdn.net/fenglibing/article/details/6411999
JDK内置工具使用
一、javah命令(C Header and Stub File Generator)
二、jps命令(Java Virtual Machine Process Status Tool)
三、jstack命令(Java Stack Trace)
四、jstat命令(Java Virtual Machine Statistics Monitoring Tool)
五、jmap命令(Java Memory Map)
六、jinfo命令(Java Configuration Info)
七、jconsole命令(Java Monitoring and Management Console)
八、jvisualvm命令(Java Virtual Machine Monitoring, Troubleshooting, and Profiling Tool)
九、jhat命令(Java Heap Analyse Tool)
十、Jdb命令(The Java Debugger)
十一、参考
http://www.renren.it/a/JAVAbiancheng/JAVAzonghe/20110511/jni-example.html
http://blog.csdn.net/gtuu0123/archive/2010/11/27/6039474.aspx
http://blog.csdn.net/kelly859/archive/2010/07/30/5775318.aspx
http://www.51testing.com/?uid-77492-action-viewspace-itemid-203728
http://blog.csdn.net/dengmc/archive/2009/05/13/4174738.aspx
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstat.html
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jmap.html
http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html
end