why am I getting Exec format error when I am writing my linux service? why am I getting Exec format error when I am writing my linux service? bash bash

why am I getting Exec format error when I am writing my linux service?


add shebang to the script

#!/bin/bashsudo java -jar "/home/ubuntu/FirstWebAppWithoutDB.jar"

and execution permission

chmod +x spring-start.sh


Your spring-start.sh is executed by bash you need to explicit your ExecStart in springboot.service file like this :ExecStart=/bin/bash /home/ubuntu/spring-start.sh