Event Report: Java 7 Launch Event in Pune

(This article by guest writer Amit Naik, an architect at BMC Software, Pune, is a report of the Java 7 Launch event that happened in Pune last weekend.)

Harshad Oak started things off by pointing out that Java has a bit of ups & downs in the past couple of years. Hopefully Java 7 will reverse the trend. He also encouraged people to join the Pune Java User Group to stay connected with other Java users in Pune.

Then, we moved on to the main speaker: Chuk-Munn Lee (chuk-munn.lee@oracle.com). Fun fact – Chuk-Munn is a fan of Futurama and called out the fact that he is wearing a “Bender the Robot” T-Shirt.

These are the highlights of Chuk-Munn’s presentation:

The last Major release of Java – Java 6 was in 2006-7 and no major releases since then. JavaSE7 has a lot of gestation period. The big release of 7 is now broken down into 2 incremental releases Java 7 and Java 8 to get something out of the door faster and make it more manageable.

Reading is more important than writing for Programming Languages. Programs should be a Joy to read. Counter example PERL a Write-Only Language, or Looks Same Before and After AES Encryption. A Camel is a horse designed by committee. Very difficult to read and maintain. So very difficult to collaborate in large teams or large codebases where readability is important. This is where Java shines but it has sometimes got too much boilerplate code needed.

Applications in the commercial world compete on the basis of features – same should not apply to programming languages. In languages you want fewer features but they should work consistently. So it is difficult to add new features to Java consistently.

The main features new in Java 7 can be grouped into these categories:

Small Language Changes (Project Coin)

  • Binary Literals with underscores for clarity
  • Strings in Switch statements
  • Inferring types with <>
  • Varargs Warnings @SafeVarargs fixes problem of Heap Pollutions JLSv3 4.12.2.1
  • Multi-Catch – very useful in reducing boilerplate code if used properly!
  • Copying Streams – try-with-resources

NIO2

  • NIO2 (JSR -203) java.io.File does not work consistently across platforms, missing basic operations like copy, move, etc.
  • Path Class (Async I/O)
  • Features – Filesystem and Filestore support
  • Symlink support
  • Basic File operations
  • File attributes and Permissions support enhanced
  • Other interesting features
    • Watch files directories

Invokedynamic

Java may or may not be the first choice of everybody but JVM is massively popular and many, many languages are adopting it. The VM spec is from 1997 – fairly generic and not specifically wired to Java except for the 4 key bytecode instructions – invokespecial (constructor invocation), invokestatic (statics), invokeinterface (interface), invokevirtual (methods)

Java 7 is introducing a new instruction for Java 7 invokedynamic that will allow for late binding in languages such as JavaScript to be natively supported on the JVM.

Other Features

  • New Fork-Join framework
    • ForkJoinPool and ForkJoinTask along with fork keyword to natively support fork-join semantics
      natively on the VM
  • New decorators for Swing – Jlayer and LayerUI
  • Infiniband support – using a sockets direct protocol (SDP) over the wire
  • Utility methods for java.util.Objects

That was end of the main presentation.

Time for Audience Q/A

(All Questions/Answers paraphrased to best of my recollection)

  • Java 7 seems like an underwhelming release. Why?
    • There was a very long gap between Java 6 and Java 7 because of the inability to move things thru to conclusions fast enough in the JCP. All the big features were not done yet so it would have taken a lot longer to get everything finished. Oracle polled the community and the result was two releases – one with all the finished features and one with all the big features -Java 8- to follow shortly thereafter.
  • Will Oracle make Java more “restrictive” in terms of licensing etc.?, What is Oracle’s commitment to Java?
    • A very large part of Oracle’s internal codebase is on Java so Oracle has excellent commitment to Java and will move it forward Will it make it more restrictive license wise – this question has been comin up over the years and the answer is always NO. Most of Java is under a GPL-like license anyway so cannot be really made more restrictive.
  • With the departure of Apache Software Foundation from the JCP and the Lawsuit over Android against Goolge what is the future of JCP and the Java community?
    • Cannot comment on the lawsuit. If the situation with the ASF worries you personally then you should consult a lawyer. I (Chuk-Munn) ask myself this question – does it personally affect me in any manner? If not then I do not worry about it.
  • Is the support for dynamic languages increasing or decreasing with Java 7?
    • Increasing with the introduction of invokedynamic etc.

The PPT that was used by Chuk-Munn Lee is available from here (see attachment at the end of that page)

About the Author – Amit Naik

Amit Naik works as an Architect with BMC Software. He builds performant cloud solutions with a focus on heterogeneity and monitoring across different virtualization and provisioning vendors in the cloud computing space. His main focus is the Architecture and Design of BMC solutions with emphasis on building highly-scalable systems with REST and other SOA interfaces.

Amit has a Bachelor’s degree from College of Engineering Pune and a Master’s degree from Purdue Univ., West Lafayette. He has more than 15 years of experience in the IT industry, much of it in the USA, across a variety of Technical and Techno-Managerial roles.