我只是结帐这个项目https://github.com/tjeerdnet/OneDriveAPI
我的目标是运行它。
所以我在java项目中添加了eclipse Kepler。
然后,我将我的项目更改为maven项目(因为我看到有一个pom.xml)
我将其作为Maven构建,目标是“安装”
控制台显示一堆编译错误,如下所示:
[INFO] ------------------------------------------------------------------------
[INFO] Building OneDriveAPI 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ OneDriveAPI ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ OneDriveAPI ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 22 source files to C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[3,38] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:3: package com.fasterxml.jackson.databind does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[4,33] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:4: package com.sun.jersey.api.client does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[5,33] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:5: package com.sun.jersey.api.client does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[6,33] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:6: package com.sun.jersey.api.client does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[7,32] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:7: package com.sun.jersey.core.util does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[12,17] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:12: package org.slf4j does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[13,17] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:13: package org.slf4j does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[15,24] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:15: package javax.ws.rs.core does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[16,24] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:16: package javax.ws.rs.core does not exist
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[20,26] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:20: cannot find symbol
symbol : class Logger
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[30,13] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:30: cannot find symbol
symbol : class Client
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[39,25] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:39: cannot find symbol
symbol : class Client
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[54,28] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:54: cannot find symbol
symbol : class MultivaluedMap
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[77,36] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:77: cannot find symbol
symbol : class MultivaluedMap
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[77,12] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:77: cannot find symbol
symbol : class ClientResponse
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[91,12] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:91: cannot find symbol
symbol : class ClientResponse
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[104,29] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:104: cannot find symbol
symbol : class MultivaluedMap
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[124,29] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:124: cannot find symbol
symbol : class MultivaluedMap
location: class net.tjeerd.onedrive.core.OneDriveCore
[ERROR] /C:/Grafica Specifiche/IntegrareOneDrive/OneDriveAPI/trunk/src/main/java/net/tjeerd/onedrive/core/OneDriveCore.java:[147,28] C:\Grafica Specifiche\IntegrareOneDrive\OneDriveAPI\trunk\src\main\java\net\tjeerd\onedrive\core\OneDriveCore.java:147: cannot find symbol
symbol : class MultivaluedMap
location: class net.tjeerd.onedrive.core.OneDriveCore
...
[ERROR] symbol : class MultivaluedMapImpl
[ERROR] location: class net.tjeerd.onedrive.core.OneDrive
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
然后我运行我的服务器并从我的控制台中获取这些错误日志:
java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
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)
Exception in thread "main"
我做了什么错了?
我对maven和JEE很新,很抱歉这个noob问题
答案 0 :(得分:0)
我也有一些类似的事情。问题在于java版本。确保在编写应用程序的系统中安装了相同的Java版本(主要版本和次要版本)。