remove static state in JavaClassesFactory

@radumereuta please review