Closed Tonne-TM closed 5 years ago
Put the following line:
addExtraDependencies("javafx")
in the jlink
block.
I added it. Now something seems not functioning with tinylog and (still) apache poi.
Cannot derive uses clause from service loader invocation in: org/apache/commons/compress/utils/ServiceLoaderIterator.<init>().
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:430: error: the service implementation does not have a default constructor: ConsoleWriter
provides org.tinylog.writers.Writer with org.tinylog.writers.ConsoleWriter,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:431: error: the service implementation does not have a default constructor: FileWriter
org.tinylog.writers.FileWriter,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:432: error: the service implementation does not have a default constructor: JdbcWriter
org.tinylog.writers.JdbcWriter,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:433: error: the service implementation does not have a default constructor: LogcatWriter
org.tinylog.writers.LogcatWriter,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:434: error: the service implementation does not have a default constructor: RollingFileWriter
org.tinylog.writers.RollingFileWriter,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:435: error: the service implementation does not have a default constructor: SharedFileWriter
org.tinylog.writers.SharedFileWriter;
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:436: error: the service implementation does not have a default constructor: DailyPolicy
provides org.tinylog.policies.Policy with org.tinylog.policies.DailyPolicy,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:437: error: the service implementation does not have a default constructor: SizePolicy
org.tinylog.policies.SizePolicy,
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:438: error: the service implementation does not have a default constructor: StartupPolicy
org.tinylog.policies.StartupPolicy;
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:439: error: the service implementation does not have a default constructor: XBeansXQuery
provides org.apache.xmlbeans.impl.store.QueryDelegate.QueryInterface with org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery;
^
<project>\build\jlinkbase\tmpjars\<package>.merged.module\module-info.java:440: error: the service implementation does not have a default constructor: XBeansXPath
provides org.apache.xmlbeans.impl.store.PathDelegate.SelectPathInterface with org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath;
Put also this in the `jlink block:
mergedModule {
requires 'javafx.graphics';
requires 'java.logging';
requires 'java.sql';
requires 'java.xml';
requires 'java.desktop';
requires 'java.security.jgss';
requires 'javafx.base';
requires 'jdk.unsupported';
requires 'java.xml.crypto';
requires 'java.management';
requires 'java.naming';
requires 'javafx.controls';
requires 'jdk.javadoc';
provides 'java.sql.Driver' with 'org.sqlite.JDBC';
provides 'org.tinylog.provider.LoggingProvider' with 'org.tinylog.core.TinylogLoggingProvider';
}
Thanks its working!
There are still some warnings but they don't seem to cause problems:
<project>\excel-import-modular\build\jlinkbase\tmpjars\org.apache.commons.collections4\module-info.java:2: warning: [module] module name component collections4 should avoid terminal digits
open module org.apache.commons.collections4 {
^
1 warning
<project>\excel-import-modular\build\jlinkbase\tmpjars\commons.math3\module-info.java:2: warning: [module] module name component math3 should avoid terminal digits
open module commons.math3 {
^
1 warning
<project>\excel-import-modular\build\jlinkbase\tmpjars\jdom2\module-info.java:2: warning: [module] module name component jdom2 should avoid terminal digits
open module jdom2 {
^
1 warning
<project>\excel-import-modular\build\jlinkbase\tmpjars\jsr305\module-info.java:2: warning: [module] module name component jsr305 should avoid terminal digits
open module jsr305 {
^
1 warning
Hi, I've got the same issue before. Then I wrote addExtraDependencies function in my jlink. Now it builds but when I'm trying to run my app nothing happens. I tried to run module from console inside app/mods directory and got:
java.lang.LayerInstantiationException: Package images in both module zoomaio.main and module zoomaio.merged.module.
module-info.java:
open module zoomaio.main {
requires java.sql;
requires static lombok;
requires javafx.fxml;
requires javafx.web;
requires org.controlsfx.controls;
requires jdk.jsobject;
requires okhttp3;
requires org.json;
requires org.jsoup;
requires jdk.crypto.ec;
requires webdrivermanager;
requires selenium.api;
requires selenium.chrome.driver;
requires selenium.support;
requires selenium.remote.driver;
requires TrayNotification.a8bfa597eb;
requires java.desktop;
}
build.gradle:
plugins {
id 'application'
id 'java'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'org.beryx.jlink' version '2.17.6'
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
configurations {
broken { extendsFrom implementation }
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
compile group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '3.8.1'
compile (group: 'org.controlsfx', name: 'controlsfx', version: '11.0.1') {
exclude group: 'org.openjfx'
}
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.30.1'
compile group: 'org.json', name: 'json', version: '20190722'
compile group: 'org.jsoup', name: 'jsoup', version: '1.13.1'
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.4.0'
compileOnly 'org.projectlombok:lombok:1.18.10'
compile 'com.github.PlusHaze:TrayNotification:a8bfa597eb'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
}
project.ext.buildDate = new Date()
project.version = "0.1"
javafx {
version = "13"
modules = ["javafx.fxml", "javafx.web"]
}
mainClassName = 'com.itechartgroup.zoomproxy.ZoomProxyApplication'
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
addExtraDependencies("javafx")
launcher {
name = 'Zoom proxies'
forceMerge "selenium"
}
jpackage {
installerType = project.findProperty('installerType')
// we will pass this from the command line (example: -PinstallerType=msi)
imageOptions += ['--icon', 'src/main/resources/images/logo.ico']
installerOptions += [
'--win-per-user-install', '--win-dir-chooser',
'--win-menu', '--win-shortcut'
]
}
}
jpackage {
doFirst {
project.getProperty('installerType') // throws exception if its missing
}
}
Directories containing resources are also handled as packages by the Java Module System. One of your dependencies has a resource directory named images
, which conflicts with your own images
directory.
One way to solve this problem is to rename your images
directory to something else.
Directories containing resources are also handled as packages by the Java Module System. One of your dependencies has a resource directory named
images
, which conflicts with your ownimages
directory.One way to solve this problem is to rename your
images
directory to something else.
Don't know about resources as packages handling. Everything is fine now. Thank you.
Hi, i get the following error when running
gradle jlink
(gradle run
is working fine)Here is my
build.gradle
. (I tried different solutions like definingmergedModule
by hand like in Issue #64 but it could not resolve my problem. New errors popped up)Hier die
module-info.java
:Here are the
suggesrMergedModuleInfo