Skip to content

Add oieserver launcher script - #119

Merged
tonygermano merged 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:oieserver-launchscript
Oct 21, 2025
Merged

Add oieserver launcher script#119
tonygermano merged 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:oieserver-launchscript

Conversation

@tonygermano

Copy link
Copy Markdown
Member

This version of the script is a modified version of Mitch Gaffigan's script, which in turn was a bash port of my clojure app from #61.

This script is the main launcher for the Open Integration Engine (OIE) server. It prepares the Java environment and executes the server launcher JAR file.

The script automatically finds a compatible Java runtime (version 17+ by default) by searching for a valid executable in the following priority order:

  1. The OIE_JAVA_PATH environment variable.
  2. The -java-cmd directive in the oieserver.vmoptions file or included .vmoptions files. Must specify the path to the 'java' executable. This is the preferred way to declare the desired version for running the server and can be overridden by OIE_JAVA_PATH. Can be a relative path from the location of this script.
  3. The JAVA_HOME environment variable.
  4. The 'java' command available in the system's PATH.

It also parses the 'oieserver.vmoptions' file to configure JVM options, system properties (-D...), and classpath modifications.

Issue: #2

@tonygermano
tonygermano requested review from a team, gibson9583, jonbartels, kayyagari, kpalang, pacmano1 and ssrowe and removed request for a teamJune 14, 2025 17:00
@tonygermanotonygermano mentioned this pull request Jun 14, 2025
4 tasks

@mgaffiganmgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. I don't think I've been in the codebase long enough to "request changes", but i am suggesting some in the review comments.

Comment threadserver/basedir-includes/oieserver
Comment threadserver/basedir-includes/oieserver Outdated
Comment threadserver/basedir-includes/oieserver Outdated
Comment threadserver/basedir-includes/oieserver Outdated
Comment threadserver/basedir-includes/oieserver Outdated
@tonygermano
tonygermanoforce-pushed the oieserver-launchscript branch from bc22c01 to 601fba6CompareJune 14, 2025 18:08
tonygermano added a commit to tonygermano/engine that referenced this pull request Jun 15, 2025
Issue: OpenIntegrationEngine#2
Pull-request: OpenIntegrationEngine#119
Signed-off-by: Tony Germano <tony@germano.name>

@pacmano1pacmano1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to fix the java check to handle 1.8.x (for a better error message)

@tonygermano

Copy link
Copy Markdown
MemberAuthor

I think you need to fix the java check to handle 1.8.x (for a better error message)

It won't change the error message, because it only reports that the given path does not meet the minimum requirement, not which version, if any, was found.

kayyagari
kayyagari previously approved these changes Jun 17, 2025

@kayyagarikayyagari left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on M2 with Java17.

pacmano1
pacmano1 previously approved these changes Jun 17, 2025

@pacmano1pacmano1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can agree to disagree. I think the version should be echoed when there's a problem, but will approve anyway.

@kayyagari

Copy link
Copy Markdown

@pacmano1 the script reported this error when I first ran with JAVA_HOME set to 1.8:

Warning: '/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java' is specified by the JAVA_HOME environment variable, which is not a valid Java executable of at least version 17. Ignoring. Warning: 'java' does not exist in your PATH or is not a valid Java executable of at least version 17. Error: Could not find a Java 17+ installation. Please configure -java-cmd in conf/custom.vmoptions, set OIE_JAVA_PATH, set JAVA_HOME, or ensure 'java' in your PATH is version 17 or higher.

Any other detail you would prefer in addition to this?.

@pacmano1

Copy link
Copy Markdown
Contributor

It's fine

@tonygermano
tonygermano dismissed stale reviews from pacmano1 and kayyagari via a8b2ed5June 21, 2025 10:30
@tonygermanotonygermano changed the title Add oieserver launcher script (bash version)Add oieserver launcher scriptJun 21, 2025
@tonygermanotonygermano linked an issue Jun 21, 2025 that may be closed by this pull request
3 tasks
@mgaffigan

mgaffigan commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

See mgaffigan@a6cd2ef for some suggested changes. Documentation edited to be available to Get-Help.

Other suggestion would be to default based on the registry on windows. I don't know whether JAVA_HOME is set by most installers.

$registryJavaHome=`
(Get-ItemProperty-LiteralPath 'HKLM:\SOFTWARE\JavaSoft\Java Development Kit'-ErrorAction SilentlyContinue -RegView Default).JavaHome -or`
(Get-ItemProperty-LiteralPath 'HKLM:\SOFTWARE\JavaSoft\Java Development Kit'-ErrorAction SilentlyContinue -RegView 32Bit).JavaHome -or`
(Get-ItemProperty-LiteralPath 'HKLM:\SOFTWARE\JavaSoft\Java Runtime Environment'-ErrorAction SilentlyContinue -RegView Default).JavaHome -or`
(Get-ItemProperty-LiteralPath 'HKLM:\SOFTWARE\JavaSoft\Java Runtime Environment'-ErrorAction SilentlyContinue -RegView 32Bit).JavaHome

@mgaffiganmgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments and suggested edits commit in mgaffigan@a6cd2ef.

Most are nits or concision. Only significant issue I see in the powershell rev is that the args passed to java should be a splat (@ not $) - not an implicit array to string, since that will not handle quotes.

Comment threadserver/basedir-includes/oieserver.ps1 Outdated
Comment threadserver/basedir-includes/oieserver.ps1 Outdated
Comment threadserver/basedir-includes/oieserver.ps1 Outdated
Comment threadserver/basedir-includes/oieserver.ps1 Outdated
Comment threadserver/basedir-includes/oieserver.ps1
Comment threadserver/basedir-includes/oieserver.ps1
This script is the main launcher for the Open Integration Engine (OIE)
server. It prepares the Java environment and executes the server launcher
JAR file.
The script automatically finds a compatible Java runtime (version 17+ by
default) by searching for a valid executable in the following priority order:
1. The OIE_JAVA_PATH environment variable.
2. The -java-cmd directive in the oieserver.vmoptions file or included
.vmoptions files. Must specify the path to the 'java' executable.
This is the preferred way to declare the desired version for running
the server and can be overridden by OIE_JAVA_PATH. Can be a relative
path from the location of this script.
3. The JAVA_HOME environment variable.
4. The 'java' command available in the system's PATH.
It also parses the 'oieserver.vmoptions' file to configure JVM options,
system properties (-D...), and classpath modifications.
Signed-off-by: Tony Germano <tony@germano.name>
Co-authored-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Issue: OpenIntegrationEngine#2
@tonygermano
tonygermanoforce-pushed the oieserver-launchscript branch from f628d49 to 21f3275CompareOctober 21, 2025 01:03
@tonygermano
tonygermano merged commit 21f3275 into OpenIntegrationEngine:mainOct 21, 2025
2 checks passed
@tonygermano
tonygermano deleted the oieserver-launchscript branch October 21, 2025 02:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create server launcher to replace mcserver

6 participants

@tonygermano@kayyagari@pacmano1@mgaffigan@gibson9583@jonbartels