Solved

package javabook does not exist- error in JCreator

Posted on 2004-10-31
1,552 Views
Last Modified: 2013-12-14
I am creating a program with JCreator.  The program code is mostly irrelevant to my question here, which is:  Upon compiling I get only 2 errors: 1) "package javabook does not exist" and 2) "cannot access MainWindow" ... what do i need to do to get this thing to compile correctly?  I know i need to do something with some sort of javabook.zip or javabook.jar file.  However i only have the latter in my knowing posession.  What's a jar file and what do i do with it?  I have "import javabook.*;" at the begginning of the code for the class.  

The basic code for what my program is is (most importantly) here: http://www.messiah.edu/acdept/depthome/mathsci/csc1812004-2005/Lab4/JavaProgs/BMIExample/Step4/BMICalculator.txt
and here: http://www.messiah.edu/acdept/depthome/mathsci/csc1812004-2005/Lab4/JavaProgs/BMIExample/Step4/BMICalculatorMain.txt

This whole instanciable class stuff very confusing, so hopefully that has nothing to do with this error.
ANY advice/teaching asap is greatly appreciated!  Thanks
0
Question by:LeftHandedPants
    8 Comments
     
    LVL 9

    Assisted Solution

    by:DrWarezz
    Have you added the JAR file to the CLASSPATH variable?

    If not:
    R-Click 'My Computer' > Select 'Properties' > select the "Advanced" tab > click "Environment Variables" > Double click the "CLASSPATH" variable (under SYSTEM VARIABLES) > add this line to the END of it:

    ;c:\directory\filename.jar

    (you need to include the semicolon (;) at the start of the line, and obviously, change the path to where ever the JAR file is).

    Also, the PACKAGE here, is it within the correct folder, which is in the same DIR as the Java file you're trying to compile here?

    gL,
    [r.D]
    0
     
    LVL 14

    Expert Comment

    by:sudhakar_koundinya
    >>import javabook.*

    Is Javabook package is Jar File??

    If so, Check if this Jar file is added in JCreator's class path

    Regards
    Sudhakar
    0
     
    LVL 13

    Accepted Solution

    by:
    download the javabook package from:

    http://www.drcaffeine.com/files/javabookEd3.zip

    and define a new library containing this jar in ur JCreator project libraries
    0
     
    LVL 14

    Assisted Solution

    by:sudhakar_koundinya
    To add  your Javabook package here is the procedure

    1. Choose Project Settings from the Project menu.
    2. The Project Settings dialogue box will be displayed.  
    3. Select the tab ' Required Libraries '
    4. Click on New and the Set Library dialgue box will be displayed
    5. Click on the Add button to insert a path or package file.
    6. Name the library and press the OK button.
    7. The new library will now appear in the list.
    8. Click on the checkbox and you will see that the paths of the library are added to the classpath.
    9.  Click on the OK button to save the project settings.

    Regards
    Sudhakar
    0
     

    Author Comment

    by:LeftHandedPants
    thank you VERY MUCH!  You have made me very happy for the moment.
    0
     
    LVL 14

    Expert Comment

    by:sudhakar_koundinya
    Thanks

    Glad, I helped you :-)

    0
     
    LVL 9

    Expert Comment

    by:DrWarezz
    Thank You :-)
    0
     
    LVL 13

    Expert Comment

    by:petmagdy
    welcome man
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to implement Singleton Design Pattern in Java.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    909 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now