Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Multi-Release Jar problems(Multi-Release Jar fail in Eclipse but works fine in Maven)
Multi-Release Jar problems [message #1871907] Tue, 15 October 2024 18:21 Go to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 149
Registered: October 2018
Senior Member
I am using:
- Eclipse 2024-09 (4.33)
- OpenJDK version 23
- Maven 3.9.9

I have dependency io.vavr:vavr:0.10.5 that is Multi-Release Jar.

When I try to use it in module-info.java (requires io.vavr;) I get "io.vavr cannot be resolved to a module"
index.php/fa/45309/0/

However, using Maven, I can compile the code and also run it successfully.
index.php/fa/45312/0/

The code:

/VavrSample/src/main/java/module-info.java

module vavrSample {

	exports main;

	requires io.vavr;

	requires org.slf4j;

}


/VavrSample/src/main/java/main/Main.java

package main;

import java.net.URI;
import java.net.URL;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.vavr.control.Try;


public class Main {

	public static void main(final String[] args) {
		new Main();
	}

	public Main() {

		final Logger logger = LoggerFactory.getLogger(Main.class);

		final URL url = Try.of(() -> URI.create("https://example.com/landing-page?ref=email").toURL()).get();

		logger.info(url.getQuery());

	}

}


/VavrSample/pom.xml


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>VavrSample</groupId>
	<artifactId>VavrSample</artifactId>
	<version>0.0.1</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>${java.specification.version}</maven.compiler.source>
		<maven.compiler.target>${java.specification.version}</maven.compiler.target>
	</properties>

	<dependencies>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.5.11</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>2.0.16</version>
		</dependency>

		<dependency>
			<groupId>io.vavr</groupId>
			<artifactId>vavr</artifactId>
			<version>0.10.5</version>
		</dependency>

	</dependencies>

</project>



Can someone else test it please.
Thanks in advance.


[Updated on: Tue, 15 October 2024 20:05]

Report message to a moderator

Re: Multi-Release Jar problems [message #1871916 is a reply to message #1871907] Wed, 16 October 2024 06:19 Go to previous message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 149
Registered: October 2018
Senior Member
I try using IntelliJ IDEA Community Edition.

io.vavr:vavr:0.10.5 jar is parsed with no problem.

Seems like Eclipse issue

index.php/fa/45318/0/
Previous Topic:ClassFormatException in Java11 while compiling JSP pages
Next Topic:Target is not a JDK root. System library was not found.
Goto Forum:
  


Current Time: Mon Jan 13 20:28:01 GMT 2025

Powered by FUDForum. Page generated in 0.03600 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top