
JDK 8 Release Notes - vkhuc
http://www.oracle.com/technetwork/java/javase/8train-relnotes-latest-2153846.html
======
bane
You know, I've been messing around with Java little lately. Nothing too fancy.
It's actually not a bad language -- with a modern IDE it's actually pretty
quick and breezy to work with.

If the standard library was cleaned up and the warts were all removed and
filled in, even if it broke compatibility (call it Java X or the Latte
language or something) I'd be okay with that. There's too much old 90's cruft
hanging around making usage of different pieces non-standard and lots of over-
objectizing everything so you end up having to assemble lots of things out of
little pieces, boilerplate-like, that should just be a single import and
instantiation.

The modern JVM is surprisingly quick and robust technology and I've been
pretty happy with it in my limited tests. I ported some old Perl algorithms to
it and got some really good speed out of it once I benchmarked some of the
collections a little.

Some things should just be outright fixed, like a proper regex literal so I
don\\\'t have to \\\e\\\s\\\ca\\\\\p\\\\\\\e everything so
much\\\\\\\\\//\/\\\\.

It's "got good bones" and a refurb of the entire thing to bring it focus could
breath a lot of long-term life into it.

 _edit_

I guess what I'm trying to say is it would be great if the language was
informed a bit more with what's going on in the dynamic languages space like
Go has been. I like how Python is about as clear as Java code is, but it's
always seemed a little more quick and breezy to work with. This is something I
think Go got right and it'd be great if Java sort of caught onto this.

~~~
pron
A major cleanup of the Java libraries is scheduled for Java 9. The JVM
actually does not surprise anyone who's been working with it for a while: it
is downright the most performant, flexible and awesome runtime environment
ever developed. I've been playing around with lots of languages and
environments in my pretty long career and, in the past decade, have always
come back to Java (or the JVM). It feels like driving a Ferrari where
everything else is at best a Toyota - might be easier to handle at first, but
it's not your dream car.

This pattern, by the way, has been going on in lots of tech companies. They
always end up going back to the JVM.

Aside from terrific performance, the JVM gives you the best concurrency
platform out there (though not the easiest to use), cool and extremely useful
capabilities like dynamic linking and bytecode instrumentation, and
unparalleled monitoring and profiling tools. It's the most professional
platform you can choose (unless you're limited to Windows, in which case .Net
is also an option). It's so far ahead than anything else out there, that the
competition can only beat it in very specific use cases (e.g. Go is much
better at startup time as well as standalone packaging, and C has better
performance, though mostly in single-threaded programs). But nothing else
gives you the whole package of performance, flexibility, maturity and
monitoring.

~~~
hkphooey
What is best practice when it comes to Java GUIs?

Would you recommend Java for building cross-platform desktop apps with near
native UI performance?

The IntelliJ IDE looks great but most Java desktop apps I've come across just
look and feel weird. Not sure why there is such a big difference.

~~~
stevoski
You have probably encountered the occasional Java desktop app, without
realising. If you can't easily tell it is Java, the development team have done
a good job.

Two of my company's three products are a Java desktop app for Mac, and they
look and feel like typical Mac apps.

Best practice? IMO you should spend significant time on the GUI making sure it
feels native. Otherwise, Swing is still about as good as it gets for Java
GUIs. JavaFX is supposed to be more modern and superior, but lacks the large-
scale support and third-party component ecosystem that you find the Swing.
Although I'd be mighty pleased to be proved wrong on that one!

~~~
azinman2
Java as a desktop front-end language is dead. Sorry. JavaFX is a sad attempt
at trying to re-live it, and no one outside of enterprise environments that
are pure JVM shops are attempting to use it.

~~~
grandinj
Actually, no, we have used it for a decade and continue to do so, because it
is a reasonably clean and performant UI framework that gives us great control
and pretty decent platform-native look and feel.

~~~
azinman2
I challenge you to do anything that is first-class profession UI/UX experience
in Java, and not want to tear your eyes out in the process. Try building
something Aperture, Keynote, etc in Java. I don't know what you're building
but my guess is it isn't 'beautiful' or innovative UI.

~~~
grandinj
True, but how many of us programmers either want or need to do that? Less than
1% I'll bet. For the rest of us, Swing works just fine, and it's a whole lot
better than some of the other UI toolkits out there.

~~~
azinman2
Except basic interfaces can still be done with things like iOS. If you're
going to take the time to build a UI framework, it shouldn't specialize in
being craptaculuar.

I'd also venture to say a lot more than 1%. Modern world (finally) recognizes
that design/experience are core to any product, enterprise or not. That's part
of the reason there's a whole new breed of funded enterprise companies out
there -- they're taking lessons from the web/apps and applying them to replace
old-school solutions. [I'm personally hoping more people recognize this need
for developer tools which typically are the worst offenders of all,
particularly on the database side.]

Part of having a good framework is what allows apps/applications to excel --
it helps you raise your own bar because the tools are just so much better that
nicer UI/UX can be had without being a nightmare in code. That's a win for
everyone.

------
ivanr
For me, the best part of this release is the fact that the TLS stack has been
significantly improved, and is now quite good. The lack of some critical
features in Java 7 (e.g., inability to enforce cipher suite order) made TLS
effectively unusable.

The list of improvements is quite long, actually:

\- Server Cipher Suite Preference

\- Strong Server Ephemeral Diffie-Hellman Parameters

\- Authenticated (GCM) Suites

\- Hardware Acceleration on Intel and AMD processors

\- Server-Side SNI Support

\- Ability to disable client-initiated renegotiation

\- TLS 1.2 enabled by default in client mode

\- Clients support Ephemeral DH over 1024 bits

More details here: [http://blog.ivanristic.com/2014/03/ssl-tls-improvements-
in-j...](http://blog.ivanristic.com/2014/03/ssl-tls-improvements-in-
java-8.html)

And there are more security improvements documented here:
[http://openjdk.java.net/projects/jdk8/features#core/sec](http://openjdk.java.net/projects/jdk8/features#core/sec)

~~~
kyrra
The DH size support is required for some US gov certifications I believe.
Maybe FIPS 140-2 or -3.

------
suyash
Yay!! Java 8 is released!!

My favorite parts:

\- invokedynamic : [http://stackoverflow.com/questions/6638735/whats-
invokedynam...](http://stackoverflow.com/questions/6638735/whats-
invokedynamic-and-how-do-i-use-it)

\- Project Nashorn :
[http://openjdk.java.net/projects/nashorn/](http://openjdk.java.net/projects/nashorn/)

\- lambda expressions :
[http://openjdk.java.net/projects/lambda/](http://openjdk.java.net/projects/lambda/)

~~~
hansjorg
Nashorn is said to be high-performance, and I've looked around for benchmarks
several times since it was announced, but I still can't find anything but
this:

[https://github.com/tadas-subonis/java-nashorn-performance-
sa...](https://github.com/tadas-subonis/java-nashorn-performance-sandbox)

What gives? Wouldn't a real comparison to Rhino and V8 (at least) be
interesting?

Edit: strike that. Found someone who ran Octane and SunSpider and compared it
to V8 and Spidermonkey: [http://wnameless.wordpress.com/2013/12/10/javascript-
engine-...](http://wnameless.wordpress.com/2013/12/10/javascript-engine-
benchmarks-nashorn-vs-v8-vs-spidermonkey/)

~~~
eropple
I've been using JDK8 for a while, but no Nashorn on Android keeps me on Rhino.
Which is unfortunate. Rhino's a pain.

~~~
suyash
Android doesn't use Java 8, I believe it's mostly still on Java 6.

~~~
eropple
Yes, I'm aware, thank you. There are efforts to port Nashorn back to Android.

------
lvh
I'm very happy with the JVM in general, but I really, really, really wish they
fixed the start up time. People compile Clojure down to Javascript for command
line tools precisely because of this. lein <anything> takes annoyingly long,
so I don't do it.

I realize this is not a real concern for them for e.g. servers, but I wish
they had some developer- or desktop-specific configuration that would start
about as fast as a Python VM. I don't even care if it runs code (a reasonable
fraction) slower.

~~~
democracy
Can you please give a use case of a program that a few hundred ms delay during
startup would be an issue?

~~~
gkya
Few hundred milliseconds? I played with clojure a month or so ago and invoking
_lein repl_ was ~7.5 seconds.

~~~
democracy
I never worked with Clojure, but a simple java "hello world" starts and
finishes within a second. Same with a simple java Swing UI "hello world"
sample. If some application is doing something slow during initialization - it
is not the platform itself, but the specific code to blame.

~~~
gkya
Lein starts a JVM instance for itself, then loads plugins, checks dependencies
etc. and starts a new JVM instance for the program if necessary.

------
bhauer
If you're curious about the developer-facing changes in Java 8, I of course
recommend the blog entry we wrote up last year [1]. It's a bit hard to believe
it's been a year.

[1] [http://www.techempower.com/blog/2013/03/26/everything-
about-...](http://www.techempower.com/blog/2013/03/26/everything-about-
java-8/)

~~~
film42
Superb post! Thanks for sharing.

------
melling
Anyone know what Google is going to do about Java 8 compatibility on Android?
Not being able to adopt lambdas on mobile is a bummer.

~~~
masklinn
AFAIK they still don't support all of Java 7 so...

~~~
jug6ernaut
They support "parts" of java7, but not everything.

------
maaaats
IntelliJ just pinged me with an update, and checking the release notes it says
"ships final support for java 8". Sweet!

~~~
suyash
A better light weight alternate is Netbeans 8 that also just got released and
has full Java 8 support in addition to many many other features:
[https://netbeans.org/community/releases/80/](https://netbeans.org/community/releases/80/)

~~~
maaaats
I'm not sure why you felt the need to add "a better light weight", why not
just say "Netbeans also got Java 8 support"? This isn't the place to start a
flamewar.

~~~
peterashford
On account of it being better and more light weight? :o)

~~~
gamegoblin
Better is subjective, and the cause of many flame wars.

~~~
peterashford
Note the presence of a smiley. It indicates an attempt at humour.

~~~
benjamincburns
Hitler.

There, I lose. Everybody can go home now. :-)

------
pron
A very interesting new feature that is not talked about a lot is type
annotations, which add pluggable type systems to Java with the Checker
framework:

[http://docs.oracle.com/javase/tutorial/java/annotations/type...](http://docs.oracle.com/javase/tutorial/java/annotations/type_annotations.html)

[http://types.cs.washington.edu/jsr308/](http://types.cs.washington.edu/jsr308/)

------
AmrMostafa
I'm surprised no one mentioned the departure of permgen space and the dreaded
PermSize and MaxPermSize JVM arguments. While it was actually replaced with a
new "metadata" space, the latter is mostly transparent, unlike the former. You
can read more about the change here:
[http://java.dzone.com/articles/java-8-permgen-
metaspace](http://java.dzone.com/articles/java-8-permgen-metaspace)

------
WoodenChair
The install of JDK 8 on OS X is surprisingly straight forward. I just double
clicked, selected yes a few times in a standard OS X install dialog, and I was
up and running... now running applets with all of this security is another
matter.

------
suyash
Download the JDK/JRE from Oracle:
[http://www.oracle.com/technetwork/java/javase/downloads/inde...](http://www.oracle.com/technetwork/java/javase/downloads/index.html)

------
spiralpolitik
I have to admit I thought Java was dead in the water after Java 6, but Java 7
while a fairly quiet release was a decent release and Java 8 actually moves
the language forward into a better place. As for the future here's what I
would like to see:

\- Separation of language and libraries. Really the JDK should just ship with
just a very small core of classes and everything else should be optional
installed via a dependency or package manager. I know jigsaw is going in this
direction, but I fear they are going to go the same way as J2ME with profiles.
They should also clean up the cruft while they are doing this. This would
allow the libraries to evolve separately from the JDK and even allow 3rd party
framework to flourish while still keeping things reasonable manageable.

\- Multiple return types. Scala has hacked around it, Python has them, Go has
them. Bite the bullet and implement them so you can do sensible error handling
without exceptions or returning `null`. While they are at it they could also
fix the type system to finally allow `Integer hello()` and `String hello()` to
exist in the same class.

\- Implement Categories (or mix-ins). Seriously if I have to see another class
called StringUtils or IntegerUtils I will gouge my eyes out.

\- Get rid of the primitives. I read somewhere that this was on the cards for
Java 10.

\- Implement proper Generics.

\- Implement @property just like Objective-C and .NET so that 80% of class
files aren't getters and setters. I'm really surprised they never did this
when they implemented annotations as this was the first obvious annotation to
add. I know you can do it with Aspect J but you shouldn't have to. There was a
JSR for this at one point but it seemed to disappear into the ether.

~~~
rossjudson
Multiple return types: Questionable benefit there. Exceptions are nice when
used properly. Option classes handle the rest.

Categories: Default methods probably do what you want.

Get rid of primitives: Are you nuts? It turns out computers work on
primitives. It's good to support them.

"Proper" generics: maybe you mean specialization, or maybe you mean
reification. It's a choice.

Properties: If they irritate you that much, just use something that will
generate them for you, using standard annotation processing.

~~~
spiralpolitik
Default methods work nothing like categories. For example you can't use a
default method decorate String with an additional method usable on every
instance of String.

[http://rypress.com/tutorials/objective-c/categories.html](http://rypress.com/tutorials/objective-c/categories.html)

------
afsina
Java 8 made our in-house ASR engine %5-10 faster. Free performance is always
welcome.

~~~
vladimirralev
What kind of operations do you do? Fixed/floating point? Allocate memory or
pool?

~~~
afsina
A lot of floating point operations are done in GMM likelihood calculations.
Dynamic decoding with Viterbi beam search and language model queries are other
operations. We pool some memory but we do not try hard for this. Allocation is
cheap in Java. Cache aware design saved a lot of performance for us.

------
suyash
Here is Chief Java Platform Architect: Mark Mark Reinhold’s Blog about JDK 8
and the key main features:
[http://mreinhold.org/blog/jdk8-ga](http://mreinhold.org/blog/jdk8-ga)

------
netcraft
> The expiration date for JRE 8 is 05/15/2014

How long till most people will target 8? I think we will wait for at least a
few patches first.

~~~
kyrra
For clarity, expiration date[0] is just means the JRE will not be considered
"up-to-date" anymore. At that point, the JRE will check for updates and ask
the user to upgrade.

[0]
[http://docs.oracle.com/javase/8/docs/technotes/guides/jweb/c...](http://docs.oracle.com/javase/8/docs/technotes/guides/jweb/client-
security.html#jexpire)

------
MBlume
Packaging Java 8 for debian/ubuntu:
[http://michaelblume.tumblr.com/post/80003780922/packaging-
ja...](http://michaelblume.tumblr.com/post/80003780922/packaging-java-8)

~~~
hrjet
I am waiting for the OpenJDK release on Debian. In the meanwhile, you can also
use the WebUpd8 PPA:

[http://www.webupd8.org/2012/01/install-oracle-java-
jdk-7-in-...](http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-
ubuntu-via.html)

------
sev
For those who may not have seen it, here's a good primer/tutorial for Java 8:

[http://winterbe.com/posts/2014/03/16/java-8-tutorial/](http://winterbe.com/posts/2014/03/16/java-8-tutorial/)

------
augustl
There's a Node.js implementation on top of Nashorn, the JS engine that comes
with JDK 8 [https://avatar-js.java.net/](https://avatar-js.java.net/)

Pretty cool stuff! I hope someone makes an easy way to render FB react modules
on the server without relying on a separate Node.js process.

------
brunnsbe
Hopefully JDK 8 will have a better release than JDK 7:
[http://searchhub.org//2011/07/28/dont-use-java-7-for-
anythin...](http://searchhub.org//2011/07/28/dont-use-java-7-for-anything/)

------
yuhong
Free updates for Java 7 will end in a year:
[http://www.oracle.com/technetwork/java/eol-135779.html](http://www.oracle.com/technetwork/java/eol-135779.html)

------
tete
I'd really start considering Java if it wasn't for Oracle.

~~~
keypusher
Use OpenJDK.

------
nickbauman
Lack of Tail Call Optimization is still a bummer in some cases.

------
datawander
People will look back upon this date with utter lament because the world of
lambdas has been unleashed upon a much more dangerous and wider world of
programmers.

------
webreac
Does anyone know if all the security issues that have given bad reputation to
java are fixed in java 8 ? Is it safe again to develop java applets ?

~~~
hibikir
It is never safe to develop Java applets. It was a silly concept when it was
devised, and it's still a silly concept today. We aren't developing ActiveX
controls either, right?

If you have an environment where you need a full client, and the developer is
trusted, use Webstart: You have to actively accept something on Webstart. If
you do not trust the developer, make the interface in a regular webpage.

------
jevinskie
Does anybody know if static libraries made it in?

[http://openjdk.java.net/jeps/178](http://openjdk.java.net/jeps/178)

------
donniezazen
Why does Android requires obsolete JDK 6 and not the latest stable version?
Android should probably be the biggest project that uses JVM.

~~~
asmosoinio
Because it does not use JVM. The language is Java, but the virtual machine is
Dalvik.

~~~
donniezazen
Why do they still use JDK 6 and not the current default version?

~~~
asmosoinio
Because Dalvik does not support Java 8 features, and those would need to be
implemented first. Java 8 was only just now released in final form.

Dalvik does have support for all Java 7 features:
[http://tools.android.com/tech-docs/new-build-system/user-
gui...](http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-
Using-sourceCompatibility-1.7)

Dalvik will most likely be replaced with ART (Android Runtime) at some point:
[http://source.android.com/devices/tech/dalvik/art.html](http://source.android.com/devices/tech/dalvik/art.html)

ART has been in the works for at least two years now.

------
javajosh
It's really too bad lambdas in Java 8 don't do non-final variable capture;
other than that, I'm very pleased with this.

~~~
film42
I believe it will let you as long as you don't modify the variable. Am I
wrong?

------
hnriot
Java+Guava is decent. Without the work that Google has done Java is incomplete
and missing too much.

------
drderidder
pg had an interesting take on "hackers radar" wrt Java. worth a read.
[http://www.paulgraham.com/javacover.html](http://www.paulgraham.com/javacover.html)

~~~
RyanZAG
> 2001

It's silly to compare Java8 with Java1.4? 1.3? from 2001.

------
boohoofoodoo
any sources for apt-get available?

