I am not really sure if I am using the right java terminology here, but here is what I want to do. I basically have some code working in a single directory. I want to reorganize them. Some previous threads suggested that package and import may be the answers. There were some missing details so I did not quite understand how the process work.
Here is my directory hiearchy.
/myDir/myProject
/myDir/myProject/common
/mydir/myProject/feature1
The feature1 requires stuff in common.
1) Do I compile the code in common and put it in a jar file or is there some other mechanism to build the package ?
2) Is there anything that I need to add to the actual *.java file to indicate it is a package ?
3) Where do I need to place this jar file ?
4) In feature1 files, how do I import the common code ? For example,
import myDir.myProject.common.JARFILE; // will this work or do have to specify
// these actual component