Reputation: 607
I was stumble upon two options while deploying java web service (rest api built using spring-boot and family).
java -server -classpath lib\*.jar -Denv=staging com.acme.pos.application.Application
Can someone please answer this with the best practices perspective?
Upvotes: 0
Views: 533
Reputation: 32953
These options are unrelated, Server JRE is a specific packaging for servers, to avoid having to install a full JDK with the associated security risks. Oracle explains this on the download page:
The Server JRE includes tools for JVM monitoring and tools commonly required for server applications, but does not include browser integration (the Java plug-in).
You should do 2, as explained above, and maybe 1, which optimizes the JVM for server workloads, because of performance advantages. However, have a look at http://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html: on the 64 bits JVM the server VM is the only one available.
Upvotes: 1