Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash differs java.xml/java.base error #111

Closed
graugraugrau opened this issue Feb 13, 2020 · 3 comments
Closed

Hash differs java.xml/java.base error #111

graugraugrau opened this issue Feb 13, 2020 · 3 comments

Comments

@graugraugrau
Copy link

I'm quite new to this plugin, so maybe I'm doing something wrong.

I use this plugin on a javafx application written in kotlin. The build.gradle looks like:

plugins {
    id 'application'
    id 'org.jetbrains.kotlin.jvm' version '1.3.41'
    id "org.openjfx.javafxplugin" version "0.0.8"
    id 'org.beryx.jlink' version '2.17.1'
}

apply plugin: 'java'

sourceCompatibility = 11
targetCompatibility = 11

...

javafx {
    modules("javafx.controls", "javafx.fxml", "javafx.swing", "javafx.web")

    version = "12.0.2"
}

compileKotlin {
    kotlinOptions.jvmTarget = "11"
}

...

jlink {
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    addExtraDependencies("javafx")

    launcher{
        name = 'masster'
    }

    forceMerge('log4j-api')

    mergedModule {
        requires 'java.management';
        requires 'java.naming';
        requires 'java.logging';
        requires 'java.sql';
        requires 'java.xml';
        requires 'java.desktop';
        requires 'java.datatransfer';
        requires 'java.compiler';
        requires 'java.security.jgss';
        requires 'jdk.unsupported';
        uses 'java.nio.file.spi.FileSystemProvider';
        provides 'javax.xml.stream.XMLEventFactory' with 'com.ctc.wstx.stax.WstxEventFactory';
        provides 'javax.xml.stream.XMLOutputFactory' with 'com.ctc.wstx.stax.WstxOutputFactory';
        provides 'com.fasterxml.jackson.core.ObjectCodec' with 'com.fasterxml.jackson.databind.ObjectMapper';
        provides 'javax.xml.stream.XMLInputFactory' with 'com.ctc.wstx.stax.WstxInputFactory';
    }
}

if I execute jlink I get the following error:

Error: Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base

Execution failed for task ':jlink'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/jlink'' finished with non-zero exit value 1

My module-info.java (only java class) looks like:

module masster.main {
    requires kotlin.stdlib;
    requires kotlin.stdlib.jdk7;
    requires kotlin.stdlib.jdk8;
    requires javafx.web;
    requires javafx.graphics;
    requires javafx.base;
    requires javafx.media;
    requires gson;
    requires java.sql;
    requires java.logging;
    requires com.fasterxml.jackson.databind;
    requires annotations;
    requires net.harawata.appdirs;
    requires java.desktop;
    requires org.apache.pdfbox;
}
@siordache
Copy link
Member

This is most likely not your fault. It seems to be an openjdk issue affecting some specific builds. See for example:

As a workaround, try using another JDK build.

@HUGIN-NSJ
Copy link

HUGIN-NSJ commented Mar 2, 2020

I have experienced that a wrong path in 'targetPlatform' arguments could generate this error. See if you have any typos in jmods paths or similar if you encounter this error.

@siordache
Copy link
Member

Closing, since it's not a bug of this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants