Vertx无法编译外部库

时间:2016-11-20 07:29:25

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

我正在使用IntelliJ构建一个vertx服务器作为我的IDE,我的项目在那里构建良好。但是,当我尝试从终端运行我的服务器时由于以下编译错误而失败并且不确定原因。它编译并运行完美,没有来自终端的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

1 个答案:

答案 0 :(得分:0)

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