Reputation: 15
how do I add an existing class into an existing project. I've got the file "Something.class" and in the code I do a
something window = new Something();
But it remains underlined in red. Does someone know how do I fix this?
Thanks!!
Upvotes: 0
Views: 7824
Reputation: 11
Also note, that Java is case sensitive. So in
something window = new Something();
something and Something are two different classes :)
Upvotes: 1
Reputation: 41117
You need to add the jar file that has the class something
to your project and import it your class.
Upvotes: 0
Reputation: 200
If it's not already part of your workspace, it should be enough just to File -> Import and then find the class you want included. If it's already part of the workspace, then Tommi's suggestion should do it.
Upvotes: 1
Reputation: 8608
You need to import the class into the referencing class. Ctrl + Space (while highlighting the classname) should do the trick in Eclipse.
Upvotes: 0