Running through command prompt( Possibly Path error?)

后端 未结 2 1264
自闭症患者
自闭症患者 2021-01-26 10:42

I have a problem when compiling my code from Notepad++ when i compile example( javac StudentApp.java). It does not compile but instead i get this error code - \"is not recognise

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-26 11:29

    First be sure you have installed JDK , but not the JRE (jre comes without the javac).

    Here's how you can the JAVA_HOME\bin to your path (in case you have installed JDK):

    for /f  "delims=" %j in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.6" /v JavaHome') do @set jreg=%j
    set jreg=%jreg:    JavaHome    REG_SZ    =%
    setx PATH "%jreg%\bin";%PATH%
    

提交回复
热议问题