Installlation of .NET runtime on macOS is covered in the Microsoft Docs.
The launch daemon
that runs the PDF service can be installed using an installation script.
The launch daemon is defined in a configuration file com.stepover.pdf-service.plist with content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.stepover.pdf-service</string>
<!-- The path to java and PDF service jar -->
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/openjdk/bin/java</string>
<string>-cp</string>
<string>/usr/local/lib/pdfService-4.3.0-jar-with-dependencies.jar</string>
<string>com.so.pdfService.Main</string>
</array>
<key>KeepAlive</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>50051</string>
<key>SockType</key>
<string>stream</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</dict>
</plist>
This configarution file has an array of <key>ProgramArguments</key>
that run the service using a path to <JAVA> and a <PATH-TO-PDF-SERVICE-JAR>.
Provide <JAVA>
Java can be installed on a MacOS with Homebrew
> brew install openjdk
Alternatively, fetch a JRE from adoptopenjdk.net or from Oracle
and extract it to the file system,
preferably to /usr/local.
Provide <PATH-TO-PDF-SERVICE-JAR>
Fetch the pdf-service-with-dependencies-jar
to the file system,
preferably to /usr/local/lib
and use that path in the ProgramArguments.
Install the service
Copy the deamon configuration file to
/Libraries/LaunchDaemons/com.stepover.pdf-service.plist
Reboot.
Alternatively, avoid rebooting using launchctl(1) as root:
> launchctl load /Libraries/LaunchDaemons/com.stepover.pdf-service.plist
> launchctl start com.stepover.pdf-service
The installation script
attached here executes the steps above using a JRE from adoptopenjdk.net for MacOS-x64:
#!/usr/bin/env sh
firstDir=`pwd`
echo "Please read https://www.stepoverinfo.net/src/Agreement/Agreement.html"
echo "Do you agree (y/n)? \c"
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "ok"
else
exit
fi
pdf_service_jar="pdfService-4.3.0-jar-with-dependencies.jar"
pdf_service_jar_link="https://stepoverinfo.net/DeveloperSamples/NETDriver/Setup/$pdf_service_jar"
jre_link="https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16%2B36/OpenJDK16-jre_x64_mac_hotspot_16_36.tar.gz"
cd /
target=/usr/local
mkdir -p $target/lib
if [ "_$1" != "_skip" ] ;then
curl $pdf_service_jar_link > $target/lib/$pdf_service_jar
cd $target
curl -L $jre_link | tar -zx
cd /
fi
pdf_service_jar_path=`find $target/lib -name "pdfService-*-jar-with-dependencies.jar" | sort | tail -n 1`
java=`find -E $target -regex ".*/bin/.*java" | sort | tail -n 1`
cd $firstDir
echo "\
<?xml version="1.0" encoding="UTF-8"?> \n\
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> \n\
<plist version="1.0"> \n\
<dict> \n\
<key>Label</key> \n\
<string>com.stepover.pdf-service</string> \n\
\n\
<!-- The path to java and PDF service jar --> \n\
<key>ProgramArguments</key> \n\
<array> \n\
<string>$java</string> \n\
<string>-cp</string> \n\
<string>$pdf_service_jar_path</string> \n\
<string>com.so.pdfService.Main</string> \n\
</array> \n\
<key>KeepAlive</key> \n\
<true/> \n\
\n\
<key>Sockets</key> \n\
<dict> \n\
<key>Listeners</key> \n\
<dict> \n\
<key>SockServiceName</key> \n\
<string>50051</string> \n\
<key>SockType</key> \n\
<string>stream</string> \n\
<key>SockFamily</key> \n\
<string>IPv4</string> \n\
</dict> \n\
</dict> \n\
</dict> \n\
</plist> \n\
" \
> /Library/LaunchDaemons/com.stepover.pdf-service.plist
# legacy commands, see launchctl(1)
launchctl load /Library/LaunchDaemons/com.stepover.pdf-service.plist
launchctl start com.stepover.pdf-service
launchctl print system/com.stepover.pdf-service | head -n 15