8279877: Document IDEA IDE setup in docs/ide.md

Reviewed-by: lancea, erikj
This commit is contained in:
Daniel Jelinski 2022-01-13 16:17:50 +00:00 committed by Lance Andersen
parent 0a839b434b
commit 9209e6d6ae
2 changed files with 37 additions and 6 deletions

View File

@ -41,14 +41,20 @@
<pre class="shell"><code>make vscode-project-clangd</code></pre> <pre class="shell"><code>make vscode-project-clangd</code></pre>
<p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p> <p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p>
<h4 id="visual-studio">Visual Studio</h4> <h4 id="visual-studio">Visual Studio</h4>
<p>This section is a work in progress.</p> <p>The make system can generate a Visual Studio project for the Hotspot native source. After configuring, the project is generated using:</p>
<pre class="shell"><code>make ide-project</code></pre> <pre class="shell"><code>make hotspot-ide-project</code></pre>
<p>This creates a file named <code>jvm.vcxproj</code> in <code>ide\hotspot-visualstudio</code> subfolder of the build output folder. The file can be opened in Visual Studio via <code>File -&gt; Open -&gt; Project/Solution</code>.</p>
<h4 id="compilation-database">Compilation Database</h4> <h4 id="compilation-database">Compilation Database</h4>
<p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p> <p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p>
<pre class="shell"><code>make compile-commands</code></pre> <pre class="shell"><code>make compile-commands</code></pre>
<p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p> <p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p>
<pre class="shell"><code>make compile-commands-hotspot</code></pre> <pre class="shell"><code>make compile-commands-hotspot</code></pre>
<h3 id="ide-support-for-java-code">IDE support for Java code</h3> <h3 id="ide-support-for-java-code">IDE support for Java code</h3>
<p>This section is a work in progress.</p> <h4 id="intellij-idea">IntelliJ IDEA</h4>
<p>The JDK project has a script that can be used for indexing the project with IntelliJ. After configuring and building the JDK, an IntelliJ workspace can be generated by running the following command in the top-level folder of the cloned repository:</p>
<pre class="shell"><code>bash bin/idea.sh</code></pre>
<p>To use it, choose <code>File -&gt; Open...</code> in IntelliJ and select the folder where you ran the above script.</p>
<p>Next, configure the project SDK in IntelliJ. Open <code>File -&gt; Project Structure -&gt; Project</code> and select <code>build/&lt;config&gt;/images/jdk</code> as the SDK to use.</p>
<p>In order to run the tests from the IDE, you can use the JTReg plugin. Instructions for building and using the plugin can be found <a href="https://github.com/openjdk/jtreg/tree/master/plugins/idea">here</a>.</p>
</body> </body>
</html> </html>

View File

@ -45,12 +45,17 @@ after the workspace has been generated.
#### Visual Studio #### Visual Studio
This section is a work in progress. The make system can generate a Visual Studio project for the Hotspot
native source. After configuring, the project is generated using:
```shell ```shell
make ide-project make hotspot-ide-project
``` ```
This creates a file named `jvm.vcxproj` in `ide\hotspot-visualstudio`
subfolder of the build output folder. The file can be opened in Visual Studio
via `File -> Open -> Project/Solution`.
#### Compilation Database #### Compilation Database
The make system can generate generic native code indexing support in the form of The make system can generate generic native code indexing support in the form of
@ -70,4 +75,24 @@ make compile-commands-hotspot
### IDE support for Java code ### IDE support for Java code
This section is a work in progress. #### IntelliJ IDEA
The JDK project has a script that can be used for indexing the project
with IntelliJ. After configuring and building the JDK, an IntelliJ workspace
can be generated by running the following command in the top-level folder
of the cloned repository:
```shell
bash bin/idea.sh
```
To use it, choose `File -> Open...` in IntelliJ and select the folder where
you ran the above script.
Next, configure the project SDK in IntelliJ. Open
`File -> Project Structure -> Project` and select `build/<config>/images/jdk`
as the SDK to use.
In order to run the tests from the IDE, you can use the JTReg plugin.
Instructions for building and using the plugin can be found
[here](https://github.com/openjdk/jtreg/tree/master/plugins/idea).