wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes how to compile a code with package  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to compile a code with package  " Watch "how to compile a code with package  " New topic
Author

how to compile a code with package

eric lee
Ranch Hand

Joined: Nov 04, 2002
Posts: 86
my cal.java inside C:\java\com\ibm\store
my control.java in C:\java
control.java import cal.java
when i type javac control.java, it shows error:
-----------------------------------------------
control.java:6: package com.ibm.store does not exist import com.ibm.store.cal;
------------------------------------------------
how to solve it? thanks
Jon Dornback
Ranch Hand

Joined: Apr 24, 2002
Posts: 137
here are some things to check:
have you compiled the com.ibm.store package? if not, you should be in the directory above com (c:\java in this case) and type at the command prompt:
javac com/ibm/store/*.java
is the package in your class path? type in the command:
set
and that will display all your environment variables. see if the current directory is in the classpath variable. if not, add it in.
Jon
Originally posted by eric lee:
my cal.java inside C:\java\com\ibm\store
my control.java in C:\java
control.java import cal.java
when i type javac control.java, it shows error:
-----------------------------------------------
control.java:6: package com.ibm.store does not exist import com.ibm.store.cal;
------------------------------------------------
how to solve it? thanks


use the [CODE] tags - it makes it much easier for people to help you.
eric lee
Ranch Hand

Joined: Nov 04, 2002
Posts: 86
thanks,Jon Dornback . i got it
 
 
subject: how to compile a code with package