Java - Overview

Install

Download from: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Install. On Mac, the package is installed in /Library/Java/JavaVirtualMachines

Add this to ~/.bash_profile or ~/.bashrc:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home

PATH=$JAVA_HOME/bin/:$PATH

Packages

  • java.*: core packages

  • javax.*: extensions

  • javax.ws.rs: JAX-RS, Java API RESTful service

  • JAX-WS: XML web services(SOAP)

  • JAXB: XML binding

Deprecated:

  • Applet
  • JSP

External Resources

Misc

  • Java Classpath: use the first match

java -jar vs java -cp

Cannot use both!

  • java -jar: specify an executable jar, the classpath should be specified in Manifest
  • java -cp: specify classpath

http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

Why no Operator overloading

Operator overloading always leads to abuse