我有一个简单的hello world Java应用程序,我手动下载了org.json并将其添加到我的类路径中,以便下面的应用程序运行。我该如何制作一个包含该jar文件的自定义JRE来运行此应用程序?
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Go {
public static void main(String[] args) {
SpringApplication.run(MessagingStompWebsocketApplication.class, args);
System.out.println("running");
}
}
不确定如何解决jdeps
返回未找到的问题
jdeps --add-modules java.base,java.logging --generate-module-info work in/spring-jcl-5.2.3.RELEASE.jar
Missing dependence: work/spring.jcl/module-info.java not generated
Error: missing dependencies
spring.jcl
org.apache.commons.logging.LogAdapter$Log4jLog -> org.apache.logging.log4j.Level not found
org.apache.commons.logging.LogAdapter$Log4jLog -> org.apache.logging.log4j.LogManager not found
org.apache.commons.logging.LogAdapter$Log4jLog -> org.apache.logging.log4j.Marker not found
org.apache.commons.logging.LogAdapter$Log4jLog -> org.apache.logging.log4j.spi.ExtendedLogger not found
org.apache.commons.logging.LogAdapter$Log4jLog -> org.apache.logging.log4j.spi.LoggerContext not found
org.apache.commons.logging.LogAdapter$Slf4jAdapter -> org.slf4j.Logger not found
org.apache.commons.logging.LogAdapter$Slf4jAdapter -> org.slf4j.LoggerFactory not found
org.apache.commons.logging.LogAdapter$Slf4jAdapter -> org.slf4j.spi.LocationAwareLogger not found
org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog -> org.slf4j.Logger not found
org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog -> org.slf4j.Marker not found
org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog -> org.slf4j.spi.LocationAwareLogger not found
org.apache.commons.logging.LogAdapter$Slf4jLog -> org.slf4j.Logger not found
它们无法为Spring工作。
这些都没有回答我的问题,因为它们都没有展示如何制作自定义的JRE。
使用 jdeps 在 Java 9 中为自动模块创建 module-info
在使用 maven-jlink-plugin 时是否有一种方法来添加 Maven 依赖项?
这将生成一个 module-info.java
和 module-info.class
,并一直参考这个链接 https://www.baeldung.com/jlink ,试图弄清如何获得自定义 JRE,但我卡在这里了。
谢谢