These days approximately 100% of people writing Java code are using either Maven or Gradle to build their projects, and have their project organized based on that. I say "approximately" but I'm pretty sure the percentage of people not doing this is a rounding error we can ignore. Anyway, all the major IDE's, so far as I know, can import a Maven or Gradle project and work with it. So if you setup your project to use Maven or Gradle, you can share it around and anybody using any IDE (or no IDE) can work with it. Now there will still be (usually anyway) some IDE specific files that get created when you import the project into Netbeans, Eclipse, whatever. But those you can just mention in .gitignore and choose not to distribute with your project.
Not sure how all the various IDE's handle working with things like Make or Cmake for environments building with those tools, but I expect a similar pattern probably holds to a large extent. YMMV.