You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(Java): Fix Intellij part: make it more generic (#1008)
* docs(Java): Fix Intellij part: make it more generic
The latest Intellij version has a `Generated Sources Root` marker, that
should be used instead of `Sources Root`.
Also, all keyboard shortcuts may differ, so let's make the section
more generic.
* Apply suggestions from code review
Co-authored-by: René Jeglinsky <[email protected]>
---------
Co-authored-by: René Jeglinsky <[email protected]>
Copy file name to clipboardExpand all lines: java/getting-started.md
+7-13Lines changed: 7 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -205,25 +205,19 @@ CAP Java projects can be edited best in a Java IDE. Leaving CDS support aside yo
205
205
* [IntelliJ Idea Ultimate](/tools/cds-editors#intellij) is one of the leading Java IDEs with very powerful debugging, refactoring and profiling support. Together with the CDS Plugin it offers the most powerful support for CAP Java application development.
206
206
207
207
208
-
### Open the project in your IDE
208
+
#### Source Path Configuration and CDS build
209
209
210
-
The rest of this guide is targets IntelliJ Ultimate as your IDE. Nevertheless, the steps should be pretty similar for Visual Studio Code and SAP Business Application Studio.
210
+
Your IDE might show inline errors indicating missing classes. This happens because the generated Java files are missing.
211
211
212
-
<span id="inimportproject" />
212
+
To resolve this, open your terminal and execute `mvn compile`in your project root directory. This action performs a full build of your project. It's necessary because, although the IDE can construct the correct class path based on the project's dependencies, it doesn't initiate the CDS build or subsequent code generation. This is covered as part of the `mvn compile` call.
213
213
214
-
You can open the project by either running `idea .` from the project root or use the `File->Open...` menu.
214
+
If you're using JetBrains' Intellij, you need to tell it to use the generated folder `srv/src/gen/java`. Do so by marking the directory as `Generated Sources Root`. You can find this option in IntelliJ's project settings or by right-clicking on the folder and choosing `Mark Directory as`. By doing this, you ensure that the IntelliJ build includes the generated sources in the Java ClassPath.
215
215
216
-
### Source Path Configuration and CDS build
216
+
#### Run and Test the Application
217
217
218
-
1. Open the internal terminal with `option+F12` (Windows: `alt+F12`) and type`mvn compile` to perform a full build of your project. This is needed because the IDE can build the right class path based on the dependencies of the project. But it does not trigger the CDS build or the following code generation. This is covered as part of the `mvn compile` call.
218
+
Once you've configured your application as described in the previous section, you can run your application in your IDE by starting the `main` method of your project's `Application.java`.
219
219
220
-
2. In the project explorer, find the folder `srv/src/gen/java` and open the context menu with a right click on the folder. In the menu open `Mark directory as` and then`Sources Root`. If the option is not available the directory is already recognized as Sources Root. With this step you make sure that the IntelliJ build recognizes the generated sources as part of the Java ClassPath.
221
-
222
-
### Run and Test the Application
223
-
224
-
1. Push `Ctrl` two times and type"Application". Double click the Application Spring Boot entry to start your CAP Java application.
225
-
226
-
2. Call the application in your browser at [http://localhost:8080/](http://localhost:8080).
220
+
Then open the application in your browser at [http://localhost:8080/](http://localhost:8080).
0 commit comments