Can we load any external jar file to micronaut project ,

huangapple go评论71阅读模式
英文:

Can we load any external jar file to micronaut project ,

问题

我尝试将htmlunit的jar文件加载到Micronaut项目中,已正确设置类路径,但IntelliJ无法解析这些类。

然而,我可以成功地将相同的jar文件导入Grails 4项目中。

注意:我使用Amazon Corretto 11版本。

英文:

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

答案1

得分: 1

在问题中没有足够的信息确定出现了什么问题。其中一种可能性是该依赖项已添加到您的构建文件(Maven 或 Gradle),而IDE已过时并且未与构建文件中的内容同步。

> 我们可以向 Micronaut 项目加载任何外部 jar 文件吗?

可以。实际上,没有不这样做的 Micronaut 项目。

>
> 我尝试将 htmlunit jar 文件加载到 Micronaut 项目中,已经正确设置了类路径,但 IntelliJ 无法解析这些类。

如果类路径(CLASSPATH)设置正确,那么 IntelliJ 将能够解析这些类。如果 IntelliJ 不能解析,我认为这意味着类路径(CLASSPATH)没有正确设置。

英文:

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.

huangapple
  • 本文由 发表于 2020年10月14日 03:23:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/64341863.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定