Skip to content

[MTOOLCHAINS-35] No javac in jdk toolchain should be an error #99

Open

Description

@jira-importer

Delany opened MTOOLCHAINS-35 and commented

If the selected jdk toolchain is configured to point to a JRE instead of a JDK, it should fail with an error. Instead there is a warning.

[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.

I'm assuming it falls back to whatever javac is available on the system?

Edited to indicate that this only applies to the jdk toolchain, not to all toolchains which might select other things like Eclipse versions that aren't even JDKs at all.


Affects: 3.0.0

Activity

  1. jira-importer commented on Feb 18, 2021

    @jira-importer
    Author

    Michael Osipov commented

    Regardless of the warning, does a toolchain always require a javac? What if the project does not compile anything? E.g., type pom.

  2. jira-importer commented on Feb 18, 2021

    @jira-importer
    Author

    Delany commented

    Ok. But then there should be an enforcer rule to catch this. https://issues.apache.org/jira/browse/MENFORCER-368

    Together they work to achieve a desired behavior (MBEHAVIOR anyone?). I still think this is an issue for the toolchain and not the enforcer.

  3. jira-importer commented on Feb 18, 2021

    @jira-importer
    Author

    Delany commented

    `Michael Osipov the toolchain type "jdk" should indeed always require a javac. Its not asking much

  4. jira-importer commented on Feb 18, 2021

    @jira-importer
    Author

    Delany commented

    I notice my reactor takes 20min when using the toolchain configured to use /usr/lib/jvm/java-8-openjdk-amd64/bin

    I use that same JDK normally and it takes 5min. Watching the logs, its slowing a lot at maven-compiler-plugin. What's it doing, starting a new JVM every time?

  5. jira-importer commented on Aug 27, 2021

    @jira-importer
    Author

    Delany commented

    I see today that the plugin doesn't even check that its a valid jdkhome, only that the directory exists. The first I know that I'm using the system javac (happens to be jdk8) is when it complains about the --release flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions