Already imported the jar files in netbeans but my source cannot find the library
I also had problem with importing classes from imported jar. It was so damn annoying...
There are couple solutions @ web, (clear cache in user's AppData. or make sure to add jar's properly - by using "Add Jar/Folder..." option) but none of them worked for me.
What worked was new project and importing THE SAME (that's sad) jar files into it. So I had 2 project with exactly the same contents, but only one of them was working (compiling).
EDIT: However, your problem is not related to mine. Root cause of your issue is the jar itself.
It contains class files in default package that is making them impossible to import.
Read here how to import class from default (unnamed) package.
jax
Updated on June 04, 2022Comments
-
jax almost 2 years
I already imported the jar files in netbeans but my main java file still cannot find the methods. I am using netbeans 7.3.1 on Mac. Does anyone know how make it work?
Thank you,
-
jax over 10 yearsI am new to java environment. I added the stdlib.jar from project properties -> libraries ->compile -> add jar folder. For instance there is a StdIn.java in that library. I tried to import it using
import StdIn.java;
and it tells me StdIn.java does not exist. -
dantuch over 10 years@arashaga try with
import StdIn;
-
dantuch over 10 yearswhere you get that jar from?
-
Scott Barta over 10 yearsPutting jar files inside your Java installation is a bad idea.
-
user3217883 almost 7 yearsWhat worked for me was to close NetBeans and re-open it.