1

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.json.JSONObject;

public class Go {

    public static void main(String[] args) {


        System.out.println("before");

        JSONObject test = new JSONObject();
        test.put("test", "test");
        System.out.println(test);

    }

}

Here is what I have tried:

jdeps --module-path out --generate-module-info out json-20190722.jar 

javac --patch-module org.json=json-20190722.jar out/org.json/module-info.java 

jar --update --file json-20190722.jar out/org.json/module-info.class 

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

spen123
  • 3,464
  • 11
  • 39
  • 52

0 Answers0