반응형

JAVA 8 이후 변경된점

Java 9

  • The Java Platform Module System introduces a new kind of Java programing component, the module, which is a named, self-describing collection of code and data. The JDK itself has been divided into a set of modules
  • The jlink tool is used to assemble modules and their dependencies into a reduced runtime package, and perform optimizations during the new link time phase after the compile time phase
  • jshell is a Read-Eval-Print Loop (REPL) tool for the Java platform. Can be used to interactively evaluate input code and print the results
  • Multi-Release JAR Files: Enables multiple, Java release-specific versions of class files to coexist in a single archive
  • Private methods can be defined in interfaces. They can be used for example by the default methods of an interface to refactor code
  • Factory methods for collections, such as Set.of and List.of
  • G1 is made the default garbage collector

Java 10

  • Local-Variable Type Inference using the keyword var, a way to automatically deduce the type of a local variable without declaring it. var set = new HashSet<String>(); is now a valid expression.

  • A new method orElseThrow has been added to the Optional class

  • New APIs for creating unmodifiable collections such as List.copyOf, Set.copyOf, and Map.copyOf

  • Performance optimization for the G1 garbage collector by using a Parallel Full GC

Java 11

  • Finalization of the HTTP Client API
  • Added the ability to launch single-file source-code programs: useful in the early stages of learning Java, and when writing utility programs
  • Local-Variable Syntax for Lambda Parameters: The var keyword can be used when declaring the formal parameters of implicitly typed lambda expressions
  • Removed modules that contain CORBA and Java EE technologies such as JAX-WS and JAXB
  • Flight Recorder: A profiling and monitoring tool with a very low-overhead used to record events originating from Java applications and the OS

 

Nest 기반 접근 제어

Nest-based access controls. Nest 는 접근 제어 컨텍스트로 논리적으로는 같은 클래스를 분리된 클래스로 컴파일할 수 있게 해줍니다. 그러면 다른 클래스의 private 멤버에 getter/setter 없이 바로 접근 가능합니다. 여러 클래스를 하나의 클래스처럼 묶어줄 수 있는 기술로 보입니다.

 

새로운 가비지 컬렉터

ZGC: A Scalable Low-Latency Garbage Collector (Experimental). 성능을 향상시킨 새로운 가비지 컬렉터(Carbage Collector)입니다. 메모리를 자동으로 정리해주는 가비지 컬렉터는 자바의 장점 중 하나이지만, 가비지 컬렉터가 동작할 때 JVM이 애플리케이션을 멈추기 때문에 자바의 단점이기도 합니다. ZGC는 이 시간을 10ms 미만으로 줄이고 15% 이하의 성능 페널티를 목표로 합니다.

  • GC 일시 중지 시간은 10ms를 초과하지 않는다.
  • 작은 크기(수백 메가) ~ 매우 큰 크기(수 테라) 범위의 힙을 처리한다.
  • G1에 비해 애플리케이션 처리량이 15%이상 감소하지 않는다.
  • 향후 GC 최적화를 위한 기반 마련.
  • 처음에는 Linux / x64을 지원 (향후 추가 플랫폼 지원 가능).

Flight Recorder

Flight Recorder. 자바 애플리케이션과 HotSpot JVM의 문제 해결을 위한 오버헤드가 낮은 데이터 수집 프레임워크입니다. 이전에는 유료 기능이었지만 오픈소스로 공개되었습니다.

새로운 표준 HTTP 라이브러리

HTTP Clinet(Standard). java.net.http 패키지의 새로운 모듈로 flow 기반의 HTTP/1.1과 HTTP/2를 지원합니다. 자바 9과 자바 10에서 사용되었던 jdk.incubator.http 패키지가 표준화되어 java.net.http 패키지로 추가되었습니다.

  • Non-Blocking request and response 지원 (with CompletableFuture)
  • Backpressure 지원(java.util.concurrent.Flow 패키지를 통해 RX Flow를 구현체에 적용)
  • HTTP/2 지원
  • Factory method 형태로 지원

TLS 1.3

Transport Layer Security (TLS) 1.3. TLS 이전 포스트에서 살펴봤던 것처럼 SSL(Secure Socket Layer)의 표준 이름이죠. TLS의 새로운 버전을 구현했습니다.

람다에서의 var 변수

Local-Variable Syntax for Lambda Parameters. 자바 10에서 도입된 var 타입 추론을 업데이트했습니다.

Launch Single-File Source-Code Programs

단일 실행 파일로 제공되는 프로그램을 실행할 수 있도록, Java Launcher를 개선하는 feature입니다. shebang 파일(유닉스 계열 OS에서, 프로그램으로 실행되는 스크립트 파일임을 나타내는 구문)을 인식할 수 있도록 하는 것인데요, 이 파일을 인식하기 위해서 JLS(Java Launguage Specification) 또는, javac를 변경하거나 Java를 범용 스크립팅 언어로 개발하는 것이 목표는 아닙니다.

단일 파일 프로그램은 일반적으로, 처음 Java를 학습하는 과정이나 소규모 유틸리티가 필요한 경우에 사용될 수 있지만, 단일 소스파일이 여러 클래스 파일로 컴파일될 수 있으므로, "run this program." 이라는 단순한 목표에 패키징이라는 오버헤드가 추가될 수 있습니다.

"Shebang" files

#!/path/to/java --source 11 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } }

 

 

'JAVA' 카테고리의 다른 글

RestTemplate VS WebClient  (0) 2021.02.24
비동기, 동기, 블로킹, 논블로킹  (0) 2021.02.19
Oracle JDK 라이센스 전환  (0) 2019.10.04
NAVER Search Ad - ADExtensions  (0) 2019.08.13
IntelliJ IDEA (인텔리제이 IDEA)  (0) 2019.05.02

+ Recent posts