Skip to content

Unable to find Java #5690

@marcoliceti

Description

@marcoliceti

Hi, I'm developing a Spring Boot application on Ubuntu (running inside a Vagrant-managed virtual machine). I'm following this official guide to run my app as a service. So I did:

$ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp

(Of course I previously generated the jar with mvn clean package and changed /var/myapp/myapp.jar with the actual path for my jar)

It worked for a couple of days. Now when I do:

sudo service myapp start

...it says Unable to find Java.

I can still run my app with java -jar myapp.jar.

Here are some relevant settings from my bash profile:

export PATH=$PATH:~/java/bin:~/maven/bin
export JAVA_HOME=~/java

(Note: I installed both Java and Maven by downloading the official binaries into my home directory. Also, I shortened the full, detailed names, e.g. apache-maven-3.3.9-bin -> maven).

Also, this is the output from mvn -version:

Maven home: /home/vagrant/maven
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: /home/vagrant/java/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-68-generic", arch: "amd64", family: "unix"

Maybe there's a bug here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions