Troubleshooting Build Issues

strong.valid.simple Application Configuration

>> A range of sample applications are available as a separate project, andhow-samples. Starting with the simple example is a great starting point for trying out AndHow.

General Build Advice

AndHow is know to compile with JDK 8 and current Maven versions (see the Workstation setup page for details). If you are having issues with a build in an IDE, verify that the build works in Maven from command line:

java -version [should report some version of 1.8]

mvn clean test

If that works, the issue is with the IDE setup.

Snapshots and Releases of AndHow are build with JDK8, however, AndHow does build successfully with JDK 1.8 - 15 (maybe 16 as well?). The pom.xml files specify the source and target to be 1.8, however, not all IDEs respect this. If using a JDK other than 1.8 in an IDE, it may be more reliable to also set the language level to the same as your JDK, i.e. If using JDK 15 to compile, also specify the language level in your IDE to 15.

Issues with IntelliJ

IntelliJ is great, but it really does not do with with Maven based projects. If you are getting weird javac errors, here are some things to try.

  • In Preferences | Build, Execution, Deployment | Compiler | Java Compiler

    • Ensure the selected compiler is javac

    • Ensure the Use ''--relase' option is not selected. In theory this setting would help fix compile issues, but it may be causing issues for AndHow. See Issue 630.

    • Verify that no special settings are listed for any over the AndHow modules (two places on the page)

  • In File | Project Structure | Project

    • Verify the Project SKD and language level is set to 1.8 / 8

  • In File | Project Structure | Modules

    • Ensure each module is set to language level 8
      I think IntelliJ tries to guess what the source and target versions are and gets it wrong because the annotation-processor modules have some profile logic to determine this.

If all else fails with IntelliJ, it helps to just check the project out fresh and reload it in IntelliJ. This drops all existing preferences for the the project and often fixes things.

Issues running the andhow-samples project locally from locally compiled AndHow

If you are developing AndHow, making local builds and then trying to run the samples project from a snapshot of that build, problems can happen if the JDK used to build AndHow is newer than the JDK used to build the samples. The safest is to build AndHow with JDK 8, then any JDK can be used to build and run the samples. Otherwise, the JDK used to build AndHow must be the same version or older as the JDK used to build the samples.