F
F
Fareny2022-01-07 19:48:58
Java
Fareny, 2022-01-07 19:48:58

Module commons.io not found, required by com.example.myapp

Error occurred during initialization of boot layer
java.lang.module.FindException: Module commons.io not found, required by com.example.myapp

Execution failed for task ':HelloApplication.main()'.
> Process 'command 'C:/Users/Alex/.jdks/openjdk-16.0.1/bin/java.exe'' finished with non-zero exit value 1

Everything worked before. Decided to check and now throws an error. It seems to write that commons.io was not found, but when I decided to look, it seems to be there. Or is it not?
61d86e7eaae33547528835.png
Here is the gradle:

plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
}

group 'com.example'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

ext {
junitVersion = '5.7.1'
}

sourceCompatibility = '16'
targetCompatibility = '16'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

application {
mainModule = 'com.example.myapp'
mainClass = 'com.example.myapp.HelloApplication'
}

javafx {
version = '16'
modules = ['javafx.controls', 'javafx.fxml']
}

dependencies {
implementation 'c3p0:c3p0:0.9.1.2'
implementation 'commons-io:commons-io:20030203.000550'
testImplementation("org.junit.jupiter:junit-jupiter-api:$ { junitVersion } ")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$ { junitVersion } ")
runtimeOnly("mysql:mysql-connector-java:8.0.27")

}
test {
useJUnitPlatform()
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2022-01-07
@Fareny

Good evening.
You forgot to write commons-io in module-info.java
requires org.apache.commons.io;
or rather
requires commons-io;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question