How I made Solar2d works on Linux

Hi
I have successfully install and run the current version of Solar2D on Debian 13 with Wine. Build works for the HTML5 and Windows targets. I haven’t tried the others.
Two tricks I had to do to achieve this:

  • Set the emulated version in winecfg to Windows 10
  • Replace wine robocopy stub with the real version from Windows, as the build scripts rely on it

2 Likes

I use Zorin OS and managed to get Wine working, but I stopped using it due to the following issues:

The simulator displays distorted elements depending on the graphics settings used (such as icons).

I tried generating an Android APK, but since Solar2D is running within a Wine layer, it cannot access the host machine’s Java to create the build.

Of course, wine can’t run Linux host applications. As far as I see, the JRE has been included in Solar2D distribution, and there’s no need to install anything else to make Android build. I’ll try to figure this out today.

I don’t think the JRE is there, because whenever I run Solar2D via Wine, it throws an error specifically when trying to locate Java and failing to find it during the build process.

There’s no point in guessing, just check if there’s a jre folder in Solar2D location.

If error “Could not find the Java Development Kit (JDK)…” appears, then you need to look into it. The JAVA_HOME variable may be set, or another JDK may be accessible through PATH.

Solar2D searches for the location of the Java through the function JavaHost::GetJdkPath and then looks for the jarsigner file there.

The Android build was successful. But one java option required to be passed: _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true. Without it, the build fail with the error:

18:52:33.746 Exception in thread “main” java.lang.Error: IP Helper Library GetAdaptersAddresses function failed with error == 13
18:52:33.746 at java.base/java.net.NetworkInterface.getAll(Native Method)
18:52:33.746 at java.base/java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:353)
18:52:33.746 at java.base/sun.security.provider.SeedGenerator.addNetworkAdapterInfo(SeedGenerator.java:230)

1 Like