Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to compile a code with package

 
eric lee
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
eric lee
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,Jon Dornback . i got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic