Kunal
Kunal

Reputation: 607

Best option for running java web service (rest based) (JRE/JDK vs Server JRE)

I was stumble upon two options while deploying java web service (rest api built using spring-boot and family).

  1. install JRE/JDK and use -server argument for starting up service java -server -classpath lib\*.jar -Denv=staging com.acme.pos.application.Application
  2. install server JRE from http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html and use above java command

Can someone please answer this with the best practices perspective?

Upvotes: 0

Views: 533

Answers (1)

fvu
fvu

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

Related Questions