[java] Only take off the type parameter when declaring native arrays of types with type parameter. Closes #3303
[java] Test -java-lib with obj folder as well; Properly collect all .class files inside a classpath. Closes #3296