我有一个简单的hello world java应用程序,我手动下载了org.json并将其添加到我的类路径中,以便运行下面的应用程序。如何创建自定义JRE来运行包含jar的应用程序?
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");
}
}不确定如何通过返回Not found的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它们对春天不起作用
这些并没有回答我的问题,因为它们都没有展示如何制作定制的JRE。
creating module-info for automatic modules with jdeps in java 9
Is there a way to add maven dependencies while using the maven-jlink-plugin?
这会生成一个module-info.java和module-info.class,并一直引用这个https://www.baeldung.com/jlink来尝试如何获取我的自定义jre,但我被困在这里了。
谢谢
发布于 2020-06-24 16:52:33
我在ide的帮助下生成了module-info.java。我使用的是STS 4.6.2。我只是right-clicked on my project -> configure -> Create module-info.jar。如果你使用的是maven,只需进行一次全新的安装,就会生成module-info.class。希望这能有所帮助。
https://stackoverflow.com/questions/59886047
复制相似问题