IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Tutorial: Your first RESTful web service

Last modified: 10 August 2022

Required plugins: Jakarta EE Platform, Jakarta EE: Application Servers, Jakarta EE: Web/Servlets, Jakarta EE: RESTful Web Services (JAX-RS), GlassFish (bundled)

This tutorial describes how to create a simple RESTful web service in IntelliJ IDEA and deploy it to the GlassFish application server. The service will output Hello, World! when you access a specific URL through the web browser or otherwise send a GET request to this URL. Use the switcher at the top of this page for instructions for a different application server.

You will create a new Java Enterprise project, add the necessary Java code, tell IntelliJ IDEA where your GlassFish server is located, then use a run configuration to build the artifact, start the server, and deploy the artifact to it.

Here is what you will need:

  • Java SE Development Kit (JDK) version 1.8 or later. You can get the JDK directly from IntelliJ IDEA as described in Java Development Kit (JDK) or download and install it manually, for example: Oracle JDK or OpenJDK.

  • The GlassFish application server version 3.0.1 or later. You can get the latest release from the official reference implementation web site. The Web Profile subset should be enough for the purposes of this tutorial.