javac cannot be run, and furthermore does not seem installed

安稳与你 提交于 2019-11-28 12:14:59
Ken Liu

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".

TechDog

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

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

you need to install jdk and then after add the path of bin folder of jdk in the path vaiable.you can try the links [http://docs.oracle.com/javase/7/docs/webnotes/install][1]

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