When using packages, you must call your compiler from a directory in the root hierarchy of packages (in your case ~).
So go up one directory and call javac like this:
javac TestPackage/Derived_class.java
Then compilation should work. For execution, you will then use:
java TestPackage.Derived_class
(but your class does not have any main method yet.)
: ? javac , , . Derived_class TestPackage.TestClass, TestPackage/TestClass.java ( .class) ( , ). , TestPackage.
-
javac -cp .. Derived_class.java
javac . '-d', . javac -help JDK .
, , , javac .