eclipse-jdt / eclipse-jdt/eclipse.jdt.core

Support '-m, --module' options from Javac

Open
#3,541 2 comments 0 reactions 0 assignees View on GitHub
enhancement javac
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

_This is a clone of https://bugs.eclipse.org/bugs/show_bug.cgi?id=578320, because the issue was never imported and had no reactions on Bugzilla either for three years._

ECJ does not support the `-m, --module` options from Javac. In connection with `--module-source-path`, this would enable users to compile a (set of) module(s) without explicitly specifying all source files, because they would be found automatically.

Javac has this option:

```text
--module (,)*, -m (,)*
Compile only the specified module(s), check timestamps
```

It works like this (added line breaks for readability):
```text
javac
--release 11
-d bin
--module-path "c:\Program Files\Java\AspectJ\lib\aspectjrt.jar"
--module-source-path "modules/*/src"
--module org.acme.first,org.acme.second
```

I actually bumped into this because of the AspectJ compiler. You probably remember that AJC is a (regularly refreshed) ECJ fork, hence affected indirectly, see https://github.com/eclipse-aspectj/aspectj/issues/119. Therefore, implementing this in order to be compatible with Javac would not only enable ECJ users to do the same things as Javac users from the console or from Maven, but also benefit the AspectJ project as a side effect.

See https://github.com/eclipse/org.aspectj/issues/118#issuecomment-1019051812 and the linked ZIP archive, if you need an example project with two modules to play with.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.