Opened 11 years ago

Last modified 2 months ago

#11390 closed enhancement

Switch to Java 8 — at Version 3

Reported by: Don-vip Owned by: team
Priority: major Milestone: 16.07
Component: Core Version:
Keywords: java8 Cc: stoecker, bastiK, simon04, skyper, Klumbumbus

Description (last modified by Don-vip)

This ticket is the successor of #8465 :)

Like for Java 7 two years ago, Oracle released their final versions of Java 7 (7u79 and 7u80), and the same auto-update feature for Windows and OSX users. We already have a significant majority of users who run JOSM with Java 8:

All users:

Java Main Version --> 6 (598,  4.3%) 7 (5128, 37.3%) 8 (8009, 58.2%) 9 (22,  0.2%)

Recent versions (>=7001):

Java Main Version --> 6 (37,  0.3%) 7 (4370, 35.7%) 8 (7818, 63.8%) 9 (22,  0.2%)
OS:  FreeBSD (2,  0.0%) Linux (2749, 22.6%) Mac (911,  7.5%) OpenBSD (1,  0.0%) SunOS (3,  0.0%) Windows (8500, 69.9%)

Java 7 users:

OS:  FreeBSD (2,  0.0%) Linux (2394, 49.5%) Mac (129,  2.7%) OpenBSD (3,  0.1%) SunOS (3,  0.1%) Windows (2310, 47.7%)

Java 8 users:

OS:  Linux (567,  7.1%) Mac (786,  9.9%) Windows (6613, 83.0%)

Linux is clearly behind. Main distributions of Java 7 users are:

O        251 ( 5.2%) Linux Debian GNU/Linux 8.0 (jessie)
O        157 ( 3.2%) Linux Mint 17.1 Rebecca
O        102 ( 2.1%) Linux Ubuntu 14.04.1 LTS
O        809 (16.7%) Linux Ubuntu 14.04.2 LTS
O        154 ( 3.2%) Linux Ubuntu 14.10
O        222 ( 4.6%) Linux Ubuntu 15.04

Java 8 is not yet available in Debian Jessie or Ubuntu LTS, but it will be released soon in Jessie backports then Trusty backports.

The transition will be easier than Java 7:

So, what's new?

Other useful links:

Proposed plan:

  1. Restore informative message "JOSM will soon no longer work with this version of Java..." on server side
  2. Ask OSX and Windows users to switch (revert/update this and this)
  3. Wait for Jessie and Trusty backports
  4. Ask Linux users to switch (revert/update of this)
  5. Switch about two months after that

Change History (3)

comment:1 by stoecker, 11 years ago

I think it's too early now in my eyes. But we can already think about a time-frame. A possible target could be that first version 2016 is Java 8? Maybe start Windows nagging in summer and Linux in autumn. That sounds like enough time.

For the Linux version I hope you remember the openSUSE Java 8 issues until few weeks ago and our resulting suggestion to use Java 7 instead.

Regarding the need for a switch - Is there anything where we say: "We want this" like it was for Java 7, which had a lot of useful new stuff?

comment:2 by bastiK, 11 years ago

I agree that it is too early to nag if there is no viable option for a Java upgrade.

Interesting new stuff:

  • Parallel sort could be used in StyledMapRenderer to speed up painting a little.
  • New JavaScript engine "Nashorn":
    With the "Rhino" engine in Java 7, I don't feel comfortable putting scripts on the wiki like we do for map styles and presets and allow unmoderated changes. It would be too easy to add malicious code which gains access to the user's file system and basically takes over the computer.
    In contrast, the new engine has a switch to turn off Java classes in JavaScript code entirely, so it looks as if it can be sandboxed and made air-tight.
    This means we can think of new uses of JavaScript in other parts of JOSM (currently used in CustomConfigurator for automated preference fixes).

in reply to:  1 comment:3 by Don-vip, 11 years ago

Description: modified (diff)

Replying to stoecker:

For the Linux version I hope you remember the openSUSE Java 8 issues until few weeks ago and our resulting suggestion to use Java 7 instead.

I totally forgot that, but I see the bug is fixed, so that's not a problem anymore.

Regarding the need for a switch - Is there anything where we say: "We want this" like it was for Java 7, which had a lot of useful new stuff?

Java 8 is a major release, there are a lot of good new stuff we can use:

  • Lambdas, method references, default and static interface methods: powerful new syntaxes allowing to write more compact code
  • Stream API: more compact code for iterations
  • Paraller sorting: improve performance
  • Predicate, Function: may replace/simplify our own Predicate and Function classes
  • Base64: may replace our own Base64 class
  • new Date/Time API: simplify all date-related stuff. May replace our DateUtils class
  • String joining: may replace Utils.join()
  • Optional parameters: may simplify null-handling
  • HTTP URL Permissions: may be useful to enforce imagery blacklist

Java 8 also contains:

  • new javascript engine for better performance
  • lot of security/crypto enhancements
  • Unicode/CLDR improvements

I'm sure there are even more stuff I did not see yet :)

Note: See TracTickets for help on using tickets.