javac cannot be run, and furthermore does not seem installed

前端 未结 4 1265
野性不改
野性不改 2020-12-11 03:11

I have a problem involving setting up Java.

I have installed the JRE, added its path to PATH, and set JAVA_HOME and CLASSPATH.

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 04:00

    In order to use javac in cmd , JDK must be installed in your system...

    javac will not work if you are pointing "bin" folder inside JRE (C:\Program Files\Java**jre7**\bin)

    Please check for javac.exe inside your bin folder(C:\Program Files\Java**jdk1.7.0_45**\bin)

    javac.exe must be inside JDK(C:\Program Files\Java\jdk1.7.0_45\bin) not inside JRE (C:\Program Files (x86)\Java\jre7\bin) "JRE doesn't come with a compiler. It is simply a java runtime environment. What you need is the developmental kit." in order to use compiler javac

    For javac path(Points to remember while setting system env variable)

    path = C:\Program Files (x86)\Java\jre7\bin this is wrong

    path = C:\Program Files\Java\jdk1.7.0_45\bin this is correct

    Make sure "javac.exe" must be inside your "C:\Program Files\Java\jdk1.7.0_45\bin"

    Dont confuse with JRE and JDK both are totally different

    if you dont have JDK pls download from this link http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

    reference thread for JDK VS JRE What is the difference between JDK and JRE?

    Procedure:-

    1. Install JDK

    2. open cmd prompt

    3. type "cd C:\Program Files\Java\jdk1.7.0_45\bin " press enter(path may change based on jdk version and 32bit and 64bit os version)

    4. type "javac" press enter

    its done

    Now go and change your system environment variable path = C:\Program Files\Java\jdk1.7.0_45\bin

    this will set the path permanently

提交回复
热议问题