MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / main

Method main

src/examples/java/system/Init.java:13–48  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

11
12public class Init {
13 public static void main(String[] args) throws Exception {
14 // CLI options: https://www.swi-prolog.org/pldoc/man?section=cmdline
15 // https://www.swi-prolog.org/FAQ/FindResources.html
16
17
18 if (System.getenv("SWI_HOME_DIR") != null ||
19 System.getenv("SWI_EXEC_FILE") != null ||
20 System.getenv("SWIPL_BOOT_FILE") != null) {
21 String init_swi_config =
22 String.format("%s %s %s -F swipl -g true -q --no-signals --no-packs",
23 System.getenv("SWI_EXEC_FILE") == null ? "swipl" :
24 System.getenv("SWI_EXEC_FILE"),
25 System.getenv("SWIPL_BOOT_FILE") == null ? "" :
26 String.format("-x %s", System.getenv("SWIPL_BOOT_FILE")),
27 System.getenv("SWI_HOME_DIR") == null ? "" :
28 String.format("--home=%s", System.getenv("SWI_HOME_DIR")));
29 System.out.println(String.format("\nSWIPL initialized with: %s", init_swi_config));
30
31 JPL.setDefaultInitArgs(init_swi_config.split("\\s+")); // initialize SWIPL engine
32 } else
33 System.out.println("No explicit initialization done: no SWI_HOME_DIR, SWI_EXEC_FILE, or SWIPL_BOOT_FILE defined");
34
35// JPL.setTraditional();
36 JPL.init();
37 System.out.println("Prolog engine actual init args: " + Arrays.toString(Prolog.get_actual_init_args()));
38
39 System.out.println();
40 System.out.println("==========================================================");
41 report_selected_flags();
42 System.out.println("==========================================================");
43 report_versions();
44 System.out.println("==========================================================");
45 report_all_flags();
46
47
48 }
49
50 public static void report_selected_flags() {
51 System.out.println("REPORTING SELECTED FLAGS: \n");

Callers

nothing calls this directly

Calls 7

setDefaultInitArgsMethod · 0.95
initMethod · 0.95
get_actual_init_argsMethod · 0.95
report_selected_flagsMethod · 0.95
report_versionsMethod · 0.95
report_all_flagsMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected