Java springboot app , Start Command?

Hello, I am very new to render and I am trying to deploy my first java springboot app here but I am not able to understand what is the “start” command,can any one tell ?.

To run a built JAR, you can use:

java -jar app.jar

replacing app.jar with the name of your built JAR.

i have used this command but its not working giving error : bash: java: command not found

Are you pulling an image in your Dockerfile that contains the JDK?

yes this is my dockerfile :
FROM maven:3.8.5-openjdk-17 AS build

COPY . .

RUN mvn clean package -DskipTests

FROM openjdk:17.0.1-jdk-slim

COPY --from=build /target/mentormate-server-0.0.1-SNAPSHOT.jar demo.jar

EXPOSE 8080

ENTRYPOINT [“java”,“-jar”,“demo.jar”]

1 Like

Hi,

It seems you might be referring to different things. Render doesn’t currently over a Java Native Runtime, so you’d need to use Docker for a Java/Spring Boot app. When using Docker, there isn’t a “Start Command” option on the service, it would work from the ENTRYPOINT / CMD in the Dockerfile (or you can override both with the “Docker Command” setting on the service)

I have a very basic Spring Boot example that deploys and returns requests. Maybe that will help to compare to see if there’s any particular configuration you need to get your project up and running.

Render Web Services expect an HTTP web server to run binding to host 0.0.0.0 and a port. More in the docs: https://docs.render.com/web-services#port-binding

Alan

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.