RFR: 8295884: Support for development with the Eclipse IDE

Erik Joelsson erikj at openjdk.org
Tue Oct 25 22:19:53 UTC 2022


On Tue, 25 Oct 2022 13:23:34 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> Eclipse is a popular and very well-known IDE in the world of Java development, utilized widely in many contexts, by beginners and experienced teams alike. Although a relatively lightweight IDE, it features surprisingly powerful indexing and code analysis capabilities, as well as useful tools, among which are make and Ant integration. While the tools it provides are not always as sophisticated as other IDEs (IntelliJ IDEA will likely come to mind as one such competitor), the simplicity of using it, as well as the reliability of this rugged IDE makes up greatly for the slightly less advanced tooling. Eclipse requires very little starting infrastructure in the workspace for all these features and indexing support as well, which makes it a good candidate for developing on the JDK.
> 
> This enhancement adds 4 extra targets to the make system for generating a basic Eclipse Workspace that provides almost full indexing support for the JDK, with varying levels as desired, from a minimalistic option only including the JVM's sources, to generating a workspace with both Java and C/C++ natures included, which allows for using Eclipse's ability to quickly swap between Java and C/C++ mode to work on both native and Java sources at the same time. Cross Compiling support is available, and in its entirety the change touches very little of the existing make system, barring its own Makefile within the ide subdirectory.
> 
> Indexing capabilities utilizing the enhancement:
> <img width="960" alt="java" src="https://user-images.githubusercontent.com/32636402/197784819-67ec7de4-7e27-4f33-b738-59b75a9e4403.PNG">
> <img width="787" alt="escape" src="https://user-images.githubusercontent.com/32636402/197784843-df8621a8-7b0a-42da-86f4-3afb92de0f71.PNG">

This looks like nice work.

I'm curious how does this eclipse project figures out preprocessor settings like -D flags from the build to correctly setup the environment for the native code? I know this was a major deal when creating the compile-commands.json for other native IDE integrations. I've heard some IDEs just run the build once and inspect the command lines, but our default log level won't show that. I'm not familiar with eclipse project files, but I couldn't really see anything here that addressed this issue. Can you work with the native code in a meaningful way without it?

make/ide/eclipse/CreateWorkspace.gmk line 79:

> 77:     $(patsubst $(TOPDIR)/%,%,$(call FindModuleNativeDirs, $(module)))))
> 78: 
> 79: EmitEmptyLine = $(file >> $(1),)

Note that using the file macro requires GNU make >=4.0. You probably want to document this requirement and add a fast fail if it's not fulfilled.

-------------

PR: https://git.openjdk.org/jdk/pull/10853


More information about the ide-support-dev mailing list