
Java 9 is scheduled to launch in July - james_tano
https://www.freelancinggig.com/blog/2017/01/25/java-9-ready-launch-cool-features/
======
Zaheer
I'm fairly impressed with how Java has maintained relevance and steadily
improved over the years. Java 8 was huge in tackling the Functional
programming front. With REPL and more functional improvements in Java 9 its
starting to feel fresh again. Go & Swift are great efforts and I hope they
gain a larger community but JVM is here to stay and it's great that they're
improving it while so many other languages have fizzled out over the years.

~~~
saosebastiao
It seems like the JVM is here to stay in the same way that COBOL is here to
stay. It has become a server-specialized system with a level of overhead that
kills it in resource constrained environments. There is room for improvement,
no doubt, but it's pretty hard to beat the resource demands of AOT compiled
code with a good optimizer and potential PGO.

Go, Swift, Vala, Nim, and Rust are just the start of a trend...it seems most
new languages are eschewing the VM model. And many existing VM/JIT languages
are moving there: Dart, Julia, Scala, and even the .NET languages are all
moving towards AOT capabilities.

~~~
pjmlp
Java is also AOT compiled and is becoming the favourite language besides C on
many embedded platforms.

EDIT: To expand to that remark, although Sun was religiously against AOT, the
majority of commercial JDK vendors have always supported AOT compilation to
native code, specially the ones in the embedded space.

Also, for how cool all those languages are, there are lots of domains and OSes
where Java code lives (AOT or JIT compiled), that they have yet to create
backends for.

Examples, embedded controllers on factory plants, Cisco phones, Ricoh
printers, Gemalto monitoring devices, Blu-Ray players, car infotainment
systems, some GPS devices, military weapon control systems, shopping
terminals, Android's fork,...

[https://en.wikipedia.org/wiki/List_of_Java_virtual_machines](https://en.wikipedia.org/wiki/List_of_Java_virtual_machines)

It is going to take a while to erase Java from the industry.

~~~
saosebastiao
I was more claiming that the JVM is going obsolete, not Java. The whole idea
behind the JVM is platform abstraction...and it worked perfectly fine insofar
as the platform being abstracted had a CPU, at least X memory, a disk drive,
and at least a basic OS. Which was fine for a while, but now we're seeing an
explosion of different platforms with wildly different capabilities, and the
JVM is just not up to the task. That isn't to say that _Java_ isn't, but it
does mean that you need specialty compilers, libraries, tools, and
infrastructure for specialty targets.

~~~
pjmlp
Well, actually what we are seeing with the CLR, LLVM, ART is an increase of
adapting the mainframe model of JIT/AOT compilation with some form of bytecode
as distribution model.

In that regard, what JVM is missing are new ways to adapt to said hardware.

Interesting enough, Java is ahead of Go, Swift, Vala, Nim, and Rust in
supporting GPUs, for example.

------
imode
I used to be a "Java hater" when I didn't understand the real purpose of the
language or didn't even write in it. I was pretty young and it was cool to
hate it.

but nowadays, I think having a common runtime plus a language that can exploit
that is quite nice. having written some java lately, it was a refreshing break
from the brutalism of C.

looking forward to whatever they bring to the table!

EDIT: java without any IDEs is also very usable. my workflow from small C
projects didn't change. I don't bother with Eclipse, I just do all my work in
my terminal.

------
crb
Headline: "Is Ready to Launch"

Body: "Instead of arriving in March 2017, it has delayed, and the new schedule
mentions a date of 27th July 2017"

~~~
dang
Ok, we changed the title to say that.

Is there a better source for this material? The submitted article looks
cribbed from elsewhere but I don't see a link to the original source.

~~~
sgift
Not sure if it counts, but the jdk9 project page has the July release date and
all the features scheduled for Java 9:

[http://openjdk.java.net/projects/jdk9/](http://openjdk.java.net/projects/jdk9/)

------
algesten
"java" and "cool" in the same sentence doesn't compute for me. I die a little
inside every time I'm forced to launch eclipse and work with The Old Stuff.

Actually after working with java from 97-07, I was so sick of it I started the
process of changing careers and study medicine. Just imagine: solve people,
not code!

Looking back, the main problem was probably Spring, Glassfish, IOC, XML, Maven
and numerous other "EE" things that java-people assumed were a must 10 years
ago.

I hear people these days do write fun, lightweight microservices that launches
in seconds in java, but I'm scarred for life. Never again. Life is too short
and there are _tons_ of fun programming languages that are commercially
viable.

(I never started medicine, programming is amazingly creative, just not java)

~~~
libria
> Looking back, the main problem was probably Spring, Glassfish, IOC, XML,
> Maven and numerous other "EE" things that java-people assumed were a must 10
> years ago.

One of the most popular frameworks - Spring Boot - includes many of these now.
It's fairly light, contained, works well in Docker. Maven is pretty
straightforward for simple things, IOC is optional. I haven't exercised it
heavily though, but what's wrong with those things?

> I die a little inside every time I'm forced to launch eclipse

Intellij's your healing potion then.

~~~
algesten
> One of the most popular frameworks - Spring Boot - includes many of these
> now. It's fairly light, contained, works well in Docker. Maven is pretty
> straightforward for simple things, IOC is optional. I haven't exercised it
> heavily though, but what's wrong with those things?

It's hard to pinpoint one single thing that is the problem, but I suppose I
can summarise it with that I don't think java is especially productive.

The language is rather verbose in modern terms (compare it to something with
type inference like swift or rust).

The startup time of a spring-driven project used to take an age (used to be
XML-parsing, then annotations), especially if housed in an app-server like
jboss or glassfish, but also tomcat, jetty (compare it to how quickly an
express-app in nodejs starts). This in turn affects development time.

Dealing with (somewhat) modern dataformats like JSON is is incredibly verbose
(GSON, built-in, etc nothing compares to languages with what swift calls
"subscribe", i.e user defined obj.blaha accessors instead of
obj.getJsonValue("blaha")).

Dealing with older dataformats like XML is incredibly verbose (never mind the
gazillion XML <-> Object mapping frameworks with source generation pre-
compilation stages, insanely long namespaced method calls, etc).

The static type system is actually just making the code very verbose without
helping much because pretty much anything can still be null (again compare
with rust/swift where static types + optionals means compilation actually
provides some level of security).

It had massive corporate backing (Sun/Oracle) to instill the idea that pretty
much anyone can learn programming as a trade (I've worked extensively in India
with outsourced java-programming, and the quality of code produced by some
people labelled "senior" is absolutely shocking. This is not unique to India
however).

Things like ORMs (Hibernate and EJB) meant most people just forgot how RDBMs
work and threw crazy hardware at the persistence layer to compensate for lousy
performance (ORMs are typically fine, users not understanding how they work
are the problem).

It's owned by Oracle.

I could probably go on, but it's bed time.

~~~
paulmd
> The language is rather verbose in modern terms (compare it to something with
> type inference like swift or rust).

Maybe if you never have to work with anyone else, or maintain your code.
Static typing is a plus, not a minus. Right now I'm working in a legacy
codebase where everything is passed as Object or String within the main logic
code, and let me tell you it's hell trying to figure out something as basic as
what type of object you're working with.

> The startup time of a spring-driven project used to take an age (used to be
> XML-parsing, then annotations), especially if housed in an app-server like
> jboss or glassfish, but also tomcat, jetty (compare it to how quickly an
> express-app in nodejs starts). This in turn affects development time.

Startup time for thin servers like Jetty is virtually zero. The fatter servers
definitely do take more time to start up, but they also tend to be used with
complex applications that have more stuff to configure, so that goes hand in
hand.

For a point of reference here, I'm at about ten seconds from startup to page
load with a 110 MB application that loads all kinds of redundant and useless
code (which is why you let Maven do its thing instead of using fat jars
everywhere).

If you're properly configured, though, you can do "code hot-swapping" (call
1-800-TOMCAT for sexxxy singletons in your area!), which will just inject a
new function body into the server, so you can avoid having to re-deploy the
whole application over a single changed line.

> Dealing with (somewhat) modern dataformats like JSON is is incredibly
> verbose (GSON, built-in, etc nothing compares to languages with what swift
> calls "subscribe", i.e user defined obj.blaha accessors instead of
> obj.getJsonValue("blaha")).

You're looking for Jackson. See the first example, "Full Data Binding".
[http://wiki.fasterxml.com/JacksonInFiveMinutes](http://wiki.fasterxml.com/JacksonInFiveMinutes)

If you need a little more flexibility than just "this object but serialized as
JSON", you can control the binding with annotations or XML.

> Dealing with older dataformats like XML is incredibly verbose (never mind
> the gazillion XML <-> Object mapping frameworks with source generation pre-
> compilation stages, insanely long namespaced method calls, etc).

So you don't like writing it yourself (SAX parsers are verbose but fast and
powerful), and you don't like the tradeoffs of letting tools do it for you, ok
then...

JAXB isn't really as bad as you're making it sound though. And the rule of
thumb is that virtually any awkward block of code can be stuck behind a
convenient helper method and only touched directly if there is a very
compelling reason.

> The static type system is actually just making the code very verbose without
> helping much because pretty much anything can still be null (again compare
> with rust/swift where static types + optionals means compilation actually
> provides some level of security).

Sure, object references can be null. Get over it, that's like CS 101 stuff
right there. What do you think happens if you use an undefined variable in
Python or Javascript?

If you really want to be sure that an object isn't null, just use "assert
myObj != null;".

Again, static typing actually is a huge plus when you're looking through
unfamiliar code and trying to figure out what it does. "What type of objects
am I working with" is a fundamental question that you always need to know.

> It had massive corporate backing (Sun/Oracle) to instill the idea that
> pretty much anyone can learn programming as a trade (I've worked extensively
> in India with outsourced java-programming, and the quality of code produced
> by some people labelled "senior" is absolutely shocking. This is not unique
> to India however).

> Things like ORMs (Hibernate and EJB) meant most people just forgot how RDBMs
> work and threw crazy hardware at the persistence layer to compensate for
> lousy performance (ORMs are typically fine, users not understanding how they
> work are the problem).

These are personal problems (or actually, Personnel problems). No, Java
doesn't somehow make chopshops able to magically turn out good code. No, it
will not fix your co-worker who just doesn't understand how to write
performant code. But he would be writing shitty code in Python or Ruby too,
and you would have a whole set of extra problems on top of that.

> It's owned by Oracle.

Reminder: Google won their lawsuit. Oracle owns their Java implementation.
They can't stop other people from reimplementing the Java API, however.

OpenJDK seems to be fine. I run it on Linux environments because Oracle JDK
isn't in the repos, and it's pretty much a drop-in replacement in most cases.

~~~
wtetzner
> Sure, object references can be null. Get over it, that's like CS 101 stuff
> right there. What do you think happens if you use an undefined variable in
> Python or Javascript?

I think you missed the part where he's comparing against statically typed
languages like Rust and Swift. He's not arguing against static typing. He's
arguing that Java is both more verbose and less type-safe than languages like
Rust and Swift, which both prevent null, and have type inference.

> Get over it

Why get over it when you can just use a language that doesn't let null leak
into every reference?

------
cygned
Oh they add a REPL. I know the REPLs from other languages and I know Java. I
doubt, that's going to be something I would ever have fun with.

~~~
jayd16
Why would you think its not fun? Have never used the "immediate" window or
expression evaluation in a debugger to run code?

Look it up, its nice.

~~~
cygned
I program in a lot of other languages and Java always looks like 120%
boilerplate to me. I am not sure yet how well the REPL can handle that.

~~~
iainmerrick
Defining a new class takes tons of boilerplate. Just calling some existing
code looks pretty much like any other C-style language; it's fine.

Python has a pretty tedious class definition syntax too, and nobody ever
accused Python of having a bad REPL!

~~~
aardvark179
You'll like what's coming after Java 9 then, maybe sooner than you expect.

------
elcct
In Java 9 if you create 8 layers of abstraction, you will get extra 2 layers
created for free =]

~~~
sgift
Oh, like in JS where using one dependency gives me 5k dependencies for free?
:)

~~~
aioprisan
You're confusing packages with classes. Arguably, the same number of package
dependencies in Java could mean even more abstraction that's inherited for
each.

------
kodfodrasz
> To avoid redundant code and more re-usability, Oracle Corp is going to
> introduce private methods in Java 9 Interfaces. From Java 9 onwards, you can
> write private and private static methods too in an interface using ‘private’
> keyword.

To me this seems sane only to be used with the `default` keyword. Am I right,
or did I miss something?

The last time I used Java the Optional waas mostly usable, but had some rought
edges, and I saw that all my painful usecases were waiting to be released in
Java 9. When I last checked unfortunately the monadic types were still not
sharing an interface for common operations (Optional and Stream), not even in
Java9.

Overall: finally it is here! I miss some parts now from the .Net Core world.

~~~
aardvark179
Yes, private on interfaces is there to make using default easier.

------
_nalply
An official REPL is a good idea. There is an unofficial REPL for a long time
(ten years or more?): BeanShell

[http://www.beanshell.org/](http://www.beanshell.org/)

Add bsh.jar and a little glue code and presto you have a shell into your
application.

There was a Java-based editor, jEdit, which integrated with Beanshell. I could
do search-and-replace with replacement programmed in Beanshell. Aah, these
were good times.

------
golemotron
It's annoying that every time I see a reference to Jigsaw it is only in the
most abstract terms. Never an example or anything concrete enough to explain
what is involved. Couldn't they just say: "Jigsaw introduces a source level
module construct.."

~~~
pjmlp
There are endless presentations at Java ONE, Jax, Devoxx, NDC, Java Zone,
FOSDEM, Skills Matter.

They aren't that hard to find.

------
jcdavis
Compact Strings is listed as a "miscellaneous" feature but that is the most
exciting feature as far as I am concerned. IIRC based on looking at a variety
of heap dumps they found that decreases the average size by like 10%.

------
robertk
Can someone explain why I should use Java? Over literally any other language?
Why is the lobster still alive?

EDIT: on my phone and meant to write monster.

~~~
meddlepal
1\. Massive ecosystem?

2\. Easy to find programmers?

3\. Great networking and concurrency libraries?

4\. Simple language with an amazing virtual machine?

5\. Ecosystem has several good other languages that interop from good to
amazing with Java including Scala, Clojure, JRuby, Groovy, and Kotlin.

~~~
vorg
> from good to amazing with Java including Scala, Clojure, JRuby, Groovy, and
> Kotlin

After writing "good to amazing", you put an ordered list which many readers
will subliminally rank in the order you provided, with the "amazing" languages
on the right. I've tried 4 of those 6 languages, and would rank them in a
different order.

> Ecosystem has several good other languages that interop from good to amazing

The ecosystem also has several other languages that interop from bad to
amazing, just like other ecosystems.

------
egeozcan
Why would one define private methods on interfaces? Is it intended to be
depended by abstract classes?

~~~
aardvark179
If you can define private methods on an interface then you can refactor common
code out of default methods on that interface without exposing it to any other
class.

~~~
egeozcan
Ah, that makes sense. Thank you.

------
pc2g4d
Somehow I had it in my head that value types were coming in Java 9. Was I
wrong?

~~~
adimitrov
Project Valhalla:

[http://openjdk.java.net/projects/valhalla/](http://openjdk.java.net/projects/valhalla/)

No, it's not in 9. It may not even be in 10. Its current status is "Draft"

In the meantime, may I suggest alleviating the pain by using the great
immutables library:
[https://immutables.github.io/immutable.html](https://immutables.github.io/immutable.html)
or Google's autoValue:
[https://github.com/google/auto/tree/master/value](https://github.com/google/auto/tree/master/value)

------
scarface74
Why does this article read like a bad attempt at SEO?

------
mattbroekhuis
If all they release is jigsaw it will be worth it

------
HillaryBriss
woo hoo. GA is currently estimated to be July 2017.

i wonder when the Android ecosystem will support it.

~~~
pjmlp
Looking how well it does support Java 6, 7 and 8, probably never.

\- Java 6 and 7, not all of the APIs are supported

\- Java 8, on top of not supporting all of the APIs, it doesn't support the
new bytecodes and 100% of the language changes. As Android team puts it at
Google IO, "tell us which features you care about", apparently 100% isn't a
goal.

Also the new compiler toolchain required for Java 8 support, Jake and Jill,
still doesn't work properly.

Also there are several issues, where Android has implementation bugs versus
what Java libraries actually do, e.g. String::split.

Have fun browsing through the issues,
[https://code.google.com/p/android/issues/](https://code.google.com/p/android/issues/)

In a 5 years time, more or less when Java 10, hopefully gets released, the fun
of writing portable Java code between Android Java and standard Java will be
even better.

~~~
HillaryBriss
wow. it's even worse than i thought.

~~~
pjmlp
Yes, yet people praise Google for doing what Microsoft failed to do.

------
Illniyar
Still no jigsaw?

