Patreon Logo Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal Logo PayPal. You can also buy games using our partner links for GOG and Humble Store.
Title: How to get a 32bit JVM running on a 64bit Linux OS via Steam Client?
noblemaster 21 Apr 2016
Hi guys! I was told to post here where all the Linux experts hang out :)

In any case here is the problem: I have released my game on Steam. Steam provides 32bit .so libraries to connect to the Steam API. The game is written in Java. In order to use the 32bit .so library (I don't think there is a 64 bit one?), I need to run the game via a 32bit JVM. So far so good.

As it turns out, the 32bit JVM surprisingly runs on the 64bit Steam OS (Intel Brix). However, the same application does not run via "regular" Steam (not the Steam OS), if the Linux operating system is 64bit and throws the following error:

java.lang.ClassNotFoundException: com.ageofconquest.app.user.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:59)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)


What needs to be done to get the 32bit JVM to work on a regular 64bit Linux installation? What does the Steam OS do different that it works there? Are there some additional libraries that are installed for compatibility?
Daverball 21 Apr 2016
There's definitely 64bit versions of the Steam API too, so a 64bit JVM should definitely work as well I don't think your error is related to whether you run the game on a 32bit or 64bit JVM though, seems more like there might be some files missing on your game's install.
abelthorne 21 Apr 2016
Same JVM on both systems or different ones (i.e. OpenJDK vs Sun Java, or OpenJDK 7 vs OpenJDK 8)?

SteamOS is based on Debian, is the regular Steam you've tried on a Debian too (if possible same version than the SteamOS basis) or a different distro?
Cheogh 21 Apr 2016
I was having some problems getting Minecraft and Project Zomboid running awhile ago after a fresh install of Archlinux. I needed to install xorg-xrandr. No clue if this is the problem you are having.
wojtek88 21 Apr 2016
Let me start with this sentence - Never wrote a piece of code that communicates to Steam API.
But I will try to provide you some ideas.
Steam OS may come with different classpath set (through environment variable for example) or you're just comparing 2 setups with different classpaths (one of them may have classpath set, other don't).

In general - ClassNotFoundException = you do not have on a classpath a jar that contains class that you want access.
And according to stack trace it looks like Steam code cannot find your class, not the other way around (OK, maybe not Steam code, but the code that tries to install the game).

I would say one should be true - either classpath issue or like @abelthorne suggested - you're using different JVMs (maybe they have different Classloader behaviour?).
noblemaster 22 Apr 2016
Thanks for the reply guys!

xorg-xrandr: that might do the trick! I forwarded the information. :-D

The game is using Oracle Java 32bit. I find it odd too to get a "ClassNotFoundException". I'd assume there to be another error if the binaries are not able to run on 64bit? However, that same 32bit Oracle JVM works on 64bit Steam OS, just not anywhere else. Doesn't work via regular Steam client, just the Steam OS.

Also, I got 64bit binaries (not for Steam) which work fine! Unfortunately, in order to integrate with Steam, I need to use the 32bit JVM. Somehow I think this should work with the right compatibility libraries installed! Maybe xorg-xrandr might do the trick?

EDIT: re-classpath: the JVM is bundled & the classpath is fixed (relative to the working directory). I cannot see what would change by running it on 64bit Linux? I think the error might not be correct, but then I might be wrong?
abelthorne 22 Apr 2016
It would be pretty surprising that xorg-xrandr (or whatever similar package) is related, as Xrandr is only a tool to get/set the screen information, like resolution and such.

What do you mean by "that same 32bit Oracle JVM works on 64bit Steam OS, just not anywhere else"? How have you tested it on both OS?
noblemaster 22 Apr 2016
I have tested it personally on 64bit Steam OS & it works. I don't have any other Linux installations.

I was given the stacktrace that is produced on the clients Linux computer while running the game via Steam. It's possible the 32bit JVM is working for other people on Linux 64bit via Steam. Sorry, I don't have that information.
wojtek88 22 Apr 2016
If there is a way to provide me temporary key (is Steam able to do such a thing? I know that there is a "Free weekend" concept, but I don't know if temporary key is possible at all) I should be able to do some tests for you during the weekend in some free time on my setup.
noblemaster 23 Apr 2016
The game is free, but I can send you some additional promo codes! Download it from here:
http://store.steampowered.com/app/314970

Then email me at contact at ageofconquest.com and mention this thread! - Thanks for testing :-D
abelthorne 23 Apr 2016
Quoting: noblemasterI have tested it personally on 64bit Steam OS & it works. I don't have any other Linux installations.

I was given the stacktrace that is produced on the clients Linux computer while running the game via Steam. It's possible the 32bit JVM is working for other people on Linux 64bit via Steam. Sorry, I don't have that information.
So, it's SteamOS on your machine and a Linux distro with the Steam client on your customer's side, is that it?

In that case, you should ask him/her a few details about the system, like the JVM used (update-alternatives --config java will list the JVM installed and allow to choose one if there's multiple choices − it has to be run as superuser, i.e. through sudo on distros that have it), the distro and version used.

Also, is your customer running Steam through a terminal to get the output given in your first post or simply the game without Steam (the behaviour would not be the same due to the Steam runtime)?

On your side, you can try to boot a different distro as live version, like Ubuntu, if your game is not too graphic intensive (as you won't be able to install eventual proprietary GPU drivers). You'll have to install Steam and maybe Java on it but it's in RAM, you don't install anything on your HD and don't mess with your current setup. That might allow you to check if you can reproduce the issue outside of SteamOS.
wojtek88 24 Apr 2016
Hi @noblemaster, I gave a try your game. Below is my system information:
Spoiler, click me

Computer Information:
Manufacturer: Unknown
Model: Unknown
No Touch Input Detected

Processor Information:
CPU Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x2a
CPU Stepping: 0x7
CPU Type: 0x0
Speed: 2900 Mhz
4 logical processors
2 physical processors
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Unsupported
SSE41: Supported
SSE42: Supported
AES: Unsupported
AVX: Supported
CMPXCHG16B: Supported
LAHF/SAHF: Supported
PrefetchW: Unsupported

Network Information:
Network Speed:

Operating System Version:
Ubuntu 15.04 (64 bit)
Kernel Name: Linux
Kernel Version: 3.19.0-25-generic
X Server Vendor: The X.Org Foundation
X Server Release: 11701000
X Window Manager: Compiz
Steam Runtime Version: steam-runtime-release_2016-02-23

Video Card:
Driver: NVIDIA Corporation GeForce GT 540M/PCIe/SSE2

Driver Version: 4.5.0 NVIDIA 361.18
OpenGL Version: 4.5
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 60 Hz
VendorID: 0x10de
DeviceID: 0xdf4
Number of Monitors: 1
Number of Logical Video Cards: 2
Primary Display Resolution: 1600 x 900
Desktop Resolution: 1600 x 900
Primary Display Size: 15,04" x 8,43" (17,20" diag)
38,2cm x 21,4cm (43,7cm diag)
Primary Bus: PCI Express 16x
Primary VRAM: 1024 MB
Supported MSAA Modes: 2x 4x 8x 16x

Sound card:
Audio device: Intel CougarPoint HDMI

Memory:
RAM: 9910 Mb

Miscellaneous:
UI Language: English
LANG: pl_PL.UTF-8
Microphone: Not set
Total Hard Disk Space Available: 100662 Mb
Largest Free Hard Disk Block: 4909 Mb
VR Headset: None detected
As you can see it is a 64bit Linux system (Ubuntu 15.04). Your game runs very well on my setup (the only annoying thing is that it does not remember fullscreen setting, so it always runs in windowed mode).
According to what you wrote, you call 32bit API, and for me it works. So it does not look like the issue you're trying to fix is connected to fact that on 64bit system you call 32bit Steam API.
If you need any log of your game or any additional testing just drop me a line.
noblemaster 26 Apr 2016
Thanks for testing! You can make the game startup in fullscreen mode via [Settings]. Enable the "Fullscreen-Mode at Startup" option. I hope that works.

So, it's SteamOS on your machine and a Linux distro with the Steam client on your customer's side, is that it?
Yes.

Also, the game comes bundled with the JVM. I cannot provide different apps with different JVMs for different Linux distributions in Steam. Not as far as I can tell? The goal is to fix the error, whatever the cause. The question is what is causing it?

On your side, you can try to boot a different distro as live version, like Ubuntu, if your game is not too graphic intensive (as you won't be able to install eventual proprietary GPU drivers). You'll have to install Steam and maybe Java on it but it's in RAM, you don't install anything on your HD and don't mess with your current setup. That might allow you to check if you can reproduce the issue outside of SteamOS.
I tried VM before but it's difficult to always make it work. Not sure, but sometimes it just doesn't run due to some graphic card problems. It's an on/off. Also, it doesn't emulate the customer's machine if I cannot reproduce the error. In the end I still don't know what the problem is.
noblemaster 26 Apr 2016
Just got it in: the machine is running Ubuntu 16.04 64bit, Nvidia 980ti. That's where it doesn't work. Given it worked in Ubuntu 15.04 for wojtek88, the question is, what's the difference? Did you install any compatibility libraries or such? Did Ubuntu change that much?
wojtek88 26 Apr 2016
Hmmm, I will try to install Ubuntu 16.04 this week and will let you know. AFAIK a lot of software has some compatibility issues with Ubuntu 16.04, so It is possible that the problem lies here.
Quoting: noblemasterDid you install any compatibility libraries or such?
I don't recall such a thing. I will get back to you when I have 16.04 (I will do fresh install on other disk, for now I don't want to update) ;)
noblemaster 27 Apr 2016
I got a new binary with an updated JVM launcher. Unfortunately, it seems the customer has decided to change to Mint leaving me without options to test it :-/

Here is the new binary for anyone running 16.04:
http://www.noblemaster.com/private/develop/conquest_linux32_4.0.88.tar.gz

I think this should work, but it's difficult to confirm now?
noblemaster 27 Apr 2016
Seems like the issue is with Steam:
http://steamcommunity.com/app/314970/discussions/0/357284767231073811/
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon Logo Patreon. Plain Donations: PayPal Logo PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register