From 240495bbd9d4304dc696e4437c477e3da4925b35 Mon Sep 17 00:00:00 2001 From: Jonathan Zak Date: Wed, 18 Dec 2024 13:11:32 -0500 Subject: [PATCH 1/3] Update docs, regarding java version --- docs/install.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/install.md b/docs/install.md index a2c6499..f2cad8d 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,12 +2,16 @@ This document will outline how to install Manzan on to IBM i. Manzan is install Building Manzan is easy for IBM i and we provide makefiles to simplify the entire process. +## Which Java to use +Use a Java version provided by IBM, which is at least version 8. When running the `java -version` command, the output +should contain the string `IBM Semeru Runtime Certified Edition`. Otherwise, Manzan may not function properly. + ## Install from GitHub release To install from a github release, simply perform the following steps: 1. Download the latest binary release from [the releases page](https://github.com/ThePrez/Manzan/releases) -1. If you didn't download to IBM i directly, transfer the `.jar` file to IBM i using technique of your choice -1. Run `java -jar ` +2. If you didn't download to IBM i directly, transfer the `.jar` file to IBM i using technique of your choice +3. Run `java -jar ` For instance, to install version `0.0.6`, the steps from an IBM i (using open source `wget`) would look like: ```bash From 1d04d00622eb39baa8d1ba4744340c0b2fae76b1 Mon Sep 17 00:00:00 2001 From: Jonathan Zak Date: Wed, 18 Dec 2024 13:47:05 -0500 Subject: [PATCH 2/3] Check java vendor is IBM --- .../com/github/theprez/manzan/ManzanMainApp.java | 12 ++++++++++++ docs/install.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/camel/src/main/java/com/github/theprez/manzan/ManzanMainApp.java b/camel/src/main/java/com/github/theprez/manzan/ManzanMainApp.java index e0ac744..a5585ff 100644 --- a/camel/src/main/java/com/github/theprez/manzan/ManzanMainApp.java +++ b/camel/src/main/java/com/github/theprez/manzan/ManzanMainApp.java @@ -32,6 +32,18 @@ public static void main(final String... _args) throws Exception { return; } + // Check to make sure we use right java version on IBM i + if (Config.isIBMi()){ + // Get the Java vendor property + String javaVendor = System.getProperty("java.vendor"); + // Check if the vendor is IBM + if (!javaVendor.toLowerCase().contains("ibm")) { + System.out.println("Java vendor: " + javaVendor); + System.err.println("Error: This application requires Java provided by IBM"); + System.exit(1); + } + } + for(final String arg:_args) { if(arg.startsWith("--configdir=")) { System.setProperty(Config.DIRECTORY_OVERRIDE_PROPERTY, arg.replaceFirst("^[^=]+=", "")); diff --git a/docs/install.md b/docs/install.md index f2cad8d..9989ce0 100644 --- a/docs/install.md +++ b/docs/install.md @@ -4,7 +4,7 @@ Building Manzan is easy for IBM i and we provide makefiles to simplify the entir ## Which Java to use Use a Java version provided by IBM, which is at least version 8. When running the `java -version` command, the output -should contain the string `IBM Semeru Runtime Certified Edition`. Otherwise, Manzan may not function properly. +should contain the string `IBM`. Ex. `IBM Semeru Runtime Certified Edition`. Otherwise, Manzan may not function properly. ## Install from GitHub release From 82f54354156ddab0c5fb3c653c2c4e3a81ded5cf Mon Sep 17 00:00:00 2001 From: Jonathan Zak Date: Wed, 18 Dec 2024 13:48:54 -0500 Subject: [PATCH 3/3] change isIbmi to public --- .../java/com/github/theprez/manzan/configuration/Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camel/src/main/java/com/github/theprez/manzan/configuration/Config.java b/camel/src/main/java/com/github/theprez/manzan/configuration/Config.java index 783549b..4a484ea 100644 --- a/camel/src/main/java/com/github/theprez/manzan/configuration/Config.java +++ b/camel/src/main/java/com/github/theprez/manzan/configuration/Config.java @@ -15,7 +15,7 @@ public abstract class Config { public static final String DIRECTORY_OVERRIDE_PROPERTY = "manzan.configdir"; public static final String COMPONENT_OPTIONS_PREFIX = "componentOptions."; - protected static boolean isIBMi() { + public static boolean isIBMi() { final String osName = System.getProperty("os.name", "Misty"); return "os400".equalsIgnoreCase(osName) || "os/400".equalsIgnoreCase(osName); }