make it not crash on linux/windows

refactor "apple only" methods into a seperate class that is only loaded
if we are on a java system that has them