It's a common problem since long filenames came into being. The command line interpreter breaks words on spaces so you have to enclose the entire path in double quotes. For example,
cd "\Program Files\Common Files\Java"
Note that the path is not case sensitive, so this also works:
cd "\program files\common files\java"