At the IntelliJ IDEA level, the RESTful Web Services development support is based on the Java EE: RESTful Web Services (JAX-RS) plugin. This plugin is bundled with IntelliJ IDEA and enabled by default.
At a module level, the service development support can be enabled when creating a project, adding a new module to an existing project, and also for an existing module.
- Making sure that the RESTful Web Services plugin is enabled
- Enabling REST support when creating a project
- Enabling REST support when adding a module to a project
- Enabling REST support for an existing module
- Open the Preferences dialog (e.g. ⌘, or ⌘,⌘, or ⌘,⌘, or ⌘,⌥ F7, ⌥F7 or ⌥F7^ ⌥ S, ⌃⌥S or ⌃⌥S).
- In the left-hand part of the dialog, select Plugins.
-
In the right-hand part of the dialog, on the Plugins page,
type
restfulin the search box. As a result, only the plugins whose names and descriptions containrestfulare shown in the list of plugins. - If the check box to the right of Java EE: RESTful Web Services (JAX-RS) is not selected, select it.
- Click OK in the Preferences dialog.
- If suggested, restart IntelliJ IDEA.
-
If no project is currently open in IntelliJ IDEA,
click Create New Project on the Welcome screen.
Otherwise, select File | New | Project.
As a result, the New Project wizard opens.
- On the first page of the wizard, in the left-hand pane, select Java Enterprise. In the right-hand part of the page, specify the JDK to be used and select the Java EE version to be supported.
- Under Additional Libraries and Frameworks, select the Restful Web Service check box.
-
You'll need
a library that implements
the JAX-RS API.
You can choose to use an existing library, create and use a new one,
download the library files if they are not yet available on your computer,
or postpone setting up the library until a later time.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
Create. If the corresponding library files (
.jar) are already available on your computer, you can arrange those files in a library and use that new library. To do that, click Create and select the necessary files in the dialog that opens. (Use the ^ key for multiple selections.)Optionally, click Configure to edit the selected library. (For an existing library the Edit Library Dialog will open, for the library that you have just created - the Create Library Dialog.)
-
Download.
Select this option to download
the files that implement the JAX-RS API.
(The downloaded files will be arranged in a library.)
Optionally, click Configure to edit the library settings and contents. (The Downloading Options Dialog will open.)
- Set up library later. Select this option to postpone setting up the library until a later time.
Configure. Click this button to edit the settings for the library selected next to Use library or the one that is about to be downloaded.
Click Next.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
-
Specify the name and location settings for your project and module. For more information,
see Project Name and Location.
Click Finish.
-
Open the project you want to add a module to, and
select File | New | Module.
As a result, the New Module wizard opens. (There are also other ways of accessing this wizard, see Opening the New Module wizard.)
- On the first page of the wizard, in the left-hand pane, select Java Enterprise. In the right-hand part of the page, select the Java EE version to be supported.
- Under Additional Libraries and Frameworks, select the Restful Web Service check box.
-
You'll need
a library that implements
the JAX-RS API.
You can choose to use an existing library, create and use a new one,
download the library files if they are not yet available on your computer,
or postpone setting up the library until a later time.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
Create. If the corresponding library files (
.jar) are already available on your computer, you can arrange those files in a library and use that new library. To do that, click Create and select the necessary files in the dialog that opens. (Use the ^ key for multiple selections.)Optionally, click Configure to edit the selected library. (For an existing library the Edit Library Dialog will open, for the library that you have just created - the Create Library Dialog.)
-
Download.
Select this option to download
the files that implement the JAX-RS API.
(The downloaded files will be arranged in a library.)
Optionally, click Configure to edit the library settings and contents. (The Downloading Options Dialog will open.)
- Set up library later. Select this option to postpone setting up the library until a later time.
Configure. Click this button to edit the settings for the library selected next to Use library or the one that is about to be downloaded.
Click Next.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
-
Specify the name and location settings for your module. For more information,
see Module Name and Location.
Click Finish.
- Open the Project tool window (e.g. ).
- Right-click the module of interest and select Add Framework Support.
- In the left-hand pane of the Add Frameworks Support dialog that opens, select the RESTful Web Service check box.
-
You'll need
a library that implements
the JAX-RS API.
You can choose to use an existing library, create and use a new one,
download the library files if they are not yet available on your computer,
or postpone setting up the library until a later time.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
Create. If the corresponding library files (
.jar) are already available on your computer, you can arrange those files in a library and use that new library. To do that, click Create and select the necessary files in the dialog that opens. (Use the ^ key for multiple selections.)Optionally, click Configure to edit the selected library. (For an existing library the Edit Library Dialog will open, for the library that you have just created - the Create Library Dialog.)
-
Download.
Select this option to download
the files that implement the JAX-RS API.
(The downloaded files will be arranged in a library.)
Optionally, click Configure to edit the library settings and contents. (The Downloading Options Dialog will open.)
- Set up library later. Select this option to postpone setting up the library until a later time.
Configure. Click this button to edit the settings for the library selected next to Use library or the one that is about to be downloaded.
-
Use library.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
- Click OK in the Add Frameworks Support dialog.