我正在尝试使用Maven和VSC使用包含的LWJGL库来构建我的项目,但是我不知道它是如何工作的。
我一直在寻找http://wiki.lwjgl.org/wiki/Setting_Up_LWJGL_with_Maven.html,但是控制台在说我,它不知道我正在使用什么方法...
我正在尝试从https://www.lwjgl.org/guide构建示例。有用于蚂蚁构建系统的仓库,但是我必须使用Maven。请帮我适应它。
UPD
我从帖子中给出的链接复制了pom.xml后,出现以下错误:
> Executing task: mvn -B verify <
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for myProject:myGame:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 62, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] --------------------------< myProject:myGame >--------------------------
[INFO] Building myGame 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from slick: http://slick.cokeandcode.com/mavenrepo/slick/slick/274/slick-274.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.873 s
[INFO] Finished at: 2018-09-09T03:13:22+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myGame: Could not resolve dependencies for project myProject:myGame:jar:1.0-SNAPSHOT: Failed to collect dependencies at slick:slick:jar:274: Failed to read artifact descriptor for slick:slick:jar:274: Could not transfer artifact slick:slick:pom:274 from/to slick (http://slick.cokeandcode.com/mavenrepo): slick.cokeandcode.com: Unknown host slick.cokeandcode.com -> [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/DependencyResolutionException
在我删除了每节之后。其中包含“ Slick”(因为lwjgl.org/guide的测试示例中未使用它),Maven成功构建了项目。但是我仍然无法运行项目。我输入java *myclass*
并得到
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problems:
> Version cannot be resolved
> The method glfwFreeCallbacks(long) is undefined for the type Main
> The method glfwDestroyWindow(long) is undefined for the type Main
> The method glfwTerminate() is undefined for the type Main
> The method glfwSetErrorCallback(null) is undefined for the type Main
>
> at game.Main.run(Main.java:36)
> at game.Main.main(Main.java:128)