The issue / experience
The READ.ME links to the wiki, which says to go to java.com to download java, but that is java 8 which is incompatible with the project which uses java 21 (as far as I can tell). Error message: "org/openstreetmap/osmosis/core/Osmosis has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0"
What worked
- Uninstalled whatever current version of java I had using https://www.java.com/en/download/uninstalltool.jsp
- Installing Java21 JDK from https://www.oracle.com/java/technologies/downloads/#java21
- Modified the osmosis.bat script in notepad:
- Changed
if defined JAVA_HOME goto findJavaFromJavaHome to goto findJavaFromJavaHome
- Changed
set JAVA_HOME=%JAVA_HOME:"=% to set JAVA_HOME=C:/Program Files/Java/jdk-21
- Ran the osmisis.bat script (in PowerShell:
C:\Program Files\osmosis-0.49.2\bin then .\osmosis.bat)
The issue / experience
The READ.ME links to the wiki, which says to go to java.com to download java, but that is java 8 which is incompatible with the project which uses java 21 (as far as I can tell). Error message: "org/openstreetmap/osmosis/core/Osmosis has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0"
What worked
if defined JAVA_HOME goto findJavaFromJavaHometogoto findJavaFromJavaHomeset JAVA_HOME=%JAVA_HOME:"=%toset JAVA_HOME=C:/Program Files/Java/jdk-21C:\Program Files\osmosis-0.49.2\binthen.\osmosis.bat)