I need the java executable to run a java -jar from a cloudfoundry task command.
Here is how I try to run the task:
cf run-task bignibou-batch "java -jar bignibou-batch/build/libs/bignibou-batch.jar"
Here is the error message I get:
2016-12-24T12:53:30.002+01:00 [APP/TASK/358e02df/0] [ERR] bash: java: command not found
My manifest uses the java buildpack as follows (see bignibou-batch
app at the bottom):
---
buildpack: https://github.com/cloudfoundry/java-buildpack.git
memory: 1024M
env:
APPLICATION_URL: http://bignibou-server.cfapps.io/
APPLICATION_MAIL_NO_REPLY_ADDRESS: balteo@bignibou-server.cfapps.io
SPRING_PROFILES_ACTIVE: cloud
applications:
- name: bignibou-server
path: bignibou-server/build/libs/bignibou-server.jar
env:
APPLICATION_GOOGLE_API_KEY: *******************
- name: bignibou-batch
path: bignibou-batch/build/libs/bignibou-batch.jar
no-hostname: true
no-route: true
env:
JAVA_OPTS: -Dspring.batch.job.names=messagesDigestMailingJob
edit: When I try to set the location of the java buildpack as follows:
cf run-task bignibou-batch "$PWD/.java-buildpack/open_jdk_jre/bin/java -jar bignibou-batch/build/libs/bignibou-batch.jar"
The $PWD
variable is resolved on my local machine before the command is sent...