Search code examples
javajarmicronaut

Can we load any external jar file to micronaut project ,


I try load htmlunit jar files to micronaut project , set class path correctly but IntelliJ can not resolve the classes ,

However I can import the same jar files successfully to grails 4 project

Note : I use amazon corretto version 11


Solution

  • There is not enough information in the question to know for sure what is wrong. One possibility is that the dependency has been added in your build file (maven or gradle) and the IDE is out of date and not sync'd with what is in the build file.

    Can we load any external jar file to micronaut project

    Yes. In fact, there is no such thing as a Micronaut project that does not do that.

    I try load htmlunit jar files to micronaut project , set class path correctly but IntelliJ can not resolve the classes

    If the CLASSPATH is set correctly, then IntelliJ will be able to resolve the classes. If IntelliJ can't, I think that means the CLASSPATH is not setup correctly.