【问题标题】:Vertx failing to compile external librariesVertx 无法编译外部库
【发布时间】:2016-11-20 07:29:24
【问题描述】:

我正在使用 IntelliJ 作为我的 IDE 构建一个 vertx 服务器,并且我的项目在那里构建得很好。但是,当我尝试从终端运行我的服务器时,由于以下编译错误而失败,我不确定原因。它在没有来自终端的 aws 依赖的情况下编译并运行得非常好,而且我已经在 IntelliJ 内部测试了这些库正在被检测到。对于这个问题,我将不胜感激!

/ExampleProject/src/main/java/Server/Server.java:4: error: package com.amazonaws.auth.profile does not exist
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
                                 ^ 
java.lang.RuntimeException: Compilation failed
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:120)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)
Caused by: java.lang.RuntimeException: Compilation failed!
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:117)
    ... 21 more
Failed in deploying verticle 
java.lang.RuntimeException: Compilation failed
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:120)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)
Caused by: java.lang.RuntimeException: Compilation failed!
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:117)
    ... 21 more

java.lang.RuntimeException: Compilation failed
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:120)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)
Caused by: java.lang.RuntimeException: Compilation failed!
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:117)
    ... 21 more

【问题讨论】:

  • 确保您的 pom.xml 中有 com.amazonaws 依赖项。刷新项目,再次清理构建并尝试。

标签: java amazon-web-services intellij-idea compilation vert.x


【解决方案1】:

您需要将 .jar 文件添加到类路径中。这篇文章对我很有帮助:Adding to the classpath on OSX

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-30
    • 2016-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-19
    • 2016-07-08
    • 1970-01-01
    相关资源
    最近更新 更多