Yes you have to do -cp, otherwise java wont know where to look for your classes.
When you compile a package, you should make sure that you have the right structure:
That means that your structure would be:
|-src
|-com
|-example
|-Test.java
|-Other.java
so when you compile, you would cd to the src folder, and type
javac com.example.Test.java