When I try to run my .jar file that is located in the project's resources folder I get an exception that says "Launch path is not accessible." I have created a bridge Objective-C file so swift will have access to NSTask interface.
My code source is:
let bundle = Bundle.main
let path = bundle.path(forResource: "/Resources/MyJar", ofType: "jar")
let task = NSTask()
task?.standardOutput = stdout
task?.standardError = stderr
task?.arguments = ["-jar", path, args]
task?.setLaunchPath("/usr/bin/java")
task?.launch()
task?.waitUntilExit()