Probably a stupid prerequisite problem (VASSAL won't start)

dlazov

Elder Member
Joined
Mar 22, 2004
Messages
7,991
Reaction score
1,377
Location
Toledo, Ohio
First name
Don
Country
llUnited States
It shouldn't make a difference whether you run JAVA 10.0.2 and VASSAL 3.2.17 with VASL 6.4.3 on a VM or on a regular installation, correct?

Can anyone else confirm, that this combo functions?

von Marwitz
IMO, no it should not. (VM or real machine).
 

dlazov

Elder Member
Joined
Mar 22, 2004
Messages
7,991
Reaction score
1,377
Location
Toledo, Ohio
First name
Don
Country
llUnited States
I just installed java 10.0.2 sometime last year and have not got around to updating it.
 

Robin Reeve

The Swiss Moron
Staff member
Moderator
Joined
Jul 26, 2003
Messages
19,593
Reaction score
5,557
Location
St-Légier
First name
Robin
Country
llSwitzerland
Here is an extensive post that was given to my question on the vassalengine site.
I don't grasp all the notions explained, but I believe that some here will.

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?
 

Robin Reeve

The Swiss Moron
Staff member
Moderator
Joined
Jul 26, 2003
Messages
19,593
Reaction score
5,557
Location
St-Légier
First name
Robin
Country
llSwitzerland
What can be done on Windows or Mac ?
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
BTW, a translation of uckelman's reply:

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

Java changed a few things in version 9, which broke programs written for Java 8. Deleting the xercesImpl.jar file gets things going again.

BTW, it's unlikely that this is the only issue. The warning messages that Philippe reported at the start of this thread were just warnings i.e. the reflection operations they were complaining about were being allowed to work properly, Java was just telling you that will not be the case in the future, which means that the problems he was seeing were being caused by something else :-/

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

There were bugs in Java itself, they added some hacks to get around them, which unfortunately required them to do some things you're not really supposed to do, and it's come back to bite them in the ass. Not really their fault, sometimes you have to do these things :-/

>>> Why is our minimum requirement still Java 5?

This sounds like it's on Apple. I do mostly Python these days, and Apple ships an ancient version of Python by default, so it's entirely believable they do/did the same thing with Java.
 

dlazov

Elder Member
Joined
Mar 22, 2004
Messages
7,991
Reaction score
1,377
Location
Toledo, Ohio
First name
Don
Country
llUnited States
I am running Windows 10 with Java 10 and no issues with vassal and vasl.
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
I cannot seem to find a xercesImpl.jar file on my HD.
It should be in the lib/ sub-directory of wherever you installed VASSAL. There should be a file called Vengine.jar in the same directory (if that's missing, VASSAL won't run at all).

I checked the release files going back to 3.2.15 and this file is there, so if you can't find it on your PC, that suggests that your installation has maybe somehow got messed up. If you're seeing problems, maybe reinstall VASSAL...?
 

von Marwitz

Forum Guru
Joined
Nov 25, 2010
Messages
14,357
Reaction score
10,205
Location
Kraut Corner
Country
llUkraine
Here is an extensive post that was given to my question on the vassalengine site.
I don't grasp all the notions explained, but I believe that some here will.

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?
Maybe this post will one day save my (VASL-) life.

von Marwitz
 

dlazov

Elder Member
Joined
Mar 22, 2004
Messages
7,991
Reaction score
1,377
Location
Toledo, Ohio
First name
Don
Country
llUnited States
For me I am running Windows 10 on a VM, I just installed (last year) java 10 and then VASSAL/VASL no issues. No deleting files or anything.
 

Robin Reeve

The Swiss Moron
Staff member
Moderator
Joined
Jul 26, 2003
Messages
19,593
Reaction score
5,557
Location
St-Légier
First name
Robin
Country
llSwitzerland
For me I am running Windows 10 on a VM, I just installed (last year) java 10 and then VASSAL/VASL no issues. No deleting files or anything.
This could mean that the problems evoked are not caused by the update of Java to a version higher than 8...
 

zgrose

Elder Member
Joined
Jun 13, 2004
Messages
4,235
Reaction score
948
Location
Kingwood, TX
First name
Zoltan
Country
llUnited States
This could mean that the problems evoked are not caused by the update of Java to a version higher than 8...
I'd like to see his VASSAL log file entries before jumping to conclusions.

Either way though, the remedies are identified.
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
This could mean that the problems evoked are not caused by the update of Java to a version higher than 8...
uckelman said here that he found other issues.

Changing versions like this always has problems, and there may well be multiple things at play i.e upgrading Java and something wonky on his machine :)
 

zgrose

Elder Member
Joined
Jun 13, 2004
Messages
4,235
Reaction score
948
Location
Kingwood, TX
First name
Zoltan
Country
llUnited States
uckelman said here that he found other issues.

Changing versions like this always has problems, and there may well be multiple things at play i.e upgrading Java and something wonky on his machine :)
Could be, I downloaded the source and other than the numerous Deprecated warnings it seemed to run ok (ok = with the WARNING about the illegal reflection access).
 

dlazov

Elder Member
Joined
Mar 22, 2004
Messages
7,991
Reaction score
1,377
Location
Toledo, Ohio
First name
Don
Country
llUnited States
Here is a log file. Again running Windows 10 with what I thought was Java 10 (from the command line it shows: .

1547926265626.png

But my VASSAL log shows this:
 

Attachments

zgrose

Elder Member
Joined
Jun 13, 2004
Messages
4,235
Reaction score
948
Location
Kingwood, TX
First name
Zoltan
Country
llUnited States
Right. That's pretty much what I expected. Since Java after 9 (?) don't install a JRE separately, everything like VASSAL is going to find your Java 8 JRE and use it. If you want to run VASSAL under Java10 use this on the command line (fix the java10 jdk path, of course):

cd c:\your\vassal\folder
set path=.;c:\jdk-11.0.1\bin
java -classpath lib\vengine.jar VASSAL.launch.ModuleManager

You should then see VASSAL running in Java10.
 
Top