I precisely followed the steps in the tutorial at this link to create a Spring Boot web service. I am able to run the service on my local CentOS 7 devbox when the terminal is pointed to the root directory of the uncompiled app, and I type in the following:
# ./gradlew clean build && java -jar build/libs/gs-actuator-service-0.1.0.jar
However, the app is throwing an error instead of loading when I scp
the resulting jar
to a remote CentOS 7 web server and move the jar
to /some/arbitrary/path/to/jar/gs-actuator-service-0.1.0.jar
and then cd /some/arbitrary/path/to/jar/
and java -jar gs-actuator-service-0.1.0.jar
. How can I resolve this error and thus be able to start the app succesfully on the remote CentOS 7 web server?
I imagine that the error has to do with directory structure, but I just want the jar on the web server. I do not want the un-jarred app on the server. And the only way I know to eliminate the error would be to recreate the un-jarred app on the server. How can I fix the problem without resorting to loading the whole un-jarred app to the server?
Here is the stack trace:
$ java -jar gs-actuator-service-0.1.0.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: hello/HelloWorldConfiguration : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:170)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
at java.lang.Thread.run(Thread.java:745)
$