Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Ivor Horton's Beginning Java, Java 7 Edition
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Java, Java 7 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java, Java 7 Edition by Ivor Horton ; ISBN: 978-0-470-40414-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Java, Java 7 Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old December 26th, 2011, 03:04 AM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Dec 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default Pg 210 Example: Testing the Geometry Package


I successfully compiled the Geometry Package. and when i typed out the code as shown in the book, my IDE flags errors in importing the Geometry package.

The screenshot of my IDE, the error, and the Geometry package files is shown:

I'm not sure what went wrong. Please help. Thanks


I tried the method of creating a Geometry.jar from the Geometry package and Copy-Paste Geometry.jar into my jdk1.7.0 hierachy (guide on page 198) and the resulting TryPackage.java file is able to compile and run properly. I guess this is one way to get things done.

However, the IDE still flags the same 'Package Geometry does not exist' error. I'm interested to solve this.

Last edited by xiao_mao_mimi; December 26th, 2011 at 04:23 AM.
Reply With Quote
  #2 (permalink)  
Old April 24th, 2012, 12:25 PM
Authorized User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default Here's what I discovered...

First of all, I have been doing stuff using Windows Notepad and the DOS command line editor so I didn't have the same problem with the IDE (Netbeans) flagging the import statements. I installed Netbeans today and then had the same thing going on as you did. The way I fixed this was to create a project (I don't know how to not create one, or if it's even possible to not create one), clicked on the Source Packages icon (in the Projects tree view window at the left of the Netbeans GUI) with my mouse, right clicked, selected New then Java Package. I named it Geometry. Then I created the Point and Line source files in THIS package instead of in the Default package (which is where I originally created them) and deleted the original ones. I think it was at this point that the flagging of the import statement went away (probably after saving them or maybe it was after compiling the package).

After that, I created the TryPackage source file in the Default package (just so it was in a different place than the others, just to make things a little more complicated), compiled TryPackage, ran it, and it all worked. I also ran TryPackage in the DOS command line using the -classpath option with my own paths (see page 210) and it worked too.

One thing I can say is that, using Notepad and the DOS command line, and knowing exactly what directories all the files are in is helpful (at least to me so far while I'm learning this stuff) because, as the book says, IDE's can hide a lot of background things that are going on (like where files and packages are).

Trying to figure out the answer to your question was a good exercise for me because I was very cloudy on all the stuff I just did until I did it. Things are clearer now that I have worked on this.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page 210:Page object calling a private method from BasePage? aperture8 BOOK: Beginning ASP.NET 4 : in C# and VB 6 August 9th, 2010 07:04 AM
Page 210 Try it out. flapjack BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 May 1st, 2010 03:23 AM
Chapter 5 - Try It Out: Pages 208-210 Wyatt70 BOOK: Beginning XML 3rd Edition 5 November 22nd, 2006 05:54 AM
HowtoRun package from .asp from Package Store? Tom de Koning BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 June 21st, 2006 08:08 AM
don't run my package when i schedule package Isra2005 SQL Server DTS 1 May 17th, 2005 01:34 AM

All times are GMT -4. The time now is 08:28 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.