Reputation: 13
folder
|-com
|- horstmann
|- corejava
|- Employee.java
|- Employee.class
|- PackageTest
|- PackageTest.java
|- PackageTest.class
There is my program's structure. Two files, one small class(Employee) and PackageTest which is basically just main function to test class Employee. In PackageTest.java there is line:
import com.horstmann.corejava.*;
And in Employee.java there is line:
package com.horstmann.corejava;
In terminal I'm sitting in folder and trying to test the program after successfully compiling it with:
javac com/PackageTest/PackageTest.java
Sadly after :
java com.PackageTest.PackageTest
I get error from the title. I'm not sure if it's necessary to post PackageTest.java and Employee.java there. They're really basic classes just to learn how to make package and import them .
Upvotes: 0
Views: 93