简体   繁体   中英

How do I use LWJGL 2 in Intellij instead of LWJGL 3?

I'm making a Minecraft mod in Itellij that relies on org.lwjgl.input code. That library was removed from LWJGL 3, so I have to use LWJGL 2 instead. I added the correct LWJGL 2 jar files to my dependencies and libraries and no errors show in my code. However, when I compile, I get this error:

error: package org.lwjgl.input does not exist

import org.lwjgl.input.Keyboard;

I already tried rebuilding, cleaning, deleting the .idea folder, invalidating the cache, and deleting all of the LWJGL 3 libraries. Am I missing a step?

LWJGL3 is a major upgrade over (the now deprecated and unsupported) LWJGL2. Several higher level APIs such as the org.lwjgl.input package have been removed in favor of low-level bindings to native APIs that can be used by applications. Using LWJGL3 and LWJGL2 on the same classpath is not a proper solution to retrieve old behavior. (Since the input APIs are fairly tightly integrated into the windowing code and LWJGL2 and LWJGL3 are not designed to be used together, it is unlikely to work at all.) Instead, I highly recommend to update your mod to use an input API exposed either by Minecraft itself or by the modding framework you are using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM