1

I am using Python's library Tabula which has a dependency on Java 8.0+. I can run the flask app successfully on my local machine using Postman as I have java installed in my path, however I am unable to do so on Cloud Foundry (Error 500- Java not found).

I tried the solutions mentioned in the below question Add Java in Python Flask Cloud Foundry

I also tried adding multiple Build packs using https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html#cfcli .

cf v3-push MY-APP-NAME -b https://github.com/cloudfoundry/apt-buildpack#v0.1.4 -b python_buildpack

The Build packs got successfully installed as well but I received the same error

Adding apt.yml file below

  ---
packages:
- openjdk-8-jre
repos:
- deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty main
keys:
- https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xEB9B1D8886F44E2A

Any leads? I am using Python 3.x and Flask.

  • Can you share more information about what happens when you try https://stackoverflow.com/questions/49193354/add-java-in-python-flask-cloud-foundry? Where does that fail? What is the output you see when pushing your app? What's in your apt.yml? etc... – Daniel Mikusa Nov 16 '20 at 20:27
  • @DanielMikusa Hi, Thanks for the input, I end up getting the same error on cloud 'Java Not Found'. My apt.yml is the same as the question, the only change I had to apply from the previous answer was to change the version(Posted it in my question). Let me know if more information is needed – Shivam Kashyap Nov 17 '20 at 06:24
  • Again, the output from running push & the contents of your apt.yml is necessary to understand what is happening. Aside from that, as is noted in the other question this will *not* put `java` on the path. You need to use the full path when calling it: `/home/vcap/deps/0/lib/jvm/java-8-openjdk-amd64/bin/java`. – Daniel Mikusa Nov 20 '20 at 15:00
  • Hi @DanielMikusa, Added apt.yml file. – Shivam Kashyap Nov 25 '20 at 07:08
  • `deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty main` this looks suspect. It says `trusty` which is probably not the right version. Most people are going to be running `cflinuxfs3` which is Ubuntu Bionic based. Are you using `cflinuxfs3`? – Daniel Mikusa Nov 26 '20 at 03:03

0 Answers0