What is JDK? Where can I download it?

The full name of jdk8 is Java SE Development Kit8 , which is the core of running the entire Java. It has built-in a bunch of Java tools and Java-based class libraries (rt.jar) and Java Runtime Environment (Java Runtime Envirnment). If you want to run on your computer Java programs must install the ava SE Development Kit to ensure the normal use of the program. Software Academy provides jdk8 download, 32 why 64-bit system installation packages are available, and a tutorial on jdk8 environment variable configuration is attached below.

Required tools: Click to download Java SE Development Kit8(jdk8)

jdk8 download

jdk8 environment variable configuration tutorial

1. Download the software zip file, click on your computer system to the corresponding program "jdk-8u144-windows-x64.exe (64-bit) or jdk-8u144-windows-i586.exe (32-bit)".

2. The program will automatically install the JRE program, just select the directory

3. Until jdk8 is downloaded and installed, click the "Close" button, as shown in the following figure:

4. After installing the JDK, configure the environment variables, Computer → Properties → Advanced System Settings→Advanced→Environment Variables

5. System Variables→New JAVA_HOME Variable
variable value Fill in the installation directory of jdk (I am C:\Program Files\Java\jdk1.8.0_144)

6. System Variables → Find Path variable → Edit
in variable value Finally, enter %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
(note whether there is a ; at the end of the variable value of the original Path, if not, enter the ; first and then enter the above code)

8. Check whether the configuration is successful and run cmd Enter java -version (there is a space between java and -version). If the version information is displayed as shown in the figure, the installation and configuration are successful.

Features

JDK's most important command line tools:
1. java: start JVM to execute class
2, javac: Java compiler
3, jar: Java packaging tool
4, javadoc: Java documentation generator
These command lines must be very, very familiar, for each Parameters must be very proficient Caixing. For the learning of these commands, there are detailed documents on the JDK Documentation.
From a beginner's point of view, using JDK to develop Java programs can quickly understand the relationship between various parts of the code in the program, which is conducive to understanding Java's object-oriented design ideas. Another notable feature of the JDK is that it can be upgraded with each version of Java (J2EE, J2SE, and J2ME). But its disadvantage is also very obvious that it is very difficult to develop large-scale enterprise-level Java applications, and it cannot develop complex Java software, and it is not conducive to collaborative development of groups.
Java language is probably the first choice for network application programming language, thanks to its high security and cross-platform features, you can see the traces of Java on almost all current computer platforms. In the past, many people may have complained that although Java has quite good cross-platform and security protection features, its execution speed is far less than that of various traditional idiomatic programming languages ​​such as C++.

New features of jdk8

一、Lambda表达式
1、Lambda表达式可以说是Java 8最大的卖点,她将函数式编程引入了Java。Lambda允许把函数作为一个方法的参数,或者把代码看成数据。
2、一个Lambda表达式可以由用逗号分隔的参数列表、–>符号与函数体三部分表示。例如:
Arrays.asList( "p", "k", "u","f", "o", "r","k").forEach( e -> System.out.println( e ) );
3、为了使现有函数更好的支持Lambda表达式,Java 8引入了函数式接口的概念。函数式接口就是只有一个方法的普通接口。java.lang.Runnable与java.util.concurrent.Callable是函数式接口最典型的例子。为此,Java 8增加了一种特殊的注解@FunctionalInterface:
二、接口的默认方法与静态方法
1、我们可以在接口中定义默认方法,使用default关键字,并提供默认的实现。所有实现这个接口的类都会接受默认方法的实现,除非子类提供的自己的实现。例如:
2、我们还可以在接口中定义静态方法,使用static关键字,也可以提供实现。例如:
3、接口的默认方法和静态方法的引入,其实可以认为引入了C++中抽象类的理念,以后我们再也不用在每个实现类中都写重复的代码了
三、方法引用
通常与Lambda表达式联合使用,可以直接引用已有Java类或对象的方法。一般有四种不同的方法引用:
1、构造器引用。语法是Class::new,或者更一般的Class< T >::new,要求构造器方法是没有参数;
2、静态方法引用。语法是Class::static_method,要求接受一个Class类型的参数;
3、特定类的任意对象方法引用。它的语法是Class::method。要求方法是没有参数的;
4、特定对象的方法引用,它的语法是instance::method。要求方法接受一个参数,与3不同的地方在于,3是在列表元素上分别调用方法,而4是在某个对象上调用方法,将列表元素作为参数传入;
四、重复注解
在Java 5中使用注解有一个限制,即相同的注解在同一位置只能声明一次。Java 8引入重复注解,这样相同的注解在同一地方也可以声明多次。重复注解机制本身需要用@Repeatable注解。Java 8在编译器层做了优化,相同注解会以集合的方式保存,因此底层的原理并没有变化。
五、扩展注解的支持
Java 8扩展了注解的上下文,几乎可以为任何东西添加注解,包括局部变量、泛型类、父类与接口的实现,连方法的异常也能添加注解。
六、Optional
Java 8引入Optional类来防止空指针异常,Optional类最先是由Google的Guava项目引入的。Optional类实际上是个容器:它可以保存类型T的值,或者保存null。使用Optional类我们就不用显式进行空指针检查了。
七、Stream
Stream API是把真正的函数式编程风格引入到Java中。其实简单来说可以把Stream理解为MapReduce,当然Google的MapReduce的灵感也是来自函数式编程。她其实是一连串支持连续、并行聚集操作的元素。从语法上看,也很像linux的管道、或者链式编程,代码写起来简洁明了,非常酷帅!
八、Date/Time API (JSR 310)
Java 8新的Date-Time API (JSR 310)受Joda-Time的影响,提供了新的java.time包,可以用来替代 java.util.Date和java.util.Calendar。一般会用到Clock、LocaleDate、LocalTime、LocaleDateTime、ZonedDateTime、Duration这些类,对于时间日期的改进还是非常不错的。
九、JavaScript引擎Nashorn
Nashorn允许在JVM上开发运行JavaScript应用,允许Java与JavaScript相互调用。
十、Base64
在Java 8中,Base64编码成为了Java类库的标准。Base64类同时还提供了对URL、MIME友好的编码器与解码器。
十一、除了这十大新特性之外,还有另外的一些新特性:
1、更好的类型推测机制:Java 8在类型推测方面有了很大的提高,这就使代码更整洁,不需要太多的强制类型转换了。
2、编译器优化:Java 8将方法的参数名加入了字节码中,这样在运行时通过反射就能获取到参数名,只需要在编译时使用-parameters参数。
3、并行(parallel)数组:支持对数组进行并行处理,主要是parallelSort()方法,它可以在多核机器上极大提高数组排序的速度。
4、并发(Concurrency):在新增Stream机制与Lambda的基础之上,加入了一些新方法来支持聚集操作。
5. Nashorn engine jjs: Command line tool based on Nashorn engine. It accepts some JavaScript source code as a parameter, and executes the source code.
6. Class dependency analyzer jdeps: It can display package-level or class-level dependencies of Java classes.
7. The JVM's PermGen space is removed: it is replaced by Metaspace (JEP 122).


Changelog
Java SE Development Kit8 8u144

This update contains important security fixes, announcements include disabling SHA-1 TLS server certificates, JMX diagnostic improvements, custom HostnameVerifier enabling SNI extensions, and more.

Java SE Development Kit8(jdk8):http://www.xue51.com/soft/1328.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325564843&siteId=291194637