Categories
Java linux

Java Scripting on JDK 11

JDK 11 make java command can directly run source code like other scripting language or interpreter. Lets say we have a java source file called hello.java as follow.

public class Hello {
 
  public static void main(String[] args) {
    System.out.println(“Hello World!”);
  }
 
}
 
Run the file by executing :
java hello.java
 
It works!
 
 
 
End.
Categories
OpenBSD

OpenBSD Java 8 Install

To get java we can install jdk. OpenBSD 6.1 have 2 packages of jdk which is 1.7 and 1.8.

To install jdk package do pkg_add jdk then choose which version you want to install.