Exception in thread “main” dropbox application

2019-09-04 05:33发布

问题:

I'm trying to make a simple application with Java, using Eclipse that could upload a file from my computer to Dropbox but whenever I compile, I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/conn/params/ConnPerRoute
    at javaaplication1.JavaApplication11.main(JavaApplication11.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.params.ConnPerRoute
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 1 more

Can you help me figure this out? Thank you in advance.

回答1:

You miss the httpclient.jar in your classpath. Download it and add it to your classpath.