javac cannot be run, and furthermore does not seem installed

前端 未结 4 1257
野性不改
野性不改 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 03:50

    First, you need to install the jdk, then add the path of bin folder of jdk in the path vaiable.

    you can refer to this link

    0 讨论(0)
  • 2020-12-11 03:53

    The JRE is merely the Java Runtime Environment, which includes only the infrastructure needed to run Java programs that are already compiled.

    To compile Java source code using javac, you need the Java Development Kit (JDK).

    On Oracle's Java download page, choose the package labelled "JDK".

    0 讨论(0)
  • 2020-12-11 03:58

    The JRE doesn't have javac - you need to download the JDK (Java Development Kit).

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题