We have the same scenario, but with just a shell script launching our java app. When we do a build of our app, a set of jar files are placed in a dir, and a lancher bash script is generated, which looks like:
#!/bin/bash
## Define the classpath with all external jar dependencies and the class files
CLASSPATH=/path/to/Foo.jar:\
/path/to/Bar.jar:\
/path/to/other
## Call the Java runtime, passing the classpath, the main class, and all script arguments
MAIN_CLASS=xx.yy.zz.Main
java -cp $CLASSPATH $MAIN_CLASS "$@"
The java app itself opens a TCP connection to a database. But when the launcher shell script is executed from the command line, it never elicits the OS prompt for "Do you want to allow to access local network?". Instead I just get "No route to host" error message.
The exact same java app runs correctly inside the IDE, which was granted local network access.
How do we facilitate shell script launchers or similar homemade cli utilities that need network connections like this?
Topic:
App & System Services
SubTopic:
Networking
Tags: