问题
I am facing following scenario:
- Win XP Machine, 2003 SP, jre7
- No admin rights to even set class path via my computer properties
- CMD prompt shows a local drive as user drive instead of C
- Thus unable to execute following command:-
c:\program files\Java\jre7\bin
It says C:\program files isn't recognized as an internal or external command.
- Tried to change directry to C but not successful
What I want:
- To be able to compile and run java files from CMD prompt
- Setting up path from CMD
I hope it ia not too much to expect in such an unreasonably restricted development environment.
回答1:
Ok, you can try this
set PATH="C:\Program Files\Java(YOUR JDK FOLDER) eg. jdk1.5.0_14\bin";%PATH%
so enter set PATH="C:\Program Files\Java\jdk1.5.0_14\bin";%PATH% but make sure it matches your JDK install folder.
If you need anymore help please let me know.
来源:https://stackoverflow.com/questions/22368388/how-to-run-java-when-c-drive-is-not-the-default-in-cmd-prompt