fix NPE and Out of memory bugs
remove java classes from resources