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

Philippe D.

Elder Member
Joined
Jul 1, 2016
Messages
2,132
Reaction score
1,393
Location
Bordeaux
Country
llFrance
My laptop (running linux) had to be updated (to Ubuntu 18.04 version). The systems guys at my job do this by restarting from a clean slate, so I had backed up all my data, including VASL. But for some reason, VASSAL doesn't start anymore.

When I try to launch the engine (VASSAL.sh, 3.2.17 version), it complains:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by VASSAL.tools.image.ImageIOImageLoader (file:XXXXX/ASL/VASL/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

This is just warnings, the VASSAL window still opens, but my VASL modules doesn't show up anymore, and when I try to import it (got version 6.4.3, freshly downloaded), it cannot import it.

I'm supposed to have an exact copy of the file setup that was working previously... but I suppose I did something wrong. Something stupid, preferably.

Any idea?
 

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 don't know, but my first guess would be this looks you have a different version of Java from before. If you've updated to a new version of Ubuntu, you've almost certainly got a new version.

18.04 is an LTS release, so I'm guessing you've upgraded from 16.04, which is 2 years prior to 18.04, so it's almost guaranteed the Java is different.
 

Philippe D.

Elder Member
Joined
Jul 1, 2016
Messages
2,132
Reaction score
1,393
Location
Bordeaux
Country
llFrance
But shouldn't a newer release of VASSAL be compatible with a newer Java? or is there some configuration file that is generated when VASSAL is run, that would create problems? (the engine starts, but it fails to find the VASL module - and refuses to import it when I point to it)
 

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
I think this is a java version issue. I put up a post a while ago--I can't find it anymore--where my java had upgraded to 9 (I think) and vasl failed. As I recall vasl does not like newer versions of java. You can run "java -version" at the command prompt to see what version you are running. In ubuntu you can run "update-alternatives --config java" (either as root or with sudo) to see available java versions and to switch back to an older version. I think java 8 is the latest you can use. Installing earlier versions of the jre can be done using standard programs. I personally use synaptic, but there are other ways.

JR
 
Last edited:

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
But shouldn't a newer release of VASSAL be compatible with a newer Java? or is there some configuration file that is generated when VASSAL is run, that would create problems? (the engine starts, but it fails to find the VASL module - and refuses to import it when I point to it)
vasl/vassal has not upgraded its java version in a long, long time. Based on the error message I think vasl/vassal is running into something that has been shut down as a security fix. But that's just a guess.

JR
 

von Marwitz

Forum Guru
Joined
Nov 25, 2010
Messages
14,357
Reaction score
10,205
Location
Kraut Corner
Country
llUkraine
Found my original post: http://www.gamesquad.com/forums/index.php?threads/vassal-not-compatible-with-java-v9.146910/. The error is the same I think. The fix is to downgrade your java as I said. This has cropped up on my machine again when java upgraded to version 11, and then again to a later version of 11.

JR
Probably, I'll be setting up a new LT soon. This information will have likely saved me quite some time to figure out why I would have run into trouble with VASSAL.

von Marwitz
 

Philippe D.

Elder Member
Joined
Jul 1, 2016
Messages
2,132
Reaction score
1,393
Location
Bordeaux
Country
llFrance
OK, so using JRV's advice I managed to downgrade to Java 8, but now I get a new error "Failed to load module canberra-gtk-module", and I still cannot import the VASL module into VASSAL ("invalid import file").
 

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
OK, so using JRV's advice I managed to downgrade to Java 8, but now I get a new error "Failed to load module canberra-gtk-module", and I still cannot import the VASL module into VASSAL ("invalid import file").
You don't "import;" you "open."

The libcanberra-gtk-module is not vasl/vassal but a system code library. You can install it using synaptic or apt or similar.

JR
 
Last edited:

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
OK, so using JRV's advice I managed to downgrade to Java 8
If you've updated the system installation of Java, that might cause problems with other things on your computer that are expecting the newer version, and given that it's a work laptop, I rather suspect they might take a dim view of you breaking things so that you can play a game, even if it is ASL :). If this is the case, you might want to revert it back to the original version, maybe have a chat with a friendly sysadmin to make sure everything's back to the way it was.

It's relatively straight-forward to run a stand-alone version of Java, that won't interfere with anything else. This is completely untested, but you should only need something like this:

(*) Download and unpack somewhere the version of Java you want e.g. maybe here:
https://jdk.java.net/archive
Finding the right file is always the hardest part of this exercise :-/

(*) Edit VASSAL.sh to run this Java instead of the system one. At the end of the file, change:
Code:
java -Duser.dir="$INSTALL_DIR" ...etc...
to be
Code:
/home/philippe/bin/openjdk8/bin/java -Duser.dir="$INSTALL_DIR" ...etc...
Update the path to the java binary as appropriate.

You will almost certainly need to also add the following before that line:
Code:
export JAVA_HOME=/home/phillipe/bin/openjdk8
so that everything knows which Java is being used.

You might be able to run 2 system versions side-by-side e.g. maybe
Code:
sudo apt-get install openjdk-8-jre
but since the whole point of this exercise is to have a separate installation of Java that won't interfere with the system installation, I prefer the manual method above.
 

Philippe D.

Elder Member
Joined
Jul 1, 2016
Messages
2,132
Reaction score
1,393
Location
Bordeaux
Country
llFrance
OK, well "open"ing the VASL file worked, thanks guys!

It's a work laptop but I don't use Java for anything, so I'll see if anything else breaks before going any further.
 

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
Installing multiple versions of java on ubuntu is trivial. Running them sequentially is also trivial: use update-alternatives to change the current version.

Running multiple versions side-by-side simultaneously is probably a bit more tricky. java installs itself as /usr/bin/java. update-alternatives makes this a link to the currently selected version of java. You can run a specific version of java by finding it in the directory structure and explicitly calling that executable, but then if the program you are running calls java itself, the recursively-called version will end up finding java on the path, which (per our assumption) will be the wrong one. In fact vassal recursively starts java when it starts up a module.

What you would probably have to do to is set up a directory to replace /usr/bin, say ~/bin/java-8. Everything but java (and whatever else update-alternatives changes) would be a link to /usr/bin. java and its friends would be linked to the right version. The PATH would be changed to replace /usr/bin with ~/bin/java-8. You then run java normally with that PATH in effect, and it ought to work. Note I have not tried this. I will guess that the different versions of the java runtime won't interfere with each other, but I don't know enough about java to be 100% certain on that.

The JAVA_HOME environment variable isn't used on ubuntu, as best I can determine. I believe that setting it will not help when running a different version of java on ubuntu because it isn't used to create the path, and because java installs itself in the "normal" path, i.e. under /usr/bin. I think one could add it to the environment and the path instead of building the alternate /usr/bin as I said above.

There are very, very few programs that use java nowadays. In most cases I would expect that running different versions of java sequentially would be enough. In Philippe's case it seems that he can just switch to the java 8 & forget about it until an update installs a later version of java and overwrites his choice. The fact that he is installing vasl on his laptop indicates that he is not overly concerned about making changes on his machine.

JR
 

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
Now that I have thought about it, probably the best way to run a second version of java would be to add the versioned java directory to the front of the PATH and export it. It makes me nervous to have two different versions of java on the PATH, but it should work despite my distrust.

JR
 

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
Is this an Ubuntu problem only ?
I am on Windows, and the last Java update (december 29) is version 8.
Should I be wary if an upgrade to version 9 were to occurr ?
 

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 am on Windows, and the last Java update (december 29) is version 8.
The latest version of Java is 11: https://en.wikipedia.org/wiki/Java_version_history
I suspect the little Java updater thing that runs on Windows is only telling you about updates within the version you already have i.e. 8.

Should I be wary if an upgrade to version 9 were to occurr ?
Yep. If it doesn't work on Ubuntu, it's not going to work anywhere. Java is write once, break anywhere :)
 
Last edited:

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
Thank you.
So this problem is bound to affect quite a lot of people.
Are the VASSAL developers aware of that issue ?
 

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
Java 9 was released in September 2017, so one would assume so. I don't know the details of the exact problem, but I suspect this is going to be messy to fix :-/
I posted the question on the Vassal forum.
My computer updated Java recently (December 29) and it still states that ot is the 8 version.
 

jrv

Forum Guru
Joined
May 25, 2005
Messages
21,998
Reaction score
6,206
Location
Teutoburger Wald
Country
llIceland
Haven't tried it, but it seems you can specify which version of java you want to use:

How can I run different versions of Java on the same computer?

I'm on a fresh install of Bodhi Linux 5.0, Open JDK 10.0.2, and I'm getting the same error message as the OP.
That uses a program/script named "java_home". I can find no evidence that such a program exists on either debian or ubuntu in the official distros (perhaps the package is named something different). From looking at the post it looks as if the program might be a script developed at the organization. It's hard to tell.

If you need to run several java applications at the same time all using different versions of java such a program/script would be very useful. If the only java program you are only running is vassal, switching the entire machine to version 8 using "sudo update-alternatives --config java" makes the most sense to me.

JR
 
Top