Opened 10 years ago

Last modified 8 years ago

#11390 closed enhancement

Switch to Java 8 — at Version 69

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:

  • Java 8 is available and stable on all platforms
  • There's no need this time to build a new package for OSX
  • JOSM is built and tested daily with Java 8 for quite some time. It works fine and there's even a large performance gain in rendering: see Java 7 results vs Java 8 results

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): done in r8923
  3. Wait for Debian Jessie backport: done
  4. Wait for Ubuntu Trusty backport It seems it will never happen
  5. Ask Linux users to switch (revert/update of this): done in r10166
  6. Switch about one month after that

Change History (69)

comment:1 by stoecker, 10 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, 10 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, 10 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 :)

comment:4 by stoecker, 10 years ago

Last points ... don't argue with stuff which a user with Java 8 gets also in case we don't switch our code base. That's unfair :-)

comment:5 by mdk, 10 years ago

I install josm and josm-latest from repository http://josm.openstreetmap.de/apt/
The dependencies are:
Depends: openjdk-7-jre
So even if I have installed Java8, always Java7 is used. That may be the reason, why Linux normally use Java 7.

Isn't there a possibility to define a dependency like "use any Java >=1.7"?
I found something like
Depends: java-runtime-headless (>= 1.7),
but I couldn’t test it.

Edit: If we need an complete JRE, perhaps something like
Depends: java-runtime (>= 7)
would work.

Last edited 10 years ago by mdk (previous) (diff)

comment:6 by Don-vip, 10 years ago

In 8317/josm:

see #11390 - accept openjdk-8-jre in Debian control file, prefer Java 8 runtime over Java 7 in launch script

comment:7 by mdk, 10 years ago

I updated to 8319, but it still uses Java Version 1.7.0_79.
Also the Package dependency is still openjdk-7-jre, even after reinstalling JOSM. Has ​the package definition really changed on http://josm.openstreetmap.de/apt/?

The start scripts /usr/bin/josm and /usr/bin/josm-latest have in line 14 a list of possible Java installations. In this list openjdk-8 (and oracle-9) are missing. So add:
/usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java

But as fare as I understand /etc/alternatives/java is always preferred. As long as we follow the preferred Java version, we have to wait until Debian or other distributions will change this default to openjdk-8.

comment:8 by bastiK, 10 years ago

Please try the next version, an update on the server was missing.

comment:9 by Don-vip, 10 years ago

I wasn't sure if a commit was enough :) concerning java 9 I won't add it yet because it's way too early for that :)

comment:10 by stoecker, 10 years ago

Shouldn't it at least start when java 9 is there only? The openSUSE version only requests a minimum version, no max.

comment:11 by Don-vip, 10 years ago

The point is Java 9 is still in very early development phase and not expected until 2016 at best. We can wait a few months before supporting it officially :)

in reply to:  7 ; comment:12 by Don-vip, 10 years ago

Replying to mdk:

I updated to 8319, but it still uses Java Version 1.7.0_79.

Can you please try again now? I have rebuilt a new version (r8327).

in reply to:  10 comment:13 by Don-vip, 10 years ago

Replying to stoecker:

The openSUSE version only requests a minimum version, no max.

By the way OpenSUSE is not really the example to follow regarding how they messed up their packaging of Java 8 and the time they needed to fix it.

in reply to:  12 comment:14 by mdk, 10 years ago

Replying to Don-vip:

Can you please try again now? I have rebuilt a new version (r8327).

On a default Ubuntu 15.04 installation r8327 is still running with Java Version 1.7.0_79
Package is now requiring openjdk-7-jre | openjdk-8-jre (fixed)
/usr/bin/josm-latest now also checks for java-8-openjdk and java-8-openjdk-$ARCH (fixed)

But as long as I would not change the default Java with sudo update-alternatives --config java from

* 0            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1071      automatischer Modus

to

  4            /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java   1069      manueller Modus

I have to wait for Ubuntu to change the default or manually override.
When I change the default Java to option 4, JOSM runs with Java Version 1.8.0_45-internal.

As Java 7 is not longer supported with bug fixes, I hope the Linux distributions will change the default Java version recently.

But for all people which not want to tweak their installation, we have to wait ...

Last edited 10 years ago by mdk (previous) (diff)

comment:15 by Don-vip, 10 years ago

Ok thanks. Java 7 on Linux should still receive security updates backported from openjdk8.

comment:16 by Don-vip, 10 years ago

In 8333/josm:

see #11390 - prefer Java 8 runtime over Java 7 in launch script

comment:17 by mdk, 10 years ago

r8333: Now JOSM uses java 8 even if Debian alternatives is configured to openjdk-7.
I think this overruling is ok.

So the users of repository ​http://josm.openstreetmap.de/apt/ will now switch to openjdk-8, if installed.

Does anybody has influence on JOSM packages for Debian, Ubuntu or other distributions? They often use quite old versions.

Actual supported Ubuntu versions are:

  • 12.04 (LTS): JOSM 4878
  • 14.04 (LTS): JOSM 6502
  • 14.10: JOSM 6502
  • 15.04: JOSM 7995
  • 15.10 (planed): JOSM 7995

Debian uses:

  • squeeze (oldoldstable): JOSM 3376
  • wheezy (oldstable): JOSM 5267
  • jessie (stable): JOSM 7643
  • stretch (testing): JOSM 7643
  • sid (unstable): JOSM 7643
  • experimental (rc-buggy): JOSM 8159

Should we invite Ubuntu users (which use JOSM from universe) to add repository on openstreetmap.de instead of some manually update or installation?

Last edited 10 years ago by mdk (previous) (diff)

in reply to:  17 comment:18 by Don-vip, 10 years ago

Replying to mdk:

r8333: Now JOSM uses java 8 even if Debian alternatives is configured to openjdk-7.
I think this overruling is ok.

I think too.

Does anybody has influence on JOSM packages for Debian, Ubuntu or other distributions? They often use quite old versions.

There is no backport for old distribs but Sebastian does a great job to keep up to date the Debian package in the experimental branch, which can be reused by Ubuntu.

Should we invite Ubuntu users (which use JOSM from universe) to add repository on openstreetmap.de instead of some manually update or installation?

I don't think this is needed. There's still time to see if Ubuntu 15.10 switches to Java 8 by default. I hope Wheezy, Jessie and Trusty will have openjdk8 backported before that.

comment:19 by Don-vip, 10 years ago

Description: modified (diff)

Status update:

Good news is that it includes OpenJFX. So maybe we could try to give a look to JavaFX as well.

comment:20 by Don-vip, 10 years ago

For those interested, Oracle offers a free 3-week MOOC on Java 8 / Lambdas:

https://apexapps.oracle.com/pls/apex/f?p=44785:145:0::::P145_EVENT_ID,P145_PREV_PAGE:4887,143

comment:21 by shinigami, 10 years ago

So, is it time to move to jdk8?:)

comment:22 by bastiK, 10 years ago

Currently 62% of all JOSM users are running with Java 8.

I feel that the PPA for Ubuntu 14.04 is not really a great solution, but would be a measure of last resort. Personally, I'd rather install the Oracle package.

The conservative approach is to wait until openjdk8 is included in the official backport repository of Ubuntu 14.04 ( ticket) or until the next LTS version is released in April 2006 (whatever comes first). But I'm not sure you guys what to wait that long. ;)

comment:23 by Don-vip, 10 years ago

Agreed with bastiK, I don't want to force Ubuntu users to install a PPA. And I'd like to have some progress from Oracle on these bugs before switching:

comment:24 by Don-vip, 10 years ago

Milestone: 16.04

Java 8 is now used by 65% of all JOSM users.

It's however very unlikely to see Java 8 become available for Ubuntu 14.04 LTS. The ticket is starving for more than a year, clearly Canonical doesn't give a shit about Java.

So I target the code migration to April 2016, in coincidence with the availability of the next LTS.

To ensure a smooth migration, I'll however implement the migration suggestion for Windows and OSX users, like previously for Java 7. They really need to switch anyway because Oracle does not provide binaries anymore since April 2015, so they do not receive security fixes.

I have joined the Quality Outreach OpenJDK project and will use JavaBugs as a coordinating wiki page with Oracle. I hope it will have a benefic impact on the resolution of our bug reports.

comment:25 by Don-vip, 10 years ago

In 8923/josm:

see #11390 - invite Windows and OSX users to update to Java 8

in reply to:  25 comment:26 by rickmastfan67, 10 years ago

Replying to Don-vip:

In 8923/josm:

see #11390 - invite Windows and OSX users to update to Java 8

Is there any way to add an 'OK' button so that we can select an option in the dialog without having to hit the 'Update Java' button and have our browser open up to Java's website?

comment:27 by Don-vip, 10 years ago

of course :)

comment:28 by Don-vip, 10 years ago

In 8934/josm:

see #11390 - rework update dialog

comment:29 by mdk, 10 years ago

Is it correct, that actually JSOM starts by default again with Java 7 inseat of 8? I testet it with actually josm-latest (9062) and the stable version (9060).

comment:30 by Don-vip, 10 years ago

No. Did you set a JAVA_HOME? Can you please look if a path on your system would be missing from r8970?

in reply to:  30 comment:31 by mdk, 10 years ago

I din't change anything at JAVA_HOME. I just update Java 7 and JOSM on my Ubuntu system.

But I try to analyse the start script and I don't understad it compleatly:
ALTERNATIVE_JDK contains /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
and JAVA_CMDS contains:

/bin/java 
/usr/lib/jvm/java-8-openjdk/bin/java 
/usr/lib/jvm/java-8-openjdk-i386/bin/java 
/usr/lib/jvm/java-8-oracle/bin/java 
/usr/lib/jvm/java-7-openjdk/bin/java 
/usr/lib/jvm/java-7-openjdk-i386/bin/java 
/usr/lib/jvm/java-7-oracle/bin/java 
/usr/lib/jvm/java-9-openjdk/bin/java 
/usr/lib/jvm/java-9-openjdk-i386/bin/java 
/usr/lib/jvm/java-9-oracle/bin/java

After the first loop (with if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then}) JAVACMD contains /usr/lib/jvm/java-7-openjdk-i386/bin/java, so the second loop is skipt and ends with
Using /usr/lib/jvm/java-7-openjdk-i386/bin/java to execute josm-latest.

But also /usr/lib/jvm/java-8-openjdk-i386/bin/java exists in my system but is not choosen (has to do with ALTERNATIVE_JDK?).

When I remove the first loop, the second one (with if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then) returns the correct
Using /usr/lib/jvm/java-8-openjdk-i386/bin/java to execute josm-latest.

comment:32 by Don-vip, 10 years ago

In 9066/josm:

see #11390 - drop support for ALTERNATIVE_JDK in Debian startup scripts

comment:33 by Don-vip, 10 years ago

Description: modified (diff)

comment:34 by bastiK, 10 years ago

Do we really want to ignore the user's update-alternatives configuration? This is the standard way to set the default Java version system-wide (i.e. what path is selected if you just type java).

@mdk: You can run update-alternatives --config java on the command line to select the Java version.

in reply to:  34 comment:35 by mdk, 10 years ago

Replying to bastiK:

Do we really want to ignore the user's update-alternatives configuration? This is the standard way to set the default Java version system-wide (i.e. what path is selected if you just type java).

@mdk: You can run update-alternatives --config java on the command line to select the Java version.

I know (see discussion above).

To summarise: The goal is switching to Java 8. JOSM works fine with Java 8. We don't want to wait until Java 8 is default (ALTERNATIVE_JDK) in Debian, Ubuntu, Mint, etc. We don't want to treat every of these users to change the default (running update-alternatives --config java).

Conclusion: (see comment 18) The JOSM start script should ignores ALTERNATIVE_JDK and search for the first existing of Java 8, Java 7, Java 9.

Since r8333 the start script prefers Java 8, if existing. But since refectoring of the script in r8970 Java 7 is preffered again. Now since r9066 Java 8 is preferred again.

comment:36 by stoecker, 10 years ago

Description: modified (diff)

comment:37 by Don-vip, 10 years ago

Users can still override the default behaviour by setting JAVA_HOME or JAVACMD environment variables.

comment:38 by bastiK, 10 years ago

All right then...

comment:39 by Don-vip, 10 years ago

Description: modified (diff)

comment:40 by mdk, 10 years ago

I'm not sure what happend, but I noticed, that both, josm and josm-latest, still using Java 7. Both start scripts still contain the part with ALTERNATIVE_JDK. I use the http://josm.openstreetmap.de/apt repository. Even reinstalling didn't change the script.

comment:41 by mdk, 10 years ago

OK, since r9146 JOSM uses 1.8 by default.

in reply to:  34 ; comment:42 by sebastic, 10 years ago

Replying to bastiK:

Do we really want to ignore the user's update-alternatives configuration? This is the standard way to set the default Java version system-wide (i.e. what path is selected if you just type java).

Ignoring the configured default JDK when JOSM still supports it is not a good thing.

@mdk: You can run update-alternatives --config java on the command line to select the Java version.

Changing the default JDK (all executables, not only /usr/bin/java) should be done with update-java-alternatives from the java-common package, e.g. for OpenJDK 8:

update-java-alternatives -s java-1.8.0-openjdk-amd64

Use update-java-alternatives -l to list all available alternatives.

in reply to:  42 comment:43 by mdk, 10 years ago

Ignoring the configured default JDK when JOSM still supports it is not a good thing.

There are two alternative scenarios:

  • wait until Debian (or Ubuntu) change the default JDK. This would be ok. If a problem occure with JOSM the user can manually switch back to 7.
  • wait until JOSM requires Java 8 and dosn't work wit 7. If now a user encounter a problem according to Java 8, he is lost.

The acual approach with using Java 8 for JOSM, even if the user configuration prefers Java 7 for other prgramms, allows us to test JOSM with Java 8 and having Java 7 as fallback. So we hopefully find problems with Java 8 early.

comment:44 by sebastic, 10 years ago

Another option is to print a notice suggesting the user to switch their alternatives to Java 8 (including the update-java-alternatives command to do so) when 7 is still configured as the default.

You're not going to get many distribution package users providing feedback with Java 8, because it won't be installed on most systems. The dependencies still pull in OpenJDK 7, only users who have explicitly installed Java 8 (too) will have it used for JOSM. Those users who explicitly choose to use Java 8 can also easily update their alternatives or specify the appropriate JAVACMD to use Java 8 for JOSM as long as it's not the distribution default yet.

comment:45 by mdk, 10 years ago

Sorry, I don't understand this discussion!

As far as I understand Java alternatives is for applications which don't care about the java version. On the other hand a Java application can explicitly require a Java version (package dependency).

I think it's the wrong way to treat the user to change the default Java for ALL of his Java applications.

And it's also the wrong way (yet) to force the user to install Java 8 (via package dependency).

What is the problem if the devellopers of JOSM say: "If the user has installed Java 7 and Java 8, JOSM should prefer Java 8."? Why do you insist in changing Java version for other applications too?

comment:46 by mdk, 10 years ago

@Don-vip: BTW do you have newer statistics about the used Java version?

in reply to:  45 comment:47 by sebastic, 10 years ago

Replying to mdk:

As far as I understand Java alternatives is for applications which don't care about the java version. On the other hand a Java application can explicitly require a Java version (package dependency).

I think it's the wrong way to treat the user to change the default Java for ALL of his Java applications.

I agree that users should not be encouraged to change the default Java for all applications.

It is also the wrong way to treat the user by ignoring his configured Java version.

And it's also the wrong way (yet) to force the user to install Java 8 (via package dependency).

Then why is the alternatives support removed from the josm launcher? Those that wish to use Java 8 can do so by exporting the appropriate JAVACMD in the environment. You can even have the packaging install a profile.d snippet that has the export command commented to make it easy for the users to use Java 8 (only) for JOSM by uncommenting the export command.

What is the problem if the devellopers of JOSM say: "If the user has installed Java 7 and Java 8, JOSM should prefer Java 8."? Why do you insist in changing Java version for other applications too?

The problem is that JOSM doesn't need to require Java 8 yet, and so should adhere to the system configuration for which Java to use. The ability to use Java 8 for JOSM already existed (exporting JAVACMD), there is no need to remove the support for the alternatives system.

comment:48 by mdk, 10 years ago

Sorry, I still don't understand this discussion!

What is the problem if the devellopers of JOSM say: "If the user has installed Java 7 and Java 8, JOSM should prefer Java 8."?

comment:49 by mdk, 10 years ago

Java alternatives is for applications which don't care about the Java version.

All the above is about JOSM do care about the used Java version (prefer 8 over7)!

in reply to:  46 ; comment:50 by Don-vip, 10 years ago

Replying to mdk:

@Don-vip: BTW do you have newer statistics about the used Java version?

Here they are:

All users:
Java Main Version --> 6 (381,  3.3%) 7 (2693, 23.6%) 8 (8341, 73.0%) 9 (9,  0.1%)
OS:  FreeBSD (13,  0.1%) Linux (2914, 26.8%) Mac (792,  7.3%) OpenBSD (2,  0.0%) Windows (7151, 65.8%)

Recent versions (>= 7001):
Java Main Version --> 6 (10,  0.1%) 7 (2170, 21.0%) 8 (8155, 78.8%) 9 (9,  0.1%)
OS:  FreeBSD (13,  0.1%) Linux (2763, 26.7%) Mac (781,  7.5%) OpenBSD (2,  0.0%) Windows (6800, 65.6%)

Java 7 users:
OS:  FreeBSD (2,  0.1%) Linux (1708, 66.8%) Mac (40,  1.6%) OpenBSD (2,  0.1%) Windows (805, 31.5%)

Java 8 users:
OS:  FreeBSD (11,  0.1%) Linux (1231, 14.8%) Mac (746,  9.0%) Windows (6332, 76.1%)

Java 9 users:
OS:  Linux (28, 77.8%) Mac (1,  2.8%) Windows (7, 19.4%)

Nearly all Windows and OSX users are now using Java 8. Linux still remains behind but I note a significant progress.

I will revert r9066 after the switch. If it's really important for Debian, it's easy to patch it, but we need a majority of users running Java 8 before switching, to ensure a smoother transition in April (after the release of next Ubuntu LTS since Ubuntu maintainers refuse to backport Java 8 to current LTS, and we have many LTS users).

in reply to:  48 comment:51 by sebastic, 10 years ago

Replying to mdk:

What is the problem if the devellopers of JOSM say: "If the user has installed Java 7 and Java 8, JOSM should prefer Java 8."?

Because the application developers ignore the system configuration on the systems where their application runs. The users should be the ones to decide that they want to use Java 8 (not the system default) for JOSM and they can do that by exporting JAVACMD or using update-java-alternatives.

By removing the alternatives support but not actually requiring Java 8, the application developers communicate that they don't care about the user and system preference expressed via the alternatives system. But they don't care enough about Java 8 to have their PPA packaging actually install OpenJDK 8 instead of 7.

Replying to mdk:

Java alternatives is for applications which don't care about the Java version.

This is wrong, where did you get that idea?

All the above is about JOSM do care about the used Java version (prefer 8 over7)!

The packaging doesn't, only the startup page recommends the use of Java 8.

The packaging for the PPA still prefers Java 7 over 8 and 9:

$ grep Depends linux/*/DEBIAN/control 
linux/latest/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre
linux/tested/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre

The josm package in Debian just depends on the default-jre or any other java package that provides java7-runtime the minimum required for JOSM:

Depends: default-jre | java7-runtime,

in reply to:  50 ; comment:52 by sebastic, 10 years ago

Replying to Don-vip:

Nearly all Windows and OSX users are now using Java 8. Linux still remains behind but I note a significant progress.

This makes sense because they tend to use the Oracle JDK, and not packages from their distribution. Since you cannot easily get JDK 7 updates from Oracle any more, having users on those systems switch to Java 8 is a good thing.

OpenJDK 7 still gets updates on the Linux distributions that have it as their default. Switching away from that default by removing its support from the launcher, disadvantages those users. The JOSM developers already have a large userbase on other systems using Java 8, they don't need the package users for that too.

I will revert r9066 after the switch. If it's really important for Debian, it's easy to patch it, but we need a majority of users running Java 8 before switching, to ensure a smoother transition in April (after the release of next Ubuntu LTS since Ubuntu maintainers refuse to backport Java 8 to current LTS, and we have many LTS users).

As I wrote in our short email conversation, I wasn't annoyed enough to revert r9066 for the josm Debian package. I would like to see r9066 reverted because it's not the appropriate change to get more Linux users to use Java 8.

in reply to:  52 ; comment:53 by Don-vip, 10 years ago

Replying to sebastic:

By removing the alternatives support but not actually requiring Java 8, the application developers communicate that they don't care about the user and system preference expressed via the alternatives system.

We care about our users a lot. If we didn't we would have switched to Java 8 already. We don't switch because Ubuntu maintainers don't care to backport openjdk-8, refraining us to switch transparently because Ubuntu LTS does not provide Java 8.

But they don't care enough about Java 8 to have their PPA packaging actually install OpenJDK 8 instead of 7.

I don't understand that part. I'm a total newbie about packaging: is there a way to update our packaging so openjdk-8 is installed if available, without causing an error with Ubuntu LTS (referencing a non-existing package) ?

The packaging for the PPA still prefers Java 7 over 8 and 9:

$ grep Depends linux/*/DEBIAN/control 
linux/latest/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre
linux/tested/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre

I did not know order was important. So if no version of Java is installed, the first one is automatically installed?

Replying to sebastic:

The JOSM developers already have a large userbase on other systems using Java 8, they don't need the package users for that too.

Other systems don't count. Unresolved Java 8 bugs that impact JOSM identified today mainly concern Linux, see JavaBugs. Today Linux users are a small part (~25%) of our user base. Java 8 Linux users are a minority (~40%) of those. Users willing to provide feedback are then again a smaller minority. We really need as most as testing as possible.

I would like to see r9066 reverted because it's not the appropriate change to get more Linux users to use Java 8.

I will revert it after we switch, so it's only for 3 months. If it's not the appropriate change, I am listening to any other mean to increase the adoption of Java 8 without user intervention.

in reply to:  53 comment:54 by sebastic, 10 years ago

Replying to Don-vip:

Replying to sebastic:

But they don't care enough about Java 8 to have their PPA packaging actually install OpenJDK 8 instead of 7.

I don't understand that part. I'm a total newbie about packaging: is there a way to update our packaging so openjdk-8 is installed if available, without causing an error with Ubuntu LTS (referencing a non-existing package) ?

Newbies to Debian packaging should read the relevant documentation, most importantly:

For Java applications like JOSM the Debian policy for Java is also relevant. For upstream developers in general the Upstream Guide is another important reference.

Debian Policy Manual 7.1 Syntax of relationship fields is the relevant section documenting alternative dependencies:

In the Depends, Recommends, Suggests, Pre-Depends, Build-Depends and Build-Depends-Indep control fields of the package, which declare dependencies on other packages, the package names listed may also include lists of alternative package names, separated by vertical bar (pipe) symbols |. In such a case, that part of the dependency can be satisfied by any one of the alternative packages.

The dependencies of the josm binary package should match the preference expressed in the josm launcher script:

        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-8-oracle/bin/java"
        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java"
Depends: openjdk-8-jre | openjdk-7-jre | openjdk-9-jre

Because no virtual java runtime package is included in the alternatives, custom java packages like those created with make-jpkg from the Oracle JDK/JRE tarballs don't satisfy the dependency. Adding | java7-runtime will allow those packages to satisfy the dependency too, because the packages created by make-jpkg provide the javaN-runtime virtual package, but they still won't be used until their paths are added in the josm launcher script too. The Web Upd8 oracle java pacages also provide the javaN-runtime virtual packages. Because the webupd8 package are supported by the josm launcher script, the better Depends for the josm PPA packaging is the same as used for the josm Debian package:

Depends: default-jre | java7-runtime

If you want to express the supported JREs by the launcher in the dependencies you should use:

Depends: openjdk-8-jre | oracle-java8-installer | openjdk-7-jre | oracle-java7-installer | openjdk-9-jre | oracle-java9-installer | java7-runtime

To force the installation of OpenJDK 8 if available you can use:

Depends: openjdk-8-jre | java7-runtime

Because the javaN-runtime virtual package is provided by all proper JDK & JRE packages, the user can prevent the installation of the first alternative by specifying a different package that provides javaN-runtime, e.g.:

apt-get install josm oracle-java8-installer

If you don't have openjdk-8-jre installed yet, you can also specify its removal along with the installation of josm & oracle-java8-installer to hint the resolver:

apt-get install josm oracle-java8-installer openjdk-8-jre-


The packaging for the PPA still prefers Java 7 over 8 and 9:

$ grep Depends linux/*/DEBIAN/control 
linux/latest/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre
linux/tested/DEBIAN/control:Depends: openjdk-7-jre | openjdk-8-jre | openjdk-9-jre

I did not know order was important. So if no version of Java is installed, the first one is automatically installed?

Alternative dependencies are tested in the order in which they are specified, this is an implementation detail of the resolver, not policy defined behavior. Autobuilders like those used for the Debian archive and Launchpad generally only consider the first dependency in a list of alternatives.

The first package of the alternatives that can be installed (because its dependencies can also be installed, and none conflict with other packages to be installed) will be chosen by the resolver, unless another package that is also specified to be installed satisfies the dependency too.

comment:55 by Don-vip, 10 years ago

Thank you for your detailed explanations, I understand better now. Still, I have a question.Why don't you depend only on java7-runtime? It should be enough, no?

in reply to:  55 comment:56 by sebastic, 10 years ago

Replying to Don-vip:

Why don't you depend only on java7-runtime? It should be enough, no?

Depending on only the java7-runtime virtual package is sufficient, but including a real package before the virtual package is a best practice.

Specifying a default choice of the packages providing the virtual package is recommended in Debian Policy Manual 7.5 Virtual packages - Provides:

To specify which of a set of real packages should be the default to satisfy a particular dependency on a virtual package, list the real package as an alternative before the virtual one.

These real packages can also include a version requirement, which virtual packages don't support as documented in section 7.5 too:

If a relationship field has a version number attached, only real packages will be considered to see whether the relationship is satisfied (or the prohibition violated, for a conflict or breakage). In other words, if a version number is specified, this is a request to ignore all Provides for that package name and consider only real packages. The package manager will assume that a package providing that virtual package is not of the "right" version. A Provides field may not contain version numbers, and the version number of the concrete package which provides a particular virtual package will not be considered when considering a dependency on or conflict with the virtual package name.(52)

But this is not relevant for the javaN-runtime virtual packages.

comment:57 by Don-vip, 10 years ago

ok it makes perfect sense to me now, thank you :)
Then I'm going to change our dependencies as follows:

Depends: openjdk-8-jre | java7-runtime

comment:58 by stoecker, 10 years ago

Wouldn't openjdk-8-jre | java8-runtime | java7-runtime be correct? We want Java8 and Java7 should only be the last resort.

comment:59 by Don-vip, 10 years ago

In 9237/josm:

see #11390 - Make Debian control scripts depend on openjdk-8-jre as a preffered choice of Java runtime

in reply to:  58 comment:60 by sebastic, 10 years ago

Replying to stoecker:

Wouldn't openjdk-8-jre | java8-runtime | java7-runtime be correct? We want Java8 and Java7 should only be the last resort.

Adding | java8-runtime has not real benefit over the openjdk-8-jre dependency, all JDK/JRE 8 packages also provide java7-runtime.

$ apt-cache show openjdk-8-jre | grep Provides
Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime, java8-runtime
$ apt-cache show openjdk-9-jre | grep Provides
Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime, java8-runtime, java9-runtime

comment:61 by stoecker, 10 years ago

It would prefer a non-openjdk java version 8 over an openjdk version 7 Java. Don't know if non-openjdk (oracle?) exists for Debian.

Last edited 10 years ago by stoecker (previous) (diff)

comment:62 by sebastic, 10 years ago

On Debian OpenJDK & GCJ (for the architectures that don't have a proper support for OpenJDK) are the only JREs available.

If you want to use the Oracle JDK on Debian, creating the package yourself from the Oracle tarball with make-jpkg is the best option.

Since the JOSM PPA is only relevant for Ubuntu users, adding oracle-java8-installer for the WebUpd8 PPA packages is a better choice than adding two virtual packages, i.e.:

Depends: openjdk-8-jre | oracle-java8-installer | java7-runtime

The josm Debian package doesn't use the control file included in the JOSM source, because it needs to be a proper source package to build the binary packages and account for the additional dependencies not embedded in the JOSM JAR. The josm Debian package does use the josm launcher, icons, desktop & appdata files to share their maintenance between the JOSM upstream developers and package maintainers in Debian. This way the upstream packaging benefits from the expertise of the Debian package maintainers (like the Icon Theme Specification changes for example), because upstream developers generally lack that expertise. Since JOSM 8800 the packaging is not completely separate any more.

comment:63 by Don-vip, 10 years ago

In 9249/josm:

see #11390 - resolve last javadoc warnings with Java 8. "ant javadoc" now produces 0 warning \o/

comment:64 by Don-vip, 10 years ago

update on stats:

Recent versions (>= 7001):
Java Main Version --> 6 (9,  0.1%) 7 (2442, 22.1%) 8 (8601, 77.8%) 9 (4,  0.0%)
OS:  FreeBSD (10,  0.1%) Linux (2744, 24.9%) Mac (804,  7.3%) OpenBSD (4,  0.0%) SunOS (1,  0.0%) Windows (7466, 67.7%)

Java 7 users:
OS:  FreeBSD (2,  0.1%) Linux (1756, 60.8%) Mac (32,  1.1%) OpenBSD (4,  0.1%) SunOS (1,  0.0%) Windows (1093, 37.8%)

Java 8 users:
OS:  FreeBSD (8,  0.1%) Linux (1165, 13.3%) Mac (775,  8.9%) Windows (6796, 77.7%)

Some interesting OS stats:

O        155 ( 1.4%) Linux Arch Linux [7: 21.3%, 8: 78.7%]

O         71 ( 0.6%) Linux Debian GNU/Linux 8.2 (jessie) [7: 73.2%, 8: 26.8%]
O        127 ( 1.1%) Linux Debian GNU/Linux 8.3 (jessie) [7: 75.6%, 8: 24.4%]

O         58 ( 0.5%) Linux Debian GNU/Linux testing (stretch) [7: 44.8%, 8: 55.2%]
O         43 ( 0.4%) Linux Debian GNU/Linux unstable (sid) [7: 60.5%, 8: 39.5%]

O         72 ( 0.6%) Linux Fedora release 23 (Twenty Three) [8: 100.0%]

O         67 ( 0.6%) Linux Mint 17.2 Rafaela [7: 77.6%, 8: 22.4%]
O        114 ( 1.0%) Linux Mint 17.3 Rosa [7: 82.3%, 8: 17.7%]

O        941 ( 8.5%) Linux Ubuntu 14.04.3 LTS [7: 67.1%, 8: 32.8%, 9: 0.1%]

O        353 ( 3.2%) Linux Ubuntu 15.10 [7: 50.9%, 8: 48.6%, 9: 0.6%]

O         68 ( 0.6%) Linux openSUSE 13.2 (Harlequin) (x86_64) [7: 10.3%, 8: 89.7%]
O         38 ( 0.3%) Linux openSUSE Leap 42.1 (x86_64) [8: 100.0%]

O        171 ( 1.5%) Mac OS X 10.10.5 [7: 4.1%, 8: 95.9%]
O         70 ( 0.6%) Mac OS X 10.11.1 [7: 5.7%, 8: 94.3%]
O        203 ( 1.8%) Mac OS X 10.11.2 [7: 3.0%, 8: 97.0%]
O        178 ( 1.6%) Mac OS X 10.11.3 [7: 1.7%, 8: 98.3%]

O        103 ( 0.9%) Windows 10 32-Bit [8: 100.0%]
O       1477 (13.4%) Windows 10 64-Bit [8: 100.0%]
O        706 ( 6.4%) Windows 7 32-Bit [7: 10.1%, 8: 89.9%]
O       3363 (30.4%) Windows 7 64-Bit [7: 14.6%, 8: 85.4%, 9: 0.1%]
O        218 ( 2.0%) Windows 8 64-Bit [7: 29.8%, 8: 70.2%]
O       1055 ( 9.6%) Windows 8.1 64-Bit [7: 5.6%, 8: 94.4%]
O        325 ( 2.9%) Windows XP 32-Bit [7: 32.6%, 8: 67.4%]

comment:65 by sebastic, 9 years ago

Quoting Emmanuel Bourg on the debian-java list:

OpenJDK 8...

...is now the default Java runtime in unstable! I just uploaded
java-common/0.55 to unstable and it switched the default-jre/jdk to
openjdk-8 for all the architectures previously defaulting to openjdk-7.

I expect a few packages to FTBFS after this update (most notably
eclipse) but the main compatibility issues have already been fixed.

Enjoy :)

The OpenJDK 8 stats for Debian and Ubuntu should start to rise now that it has been made the default. Ubuntu should include this change in the upcoming LTS release (xenial), the DebianImportFreeze is not planned until February 18th.

comment:66 by Don-vip, 9 years ago

Milestone: 16.0416.05

comment:67 by Don-vip, 9 years ago

Stats update:

Recent versions (>= 7001):
Java Main Version --> 6 (14,  0.2%) 7 (1653, 18.0%) 8 (7535, 81.9%) 9 (1,  0.0%)
OS:  FreeBSD (6,  0.1%) Linux (1915, 21.0%) Mac (666,  7.3%) Windows (6535, 71.6%)

Very recent versions (>= 9329):
Java Main Version --> 6 (14,  0.2%) 7 (1017, 13.7%) 8 (6380, 86.1%) 9 (1,  0.0%)
OS:  FreeBSD (6,  0.1%) Linux (1669, 22.8%) Mac (571,  7.8%) Windows (5085, 69.4%)

Current versions (>= 9979):
Java Main Version --> 6 (14,  0.2%) 7 (816, 13.2%) 8 (5333, 86.5%) 9 (1,  0.0%)
OS:  FreeBSD (3,  0.0%) Linux (1409, 23.2%) Mac (480,  7.9%) Windows (4191, 68.9%)

Java 7 users:
OS:  FreeBSD (1,  0.0%) Linux (1203, 54.4%) Mac (21,  0.9%) Windows (987, 44.6%)

Java 8 users:
OS:  FreeBSD (7,  0.1%) Linux (1649, 17.3%) Mac (789,  8.3%) Windows (7062, 74.3%)

Main OS:

O        129 ( 1.1%) Linux Arch Linux [7: 18.4%, 8: 81.6%]
O        177 ( 1.5%) Linux Debian GNU/Linux 8.4 (jessie) [7: 54.8%, 8: 45.2%]
O        120 ( 1.0%) Linux Mint 17.3 Rosa [7: 79.2%, 8: 20.8%]
O        126 ( 1.1%) Linux Ubuntu 14.04.3 LTS [7: 83.3%, 8: 16.7%]
O        716 ( 6.1%) Linux Ubuntu 14.04.4 LTS [7: 58.1%, 8: 41.9%]
O        254 ( 2.2%) Linux Ubuntu 15.10 [7: 45.3%, 8: 54.7%]
O        358 ( 3.1%) Linux Ubuntu 16.04 LTS [7: 2.0%, 8: 98.0%]

O        171 ( 1.5%) Mac OS X 10.10.5 [7: 3.5%, 8: 96.5%]
O        368 ( 3.1%) Mac OS X 10.11.4 [7: 1.1%, 8: 98.9%]

O        119 ( 1.0%) Windows 10 32-Bit [8: 100.0%]
O       1944 (16.6%) Windows 10 64-Bit [8: 100.0%]
O        785 ( 6.7%) Windows 7 32-Bit [6: 0.1%, 7: 15.0%, 8: 84.8%]
O       3034 (25.9%) Windows 7 64-Bit [6: 0.1%, 7: 11.9%, 8: 87.9%, 9: 0.1%]
O        217 ( 1.9%) Windows 8 64-Bit [7: 29.5%, 8: 70.5%]
O       1016 ( 8.7%) Windows 8.1 64-Bit [7: 4.3%, 8: 95.7%]
O        728 ( 6.2%) Windows XP 32-Bit [6: 0.1%, 7: 47.1%, 8: 52.7%]

About a third of Ubuntu LTS users have already upgraded to 16.04 (and so to Java 8).

@Dirk: I plan to do the same next week with JOSM server, if that's OK for you. I see Ubuntu has now switched to Python 3 only, is it going to be a problem for Trac?

comment:68 by Don-vip, 9 years ago

In 10166/josm:

see #11390 - ask some Linux users to switch to Java 8 (partial revert/update or r7001)

comment:69 by Don-vip, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.