Skip to content

Commit

Permalink
Check java vendor is IBM
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyz32 authored and ThePrez committed Jan 3, 2025
1 parent feb1b45 commit 6afc65e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions camel/src/main/java/com/github/theprez/manzan/ManzanMainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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("^[^=]+=", ""));
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6afc65e

Please sign in to comment.