繼入門AWS SDK的Java教程,運行AwsConsoleApp
示例:AWS SDK的Java教程示例中缺少類
java -cp .:/Users/marius/Dev/aws-java-sdk-1.3.8/lib/aws-java-sdk-1.3.8.jar AwsConsoleApp
我得到了以下問題:
===========================================
Welcome to the AWS Java SDK!
===========================================
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.amazonaws.util.VersionInfoUtils.<clinit>(VersionInfoUtils.java:41)
at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:31)
at com.amazonaws.services.ec2.AmazonEC2Client.<init>(AmazonEC2Client.java:95)
at AwsConsoleApp.init(AwsConsoleApp.java:93)
at AwsConsoleApp.main(AwsConsoleApp.java:105)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 5 more
在編譯時加載到類路徑中的完整SDK也在運行時給出,所以我無法弄清楚缺少什麼。