Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » "The import org cannot be resolved" Eclipse LWJGL 2(Error message when trying to import pretty much any file into java project)
"The import org cannot be resolved" Eclipse LWJGL 2 [message #1796374] Thu, 11 October 2018 22:02 Go to next message
Aden Power is currently offline Aden PowerFriend
Messages: 1
Registered: October 2018
Junior Member
I'm trying to work my way through ThinMatrix's Open Gl Java tutorial.
And... I'm stuck on video 1. I also worked through the short precursor video
where he installed on the dependencies (Including lwjgl 2) in eclipse. Right now I just have the very start of the first class:

package renderEngine;
import org.lwjgl.opengl.Display; //Error is here
import org.lwjgl.opengl.DisplayMode; //And here
//Handle the window
public class DisplayManager {
    //Create a display
    public static void createDisplay() {
        Display.setDisplayMode(new DisplayMode());
    }
}



I receive the error, "The import org cannot be resolved". Even though I've added the files to the build path config and I've added the native path in there as well. I've looked at a similar question on StackOverflow called "Eclipse error: "The import XXX cannot be resolved" and effectively tried every proposed solution. I've also tried deleting the project and reinstalling the dependencies. I've attached my file tree for reference.

index.php/fa/34048/0/

I've discovered something interesting concerning the line:

Display.setDisplayMode(new DisplayMode());

While both Display and DisplayMode are underlined in red because the import is not working above, one of the "quick fixes" that comes up (even if I delete the import statements) is:

"Import 'Display' (org.lwjgl.opengl)"

Clicking this writes the import statement at the top (if it isn't there) or brings the cursor to it (if it is there). It then throws the aforementioned error. This seems to indicate that it does actually recognize the fact that the libraries are there, but for some reason can't import them.

To check whether the problem is specifically to do with compatibility with lwjgl2 I've tried importing a class from another library (a linear algebra library called "jblas") with:

import org.jblas.Info;


...but once again I receive the same error. I guess this indicates that the problem is with the way that I am adding the scripts to the build path, with the software itself or a combination thereof.

To clarify how I put things on the build path:

Right click project name -> click "build path" -> click "configure build path" -> click "libraries" -> click on eiether "module path" or "class path" (I've tried both) -> click "add jars" -> navigate to my "lib" folder -> go inside "jars" folder -> select all the jars -> click "apply and close".


I'd be highly grateful if you could show me what I've done wrong. Thanks so much.
Re: "The import org cannot be resolved" Eclipse LWJGL 2 [message #1796460 is a reply to message #1796374] Sat, 13 October 2018 19:26 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
One thing looks funny: are your jars located (nested) inside a source folder?
What happens if you pull folder lib up into the root of the project?
Previous Topic: What is the role of I*Binding in Eclipse JDT?
Next Topic:Is it possible to change standard Java Editor with a plug-in
Goto Forum:
  


Current Time: Fri May 24 10:30:59 GMT 2024

Powered by FUDForum. Page generated in 0.03772 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top