The Artima Developer Community
Sponsored Link

Java Answers Forum
OSX, Java, Packages.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Kevin Muldoon

Posts: 1
Nickname: kmuldoon
Registered: Jan, 2003

OSX, Java, Packages. Posted: Jan 7, 2003 3:55 PM
Reply to this message Reply
Advertisement
I'm attempting to be a good newbie java programmer and going through the excellent 'Teach Yourself Java 2 in 21 Days' by Rogers Cadenhead & Laura Lemay. Looks great. Ran into a problem on day 6 when it came to making a package.

I'm running Mac OSX (latest version) using java version 1.3.1.

Step 1). Compiled this code. http://www.cadenhead.org/book/java21days/source/chapter6/Item.java. Works fine and I placed the class file inside a folder structure like this '/com/prefect/ecommerce/'.

Step 2) Noticing that a CLASSPATH environment var doesn't exist under OSX, I discovered that it's equivalent is '/Library/Java/Extentions/' so I placed the package there.

Step 3) Attempted to compile this file http://www.cadenhead.org/book/java21days/source/chapter6/Storefront.java and things don't work so well.

javac complains that the object named Item (contained in the Item.class) can't be recognized. Heres the full report from my Terminal application.

>>Kevin-Muldoons-Computer:~/Java/storefront] kmuldoon% javac Storefront.java
Storefront.java:14: cannot resolve symbol
symbol : class Item
location: class com.prefect.ecommerce.Storefront
public Item getItem(int i) {
^
Storefront.java:9: cannot resolve symbol
symbol : class Item
location: class com.prefect.ecommerce.Storefront
Item it = new Item(id, name, price, quant);
^
Storefront.java:9: cannot resolve symbol
symbol : class Item
location: class com.prefect.ecommerce.Storefront
Item it = new Item(id, name, price, quant);
^
Storefront.java:15: cannot resolve symbol
symbol : class Item
location: class com.prefect.ecommerce.Storefront
return (Item)catalog.get(i);
^
4 errors

Topic: Printing JSP output on client's printer Previous Topic   Next Topic Topic: Strike!!!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use