Create account / Log in

VASSAL doesn't seem to work with Java 9 version

Issues with the Vassal engine.

Moderators: Tim M, uckelman

VASSAL doesn't seem to work with Java 9 version

Postby robinreeve » January 2nd, 2019, 2:51 pm

Hi,
There is a discussion in the gamesquad forum devoted to Advanced Squad Leader, where people say that VASSAL won't work with the Java 9 version.
Is this true and, if ot is the case, will the issue be adressed ?

Thanks in advance for the answer.

Robin
robinreeve
 
Posts: 5
Joined: January 2nd, 2019, 2:48 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby uckelman » January 5th, 2019, 7:31 pm

Thus spake robinreeve:
> Hi,
> There is a discussion in the gamesquad forum devoted to Advanced Squad
> Leader, where people say that VASSAL won't work with the Java 9 version.
> Is this true and, if ot is the case, will the issue be adressed ?
>
> Thanks in advance for the answer.
>
> Robin

Would you mind providing a link to that discussion?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8053
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Re: VASSAL doesn't seem to work with Java 9 version

Postby DrPsyche » January 10th, 2019, 11:00 am

Yeah, I did try it once with Java 9, but then eventually had to switch back to Java 8.
I'm sure there should be a pretty clear explanation.
User avatar
DrPsyche
 
Posts: 1
Joined: January 10th, 2019, 10:38 am

Re: VASSAL doesn't seem to work with Java 9 version

Postby tinmon » January 11th, 2019, 2:17 pm

This is part of the error log i get when trying to open VASL. I think I got the same warning about "illegal reflective access operation" when launching VASSAL the first time (when clicking the screen with take the tour or jump right in. Now I get to the menu but can't open the VASL module.

This is Open JDK, Not sure if that's an issue after reading the thread on Gamesquad?

Code: Select all
2019-01-11 15:06:37,557 [1-main] INFO  VASSAL.launch.StartUp - OS Linux 4.15.0-20-generic
2019-01-11 15:06:37,557 [1-main] INFO  VASSAL.launch.StartUp - Java version 10.0.2
2019-01-11 15:06:37,557 [1-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.2.17
2019-01-11 15:06:37,557 [1-main] INFO  VASSAL.launch.Launcher - Player
2019-01-11 15:06:38,461 [0-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by VASSAL.tools.image.ImageIOImageLoader (file:/home/hawk/VASSAL/VASSAL-3.2.17/lib/Vengine.jar) to field sun.java2d.cmm.ProfileDeferralMgr.deferring
WARNING: Please consider reporting this to the maintainers of VASSAL.tools.image.ImageIOImageLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
tinmon
 
Posts: 1
Joined: January 11th, 2019, 2:05 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby robinreeve » January 12th, 2019, 6:53 am

Reverting to Java 8 can hardly be a long term solution, especially if you have other programs requiring the latest version.
robinreeve
 
Posts: 5
Joined: January 2nd, 2019, 2:48 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby Malnorma » January 13th, 2019, 6:30 am

You can have different Java versions installed. I have a dedicated JRE that runs Vassal properly, but the system JRE just gets updated whenever. You just need to make sure Vassal uses the right one (either by modifying the shell script that starts it, or explicitly running the jar via the right java binary from a custom shortcut).

I look forward to ditching Java completely when Vassal 4 arrives in the year 2057 ;)
Malnorma
 
Posts: 88
Joined: October 14th, 2015, 9:26 am

Re: VASSAL doesn't seem to work with Java 9 version

Postby robinreeve » January 13th, 2019, 6:38 am

I am not introduced in the manipulations you are speaking about.
It seems rather complicated from my non initiated point of view - I don't know what a "shell" is fir an example.
And I believe that many people would be in my case.

Don't you think that the VASSAL developers could design a new version compatible with Java 9?
Or at least give precise instructions about how you can have two Java versions installed and choosing the adapted one?
robinreeve
 
Posts: 5
Joined: January 2nd, 2019, 2:48 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby tar » January 13th, 2019, 8:20 am

Updating Vassal for new versions isn't easy. Especially since how they work
can vary across machines and operating systems. The developers are all
volunteers, doing this as a service to the hobby.

It would be better if the Java developers, which is a much, much bigger
team, wouldn't make changes that break things.

As for instructions, it is again a case that the developers don't have
computers with your configuration or operating systems. IIRC the main
developers use Linux. And for that system, the instructions make perfect
sense. Perhaps you could switch to Linux on your computer?



On Sun, Jan 13, 2019, 6:38 AM robinreeve
> I am not introduced in the manipulations you are speaking about.
> It seems rather complicated from my non initiated point of view - I
> don't know what a "shell" is fir an example.
> And I believe that many people would be in my case.
>
> Don't you think that the VASSAL developers could design a new version
> compatible with Java 9?
> Or at least give precise instructions about how you can have two Java
> versions installed and choosing the adapted one?
>
> _______________________________________________
> Read this topic online here:
> viewtopic.php?p=56287#p56287
> _______________________________________________
> messages mailing list
> messages@vassalengine.org
> http://www.vassalengine.org/mailman/listinfo/messages
>
User avatar
tar
 
Posts: 769
Joined: January 2nd, 2008, 6:53 pm
Location: Los Angeles area

Re: VASSAL doesn't seem to work with Java 9 version

Postby uckelman » January 14th, 2019, 5:36 pm

I will try to find the time to give a thorough description of the problem sometime in the next few days so that we can discuss possible solutions. Please bear with me, as I'm extremely busy at the moment.
User avatar
uckelman
Site Admin
 
Posts: 8053
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: VASSAL doesn't seem to work with Java 9 version

Postby robinreeve » January 14th, 2019, 5:43 pm

Thanks uckelman.
I am looking forward to evoking other solutions than expecting Oracle to adapt to VASSAL or players to convert to Linux.
robinreeve
 
Posts: 5
Joined: January 2nd, 2019, 2:48 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby johannz » January 15th, 2019, 7:09 pm

tar wrote:Updating Vassal for new versions isn't easy. Especially since how they work
can vary across machines and operating systems. The developers are all
volunteers, doing this as a service to the hobby.

It would be better if the Java developers, which is a much, much bigger
team, wouldn't make changes that break things.

>


The issue is that the Vassal developers have a reference to an internal, unsupported class. There has never been any guarantee that any sun.* classes would not be changed out from under you. They are documented as internal, unsupported.

https://www.oracle.com/technetwork/java ... 42232.html
johannz
 
Posts: 1
Joined: January 15th, 2019, 7:06 pm

Re: VASSAL doesn't seem to work with Java 9 version

Postby uckelman » January 16th, 2019, 9:43 pm

Thus spake johannz:
>
> The issue is that the Vassal developers have a reference to an internal,
> unsupported class. There has never been any guarantee that any sun.*
> classes would not be changed out from under you. They are documented as
> internal, unsupported.

Why did we do that?

Have a look at the code for ImageIOImageLoader:

https://sourceforge.net/p/vassalengine/ ... oader.java

This file is a collection of workarounds for 13 bugs in Java itself,
with explanations of the bugs and workarounds. It's some dispiriting
reading if you know anything about image formats.

You're absolutely correct that we're using some internal, unsupported
classes that aren't guaranteed to be changed out from under us. We were
driven to that because the supported, documented classes are broken. A
few of the bugs were already more than a decade old at the time when I
wrote their workarounds. Several even had patches waiting to be applied
attached to their bug reports.

We would never have done any of this had the image loading classes
distributed with Java been fit for purpose, or if there had been any
prospect of their being fixed promptly.

I'd find being pointed to an Oracle article entitled "Why Developers
Should Not Write Programs That Call 'sun' Packages" a fairer criticism
if Oracle also had an article entitled "Why Oracle Hasn't Fixed Bugs
Which are Old Enough to Drive".

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8053
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: VASSAL doesn't seem to work with Java 9 version

Postby uckelman » January 16th, 2019, 11:47 pm

I've made a pass at answering some questions, as promised:

* Does VASSAL work with Java 9? 10? 11?

Java 9 and Java 11 work for me on Linux after I remove lib/xercesImpl.jar. Apparently as of Java 9, the XML handling classes provided by the Xerces library became part of the JDK, so trying to load them from Xerces causes a name conflict which prevents the VASSAL player (but not the module manager) from starting. I haven't tried Java 10, but my guess is that it will be the same in this regard as 9 and 11.

* Why are you seeing illegal access warnings with Java 9 and later?

There is a bug in one of the classes Java uses for loading JPEG images which prevents reliable loading of of multiple JPEGs simultaneously. (The documentation provided by Oracle gives one no reason to suspect that JPEGImageReader is not only not thread-safe per instance, but also not thread-safe as a class, and having made it that way is so absurd that even were this documented it ought to be considered a design bug.) A bug report for this was filed with Oracle in 2010; as of today, it is still marked "Unresolved". We work around this bug by getting access via reflection to the offending internal class, which is a lazy-loading cache, and turning it off.

The visibility of classes changed in Java 9. A module system was introduced, in which private classes and classes from unexported packages aren't intended to be accessible from outside the module in which they live. With Java 9, access by reflection is still possible, but produces warnings. Sometime after Java 9, access by reflection will be denied by default, but is still permitted by default as of Java 11.

It looks like we can compile with either --add-exports or --add-opens for the particular class we need to get via reflection for the workaround.

(See https://blog.codefx.org/java/java-9-migration-guide/ for details.)

Note that compiling with either of these flags would commit us to compiling VASSAL and custom module code with a Java 9 compiler or later (which is not the same thing as requiring Java 9 or later for running VASSAL).

* Why is our minimum requirement still Java 5?

The last time we considered raising the minimum supported verison of Java, there were a great many users of Macs for which nothing beyond Java 5 was available. We chose to keep Java 5 as the minimum at that point so as not to leave those users behind. As this was several years ago now, it may be the case that none of those machines are still in use and that we could increase our minimum supported version of Java without inconveniencing anyone.

Does anyone still use a machine which can't be upgraded beyond Java 5?
User avatar
uckelman
Site Admin
 
Posts: 8053
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: VASSAL doesn't seem to work with Java 9 version

Postby pacman-ghost » January 17th, 2019, 9:20 am

Thanks for the comprehensive answer.

My main concern was that there is no guidance for users on how to resolve these issues (and they're starting to see them, as their system Java's are being updated) and since many/most of these people are non-technical, they don't have a clue how to resolve them.

Upgrading the dev environment to Java 9+ is a non-trivial change (although it has to be done eventually :-|), but in the short term, can we provide some guidance to non-technical users on how to get things going?

I have a whole bunch of Windows VM's (going back to 3.1 :-)) that I use for testing other things, and I'm happy to e.g. check what combinations of Windows/Java/VASSAL/VASL seem to work, but IIRC, VASSAL doesn't have a test suite, so just checking if it starts up is the most basic of basic tests :-|

But before any work like that can be done, what versions of Java do you want to actually target? Given that 9 and 10 are EOL, people should probably be discouraged from using them. So, for example:
    Java 5-7: deprecated
    Java 8: supported
    Java 9-10: unsupported (might work, might not, you're on your own)
    Java 11: provisionally supported (but if you're using VASSAL 3.2.17, click here for instructions on things you need to do)
with the aim of making Java 8 "deprecated" and Java 11 "supported".
pacman-ghost
 
Posts: 2
Joined: December 12th, 2018, 11:40 am

Next

Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 1 guest