Error with simple Application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Error with simple Application

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    Error with simple Application

    This is a my program.

    import javabook.*;
    class MyFirstApplication
    {
    public static void main(String args[])
    {
    MainWindow mainWindow;
    mainWindow= new MainWindow();
    mainWindow.show();
    }
    }
    When I complie it with message error:
    C:\>javac MyFirstApplication.java
    MyFirstApplication.java:1: package javabook does not exist
    import javabook.*;
    ^
    MyFirstApplication.java:6: cannot resolve symbol
    symbol : class MainWindow
    location: class MyFirstApplication
    MainWindow mainWindow;
    ^
    MyFirstApplication.java:7: cannot resolve symbol
    symbol : class MainWindow
    location: class MyFirstApplication
    mainWindow= new MainWindow();
    ^
    3 errors
    Who help me to repair this program. Thanks

  2. #2
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    Looks like you need to tell the compiler where the javabook package is located.This is done by the classpath option on the javac command or you can set the CLASSPATH global environment variable.

Similar Threads

  1. Replies: 2
    Last Post: 09-26-2005, 12:35 PM
  2. Replies: 4
    Last Post: 11-30-2001, 05:13 AM
  3. Application that grows
    By Tariq in forum Java
    Replies: 0
    Last Post: 11-21-2001, 02:21 PM
  4. Replies: 3
    Last Post: 01-26-2001, 03:22 PM
  5. Replies: 1
    Last Post: 01-26-2001, 05:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center