Fixed classpath to export libraries and dependencies and fixed build errors when name contains spaces.