Installation

From Kolmafia
Revision as of 17:12, 28 December 2021 by Mcroft (talk | contribs) (Total rewrite for Java 11+ codebase)
Jump to navigation Jump to search

The latest source build can be downloaded from builds.kolmafia.us or the GitHub releases page.

The GitHub releases page contains both the KoLmafia-xxxxx.jar java binaries and installers for an experimental version that includes a bundled version of Java. If you use the installers, they manage the Java dependency listed below, but it can be more difficult to troubleshoot issues.

Dependencies

Java 11 or better (Java 17 recommended)

KoLmafia depends on finding Java 11 or better. The recommended version is linked at the top of every page of kolmafia.us.

If you do not have a recent version of Java, the recommended version (as of this writing) is Java 17.

Testing your Java installation

From a Command Prompt (or Terminal) window, enter java -version

If that returns something like this, you should be good to go.

Michaels-MBP:~ mcroft$ java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment Zulu16.30+15-CA (build 16.0.1+9)
OpenJDK 64-Bit Server VM Zulu16.30+15-CA (build 16.0.1+9, mixed mode, sharing)

Troubleshooting Java

Please be aware that some older versions of Java do not get completely replaced when installing a newer version. Usually this happens with Java 8 JRE and Java 11+ JDKs. If that makes no sense, just delete Java 8.

If you get a message like this:Error: A JNI error has occurred, please check your installation and try again. Please read this announcement.

HiDPI Support

The default builds target Java and use Java Swing to provide its user interface. This means that Java Swing support for HiDPI on Linux is not present. Java 9's Swing includes support for HiDPI. Thus to have HiDPI support one needs to compile it targeting Java 9. To do so, checkout the source from the sourceforge repository using subversion. Ensure that you have some version of JDK 9 installed and configured on your computer as the default java compiler, and also an up-to-date version of Apache Ant. Change the line in 'build.properties' from 'target="1.6"' to 'target="1.9"'. This compiles the source into a version that has support for HiDPI; the built jar will be located at the 'dist' folder. Finally, execute the '.jar' file with an option set as follows: 'java -Dsun.java2d.uiScale=<multiplier> -jar <jarfile>'; e.g. in my case, '<multiplier>' should be '2'.