• Getting a Ktor web application running on VMS

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sun Oct 27 12:45:02 2024
    (Ktor is a relative new Kotlin web framework)

    Ktor (at least all recent versions) require Java 11 and VMS is still
    on Java 8 (Itanium and x86-64, Java 17 for VMS x86-64 is expected
    later this fall).

    But Ktor can be made run on Java 8 and on VMS. This is the
    recipe to do that.

    It is not that difficult. Kotlin works with Java 8 and all
    the libraries except logback works with Java 8. So it is only
    a matter of fixing logback.

    The model is build on PC and transfer to VMS (default Ktor
    build tool is Gradle and I don't think that will run on VMS).

    Latest and greatest Ktor 3.0.0.

    Steps:

    1) build with Java 8 instead of the 11/17/21 you most
    likely have as default - one way is to edit
    gradle.properties and add a
    org.gradle.java.home=/path/to/java/8 before
    build
    2) unzip the fatjar whatever-all.jar in a scratch
    directory
    3) unzip class files only from logback-core-1.3.14.jar
    and logback-classic-1.3.14.jar in scratch directory
    4) zip scratch directory to new jar file (important to
    use ZIP not JAR as we need the old manifest)

    Then the new jar file can be moved to VMS and run.

    Note that I have only tested with basic routing and thymeleaf
    plugins - some other plugins may also require Java 11.

    Example of step 2-4:

    unzip ..\demo-all.jar
    unzip -o \JavaLibs\logback\logback-core-1.3.14.jar *.class
    unzip -o \JavaLibs\logback\logback-classic-1.3.14.jar *.class
    zip ..\hack.jar -r *

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)