aspose file tools*
The moose likes Beginning Java and the fly likes How to make package and import it into another class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to make package and import it into another class" Watch "How to make package and import it into another class" New topic
Author

How to make package and import it into another class

vinay javaranch
Greenhorn

Joined: Jul 01, 2012
Posts: 2
BeerExpert


BeerSelect



while compiling the BeerExpert they compile with no error..and package is build
so, i want to import the package into the Beerselect but it shows the compilation error


package com.example.model does not exit import com.example.model.*;

so, any one who solve the above problem
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Try:

Also ensure that the package/path; com/example/model is in your classpath or buildpath (Eclipse)

WP
vinay javaranch
Greenhorn

Joined: Jul 01, 2012
Posts: 2
i had done this already but found same compile error
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14352
    
  22

Make sure that the base directory of the package com.example.model is in the classpath.

(Please check your private messages).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11480
    
  16

vinay javaranch wrote:i had done this already but found same compile error

"some compile error" really doesn't tell us much of anything. The compile error actually has quite a lot of info in it, telling you exactly what is wrong. Please copy and post the entire message here if you want someone to help you. Otherwise, the best we could do would be to make random guesses as to the issue, which is really a waste of everyone's time.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
And also please tell us where that code comes from.
 
wood burning stoves
 
subject: How to make package and import it into another class