Alex
Alex

Reputation: 1

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?

Upvotes: 0

Views: 1029

Answers (1)

TheMrMilchmann
TheMrMilchmann

Reputation: 46

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.

Upvotes: 2

Related Questions