Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between Run As: Spring Boot App and Run As: Java Application?

If I am using Spring Tool Suite or The Spring IDE plugin for eclipse, I can run a spring boot app 2 ways:

Run As:
    Spring Boot App
    Java Application

enter image description here

Both of these commands work and can fire up my spring boot app without an issue. However, I wanted to understand the difference between the two different processes. Is there actually a difference between them or do they work identically?

like image 959
Matthew Fontana Avatar asked May 27 '16 18:05

Matthew Fontana


People also ask

Can I run spring boot application as Java application?

You can run a Spring Boot application from your IDE as a simple Java application. However, you first need to import your project.

What happens when a spring boot application is run as Java application?

What happens in the background when a Spring Boot Application is “Run as Java Application”? Ans: If you are using Eclipse IDE, Eclipse maven plugin ensures that as soon as you add a dependency or make a change to the class file, it is compiled and ready in the target folder!

What is the difference between Java application and spring boot application?

What is the difference between Java and Spring? Java is a programming language, while Spring is an open source application framework. Therefore, they cannot be directly compared. However, Java EE (which is Java's own server programming platform) is often compared against Spring framework.

Is spring boot and Java same?

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications. It's a Java-based framework used to create a microservice ( microservice is defined as the small services that work together.

What is the difference between Spring-Boot Run and start?

spring-boot:run runs your Spring Boot application. spring-boot:start [..] Start a spring application. Contrary to the run goal, this does not block and allows other goal to operate on the application.

What is Java Spring Boot?

Learn how Java Spring Boot simplifies development of web applications and microservices with Java Spring Framework. What is Java Spring Boot? Java Spring Framework (Spring Framework) is a popular, open source, enterprise-level framework for creating standalone, production-grade applications that run on the Java Virtual Machine (JVM).

What is the difference between Spring Boot and application development?

The application developer can focus on coding only the portions of their application that are business-specific, while Spring Boot takes care of configuring all of the external functionality.

What is the difference between Java Spring Boot and IBM Cloud?

Both Java Spring Boot and IBM Cloud are optimized for distributed cloud applications. Java Spring Boot helps you modularize apps and connect them to third-party services running in the cloud. IBM Cloud is a hybrid cloud platform where you can seamlessly run your modular apps on private and public cloud platforms and on-premises data centers.


1 Answers

There are couple of differences, as someone already hinted in a comment. This article explains that you get some extra 'Bells and Whistles' in the launch configuration editor.

A second and perhaps more important difference is that since Boot 1.3 there is a JMX bean provided by Spring Boot App that allows STS to ask the app nicely to shut down. When you terminate the app from the IDE, for example by clicking the stop / restart button, STS uses this JMX bean to ask the boot app to shut down. This is a feature implemented in the "Run As Boot App" launcher, and so it doesn't take effect if you use "Run As Java App".

The Java launcher simply terminates the process associated with the launch using Java's Process.destroy() method. This is a more 'aggressive' way to kill the associated process and may not allow the app to cleanup stuff properly, for example cleanly closing database connnections.

So... in summary you get two things:

  1. Some extra boot-specific UI in the launch conf editor
  2. Graceful process termination for Boot 1.3 and later.
like image 173
Kris Avatar answered Sep 26 '22 10:09

Kris