✂️ Java

Small information nuggets and recipies about Java


(most recent on top)

OS X Installation of multiple Java versions

… basic installation

brew tap caskroom/cask
brew install Caskroom/cask/java

… environment management

brew install jenv
# .bash_profile
export JENV_ROOT=/usr/local/var/jenv
if which jenv > /dev/null; then eval "$(jenv init -)"; fi

… add installed versions

jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/
jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/

… no JAVA_HOME with jenv

jenv enable-plugin sbt

Java 8 new language features

  • Default Methods for theerfaces
  • Lambda expressions
  • Functional Interfaces
  • Method and Constructor References
  • Lambda Scopes
  • Built-in Functional Interfaces
  • Streams
  • Parallel Streams
  • Map
  • Date API
  • Annotations

Java 7 new language features

  • Diamond Operator
  • Using strings in switch statements
  • Automatic resource management
  • Numeric literals with underscores
  • Improved exception handling
  • Working with Path
  • File change notifications

Java 6 new language features

  • Common Annotations
  • Scripting Language for the Java Platform
  • Pluggable Annotation Processing API
  • Streaming API for XML
  • Compiler API

Java 5 new language features

  • Generics
  • For/in loop
  • Autoboxing/Unboxing
  • Typesafe Enums
  • Varargs
  • Static Import
  • Annotations (Metadata)