Error Package Java.awt Does Not Exist
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: Package ae.awt.java does not exist up vote 0 down vote favorite I've got code that requires the use of the Desktop import on Netbeans, I've downloaded the jar folder ae-awt.jar that contains the import to use. When i've added the import import ae.awt.java.Desktop the program allows me to use it and gives the suggested code after each period, however when I run the program I'm presented with the error "error: package ae.java.awt does not exist import ae.java.awt.Desktop;" I don't understand why this is not working as I have added the package to my libraries folder. Does anyone know how to fix this? Thank you java netbeans awt desktop share|improve this question edited Apr 3 '15 at 19:08 asked Apr 3 '15 at 18:31 Michael Rennison 34 import ae.awt.java.Desktop What the.. DYM import java.awt.Desktop? –Andrew Thompson Apr 4 '15 at 3:00 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote Maybe the jar is not in your classpath. Check if you have the jar in project properties > Libraries > Compile tab. Check also if the jar is specified in the classpath (click on the "Run Ant target" button under the "Repeate Run" button") share|improve this answer answered Apr 3 '15 at 19:21 Jordan Martin 7114 I don't appear to have a compile tab in libraries. All it shows is a checkbox asking "is library" and an empty list of referenced library projects. –Michael Rennison Apr 3 '15 at 19:47 So if you have nothing in this list consider to adding your jar here. –Jordan Martin Apr 3 '15 at 19:53 It's added in the list for the JAR Libraries tab but when I try to add it as a library in the libraries tab it doesn't let me select the folder to add, it just opens it. I thi
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just http://stackoverflow.com/questions/29437760/error-package-ae-awt-java-does-not-exist like you, helping each other. Join them; it only takes a minute: Sign up package classes does not exist error up vote 1 down vote favorite I have built my own custom AWT classes in my home folder in java_src/classes. Each of the java files contain the package classes; declaration at the top. I also created http://stackoverflow.com/questions/12793733/package-classes-does-not-exist-error a sample program called ScreenDemo.java and placed it in the java_src/ folder to use the custom AWT classes instead of java.awt. //ScreenDemo.java import classes.Screen; class ScreenDemo { public static void main(String args[]) { Screen.init(20,15,3); } } But when i attempt to compile ScreenDemo.java,an error is displayed java_src/ScreenDemo.java:1: package classes does not exist import classes.Screen; ^ java_src/ScreenDemo.java:6: cannot find symbol symbol : variable Screen location: class ScreenDemo Screen.init(20,15,3); ^ 2 errors When i add the path i encounter this error Exception in thread "main" java.lang.NoClassDefFoundError: ScreenSample (wrong name: classes/ScreenSample) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334) Could not find the main class: ScreenSample. Program will exit. java awt packages textfield share|improve this question edited Oct 11 '12 at 9:45 asked Oct 9 '12 at 6:05 Gambler 2926 How can i rectify this??? –Gambler Oct 9 '12 at 6:05 1 Add path till `java_src` where your p
This Site Careers Other all forums Forum: Beginning Java javax.awt.event does not exist!!! divya sharma Ranch Hand Posts: 87 https://coderanch.com/t/406074/java/java/javax-awt-event-exist posted 9 years ago Hello, I am running this program; import javax.swing.*; import javax.awt.event.*; public class SimpleGui1B implements ActionListener { JButton button; public static void http://forums.netbeans.org/post-51006.html main(String[] args) { SimpleGui1B gui = new SimpleGui1B(); gui.go(); } public void go() { JFrame frame = new JFrame(); button = new JButton("click me"); button.addActionListner(this); frame.getContantPane().add(button); error package frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300,300); frame.setVisible(true); } public void actionPerformed(ActionEvent event) { button.setText("I've been clicked"); } } While compiling error displayed E:\Java Program\Head First\ch12\SimpleGui1B.java:2: package javax.awt.event does not exist import javax.awt.event.*; Help me resolve it.Please let me know how to resolve it. Thanks Divya Divya Garrett Rowe Ranch Hand Posts: 1296 posted 9 error package java.awt years ago The compiler is correct, javax.awt.event really doesn't exist, you want java.awt.event. [ February 05, 2007: Message edited by: Garrett Rowe ] Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter divya sharma Ranch Hand Posts: 87 posted 9 years ago Thanks a lot to help me to find my silly mistake... thanks a lot. Divya Post Reply Bookmark Topic Watch Topic New Topic Similar Threads Cannot figure out what I forgot to set, or I set wrong, or forgot to install? Button's action event in Head first java code error Help With HeadFirst Java Chapter 12 page 360 understanding simple gui code All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton
& referenced, jar file exists, etc. Details abound in post! Feeling pretty lonely here! :-) NetBeans Forums -> Java EE Users View previous topic :: View next topic Author Message TallPaulJoined: 08 Oct 2009Posts: 5 Posted: Thu Oct 08, 2009 8:18 pm Post subject: "Package does not exist" yet Library added & referenced, jar file exists, etc. Details abound in post! Feeling pretty lonely here! :-) Hi, I swear I'm doing everything correctly (AFAIK), yet Netbeans is giving me a "package X does not exist" error. My About window: Product Version: NetBeans IDE 6.7.1 (Build 200907230233) Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\Documents and Settings\User1\.netbeans\6.7 I have a jar file I have placed as follows: C:\JavaClasses\GoldParserEngine\Bin\hawkins-java-jar-1.3.jar With the sources file here: C:\JavaClasses\GoldParserEngine\Source\hawkins-java-source-v1.3.zip In Netbeans, I added a Library named GoldParserEngine where the Classpath = C:\JavaClasses\GoldParserEngine\Bin\hawkins-java-jar-1.3.jar and the Sources = C:\JavaClasses\GoldParserEngine\Source\hawkins-java-source-v1.3.zip NOte: I did not compile this JAR file, but when I explode it all the Class file are there matching the source files, the class files have the package statement in them, and the package statement in the source files as well is: package goldengine.java; In the Properties of my Java Application, I clicked on Libraries and then under the Compile tab I added a reference to the GoldParserEngine Library. In the Main class of my Project, I start with the following lines: package AppelSample; import java.io.*; import goldengine.java.*; Yet I get an error that 'Package goldengine.java does not exist." What boneheaded thing am I doing wrong? Sorry, I'm a bit rusty on my Netbeans and Java... Thanks! PaulLast edited by TallPaul on Fri Oct 09, 2009 2:49 pm; edited 2 times in total Back to top TallPaulJoined: 08 Oct 2009Posts: 5 Posted: Thu Oct 08, 2009 8:32 pm Post subject: Oh, and here's another thing I thought weird. When I type in... import goldengine. ...Netbeans auto-completes and suggests adding the 'java' onto the end. If Netbeans has no idea where goldengine is, how did it know to auto-complete with 'java'? Lastly, in another project I have, under the Project-->Properties-->Library-->Compile tab,