title: Running Python script from Java/Kotlin application on Heroku
body: <p>I have a Java/Kotlin application that runs a Python script every time the user makes a request.</p>
  
  <p>It works well on my laptop and any other VPS. But I couldn't make it work on Heroku. It does not work and prints nothing.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>val command = "python3 $s/assets/script.py $params"
  println("Command: $command")
  val process = Runtime.getRuntime().exec(command)
  process.waitFor()
  val reader = BufferedReader(InputStreamReader(process.inputStream))
  val message = reader.lines().collect(Collectors.joining("\n"))
  println(message)
  </code></pre>
  
  <p>Why would this fail on Heroku?</p>