3

I have a simple hello world java application, I have manually downloaded org.json and added it to my classpath so the below app runs. How can I make a custom JRE to run this app that include the 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 sure how to get past jdeps returning not found

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

And they dont work for spring

These do not answer my questions, as none of them show how to make the custom 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?

This generates a module-info.java and module-info.class and have been referencing this https://www.baeldung.com/jlink to try to figure how to get my custom jre but I am stuck here.

Thank you

Naman
  • 27,789
  • 26
  • 218
  • 353
spen123
  • 3,464
  • 11
  • 39
  • 52
  • Okay, understand that if your final goal is to build a custom JRE, the question is still a duplicate because of the use of automatic modules. If it's just about not being able to generate a module-info, it still stands valid. – Naman Jan 24 '20 at 02:17
  • 1
    @Naman yes, I am trying to generate the module-info.java so I eventually can make the custom JRE, but my main question is to first get the module-info.java/ module-info.class – spen123 Jan 24 '20 at 05:02

1 Answers1

0

I generated the module-info.java through the help of my ide. I am using STS 4.6.2. I just right-clicked on my project -> configure -> Create module-info.jar. Then if you're using maven, just do a clean install and the module-info.class will be generated. Hope this helps.

Rocky
  • 429
  • 1
  • 9
  • 26