• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1656
  • Last Modified:

package javabook does not exist- error in JCreator

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
LeftHandedPants
Asked:
LeftHandedPants
  • 3
  • 2
  • 2
  • +1
3 Solutions
 
DrWarezzCommented:
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
 
sudhakar_koundinyaCommented:
>>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
 
petmagdyCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sudhakar_koundinyaCommented:
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
 
LeftHandedPantsAuthor Commented:
thank you VERY MUCH!  You have made me very happy for the moment.
0
 
sudhakar_koundinyaCommented:
Thanks

Glad, I helped you :-)

0
 
DrWarezzCommented:
Thank You :-)
0
 
petmagdyCommented:
welcome man
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now