• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Java 11 now available for download

 
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting fact: the API docs are now found at https://docs.oracle.com/en/java/javase/11/docs/api/ (not http://docs.oracle.com/javase/11/docs/api/ as versions 7 through 10 would have suggested).

This release has quite some impact - it has removed all JEE APIs like JAXB, JAF and RMI. CORBA is also gone. Furthermore, Nashorn is deprecated and will probably be dropped pretty soon.

FYI, I'm working on getting a new version of https://robtimus.github.io/whats-new-in-java/. The removal of entire packages has lead to some interesting behaviour, like features introduced in previous versions no longer showing up as new for those versions. I expect to have this fixed later this week.
 
Saloon Keeper
Posts: 5718
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nashorn is deprecated and will probably be dropped pretty soon.


I recently noticed that the Rhino JavaScript engine -Nashorn's predecessor- has once again become quite active. Since the future development of Nashorn seems uncertain, Rhino -which also implements the javax.script API- may be a replacement once Nashorn is gone.
 
Marshal
Posts: 65113
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:Interesting fact: the API docs are now found at https://docs.oracle.com/en/java/javase/11/docs/api/ . . .

And it has lost the nice FRAMES option

. . . . The removal of entire packages has lead to some interesting behaviour, like features introduced in previous versions no longer showing up as new for those versions. . . .

I presume old code still runs?
 
Rob Spoor
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Rob Spoor wrote:Interesting fact: the API docs are now found at https://docs.oracle.com/en/java/javase/11/docs/api/ . . .

And it has lost the nice FRAMES option


I hadn't even noticed that. I guess they thought it's unnecessary with the search box at the right.

. . . . The removal of entire packages has lead to some interesting behaviour, like features introduced in previous versions no longer showing up as new for those versions. . . .

I presume old code still runs?


It depends. If you have code that uses JAXB or any of the other JEE modules, you need to explicitly get a replacement and include that in your project. The removal of (mostly old) deprecated methods could well break very old code that still use them.
 
Carey Brown
Saloon Keeper
Posts: 6054
58
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that the Java-11 JRE for Windows doesn't come with the JDK download. For "java -version" I still get my 10.0.2 version. Anybody have any ideas on this? I tried to find the JRE on Oracle's site but was unsuccessful.
 
Campbell Ritchie
Marshal
Posts: 65113
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting 11, but on a Linux box. Surely your PATH is correct. There doesn't appear to be a JRE download link here any more. Is there anything on OpenJDK? No, there isn't. Can't help any more. Sorry.

[critchie@xxx java]$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
[critchie@xxx java]$ javac -version
javac 11

 
Rob Spoor
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:FYI, I'm working on getting a new version of https://robtimus.github.io/whats-new-in-java/. The removal of entire packages has lead to some interesting behaviour, like features introduced in previous versions no longer showing up as new for those versions. I expect to have this fixed later this week.


It's done (although no modules are displayed in the UI yet, only packages). There are some nice additions again (most of which gave me a "finally!" feeling):

* FileReader and FileWriter can take a Charset; no more new InputStreamReader(new FileInputStream(file), charset) but just newFileReader(file, charset).

* Reader, Writer, InputStream and OutputStream have static nullReader / nullWriter / nullInputStream / nullOutputStream methods to return a reader / writer etc that returns nothing or writes nothing.

* String has methods isBlank (really finally!), lines, repeat and strip (which is like tirm but slightly different or so).

* StringBuffer and StringBuilder are comparable.

* The HttpClient module is finalized.

* Files has methods to read and write Strings, not just byte arrays.

* Collection has method toArray(IntFunction). No more collection.toArray(new String[0]) or collection.toArray(new String[collection.size()]), now it's just collection.toArray(String[]::new).
 
Campbell Ritchie
Marshal
Posts: 65113
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
toArray(String[]::new)? Yes, I like that.
 
Sheriff
Posts: 13570
223
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:No more collection.toArray(new String[0])


Campbell Ritchie wrote:toArray(String[]::new)? Yes, I like that.


Well, the implementation requirements section says this: "The default implementation calls the generator function with zero and then passes the resulting array to toArray(T[])."

So there's still toArray(T[]) involved, it's just that toArray(String[]::new) encapsulates the call to toArray(new String[0]). The method reference version is arguably less confusing to read, I guess.

If I had a collection of Book objects, would bookList.toArray(Book[]::new) be easier to read than bookList.toArray(new Book[0])? I don't know, can't decide for myself right now. Maybe it's because my brain is already used to the semantics of the toArray(new Book[0]) idiom. Maybe it's just a matter of getting used to a new idiom.

EDIT: Never mind. I'm used to it now -- just needed to read it out loud and hear myself try to explain it.
 
Rob Spoor
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting. I thought that they would create an array of the correct size. However, not even in ArrayList is the implementation overridden (yet). That class could definitely have benefited. For instance:

Right now there will a be a new zero-length array that will only be used to create the actual array. Heck, I would even have expected using toArray(generator.apply(size())) as default implementation. Only thread-safe implementations would need to override that.
 
Carey Brown
Saloon Keeper
Posts: 6054
58
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:Interesting fact: the API docs are now found at https://docs.oracle.com/en/java/javase/11/docs/api/ (not http://docs.oracle.com/javase/11/docs/api/ as versions 7 through 10 would have suggested).


Is there any way to download the Java-11 Javadocs and view them from your hard drive?
 
Rob Spoor
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the regular download page of the Oracle JDK (https://www.oracle.com/technetwork/java/javase/downloads/index.html#JDK11) you can find a button to download the "Java SE 11 Documentation".
 
Carey Brown
Saloon Keeper
Posts: 6054
58
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I hadn't scrolled down the page once I started seeing references to earlier Java versions.
 
Marshal
Posts: 6974
471
Mac OS X VI Editor BSD Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:If I had a collection of Book objects, would bookList.toArray(Book[]::new) be easier to read than bookList.toArray(new Book[0])?


With no doubts. new Book[0] is confusing as hell to me, because it gives an impression that it will create a 0 length array, and since we know arrays can't expand, it gives a feeling while Book[]::new suggests me that it will create an array of the needed size whatever that size might be, which in fact I don't need to know. That's how my brains interpret that.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!