import error

How do I configure my borland jbuilder ide so i dont get
an error on the line: import java.awt.*; .

What is java.awt.* (a package , a library) and
in what file is it contained?

The error is:
...Error #:750...LoadError...class not found: class java.lang.Object


  • I need to see more code to diagnose.

    [color=Blue]java.awt[/color] is a package that contains classes. A * will import all the classes in the package rather than a named class.

    I believe that the java packages and classes are in the file [color=Blue]C:Program FilesJavajdk1.6.0_16jrelib
    t.jar[/color] , assuming you installed the same version of java as me and accepted the file placement during installation. I don't think this is important to you.

    What you will/may need to set is a system variable, the path variable. It is found in Control Panel, System (program), Advanced tab, Environment Variables button, System variables entry. It needs to be edited rather than created. In my path variable value the string, [color=Blue]C:Program FilesJavajdk1.6.0_13in;
    [/color], is included.

    Check out this link, [code][/code]

  • I just instaled it and created a project in a most simple way:
    And I got some default code and it wont compile
    because it cant import.

    I get these errors bellow the project pane:
    Cannot access directory javalang at line 1
    Cannot access directory javaawtevent at line 4
    ....and so on

    Here is the code:

    package untitled1;

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;






    Copyright: Copyright (c) 2009



    * @author not attributable
    * @version 1.0

    public class Frame1 extends JFrame {
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();

    //Construct the frame
    public Frame1() {
    try {
    catch(Exception e) {
    //Component initialization
    private void jbInit() throws Exception {
    contentPane = (JPanel) this.getContentPane();
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
  • I added this method to your class and the program ran fine in my IDE, NetBeans,

    [code] public static void main(String[] args) {
    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new Frame1().setVisible(true);

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!