How to run Java when C drive is not the default in CMD prompt? [closed]

二次信任 提交于 2020-01-17 16:35:13

问题


I am facing following scenario:

  1. Win XP Machine, 2003 SP, jre7
  2. No admin rights to even set class path via my computer properties
  3. CMD prompt shows a local drive as user drive instead of C
  4. 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.

  1. Tried to change directry to C but not successful

What I want:

  1. To be able to compile and run java files from CMD prompt
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!