package org.netbeans.lib.awtextra does not exist - help!

programmed2live used Ask the Experts™
When I compile the code in NetBeans IDE then it compiles and the program runs fine...but when I compile it in Textpad (text editor) then I get this message:

C:\Documents and Settings\Sonu\.netbeans\3.5\sampledir\ package org.netbeans.lib.awtextra does not exist
        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 0, 0));
1 error

Tool completed with exit code 1

I am using J2SDK.

PLease reply ASAP.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

If you need to use the NetBEans package you have to set your classpath to the netbeans package. Or you can remove the second parameter and the program should compile fine.


I am sorry I am sort of new to Java (well configuring that is) and I can't do without AbsoluteConstraints so I can't chop off the second parameter.

I have installed Java and NetBeans to C:\Program Files\j2sdk_nb

I am using Windows XP and looked in "Enviornmental Variables" and could not find CLASSPATH.

If I create CLASSPATH then where do I point it to? e.g. ("C:\Program Files\j2sdk_nb" or "C:\Program Files\j2sdk_nb\netbeans3.5")?

And how? e.g. .; or %CLASSPATH%

I searched all over the net and found different answers and none of em worked...maybe cause of my lack of education. So please enlighten me.

You need to add the classpath which contains the folder "org". Depending on where you got Netbeans from this may reside in a different directory. If you installed the Java SDK cobundle it should be placed in "C:\Program Files\j2sdk_nb\netbeans3.5.1\sources\org\netbeans\lib\awtextra". So basically you need to add the
"Your_Netbeans_Directory\sources\" to your classpath. Compile the two .java files within the awtextra folder and dont forget to restart your command prompt after you set the environment variables, if you are running windows. It took me awhile to track those files down myself, but this solved the problem I was having, and it sounds like you are having the same issue. I hope this helps
Distinguished Expert 2018

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to JPeffer99

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial