设置环境变量后找不到 javac [英] javac not found after set environment variable

查看:39
本文介绍了设置环境变量后找不到 javac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 机器上运行.

I am running on a Windows 7 machine.

我安装了 Java jdk 1.7.

I installed Java jdk 1.7.

我已将 Path 和 PATH 环境变量设置为指向 Java jdk 1.7/bin 目录.

I have set the Path and PATH environment variable to point to the Java jdk 1.7/bin directory.

在命令提示符下执行 java -version 会生成 Java 版本 1.7.0_45.

Executing java -version in the command prompt yields Java version 1.7.0_45.

但是当我执行 javac 时它说:

However when I execute javac it says that:

javac 不被识别为内部或外部命令

javac is not recognized as an internal or external command

我真的被这个问题难住了.所有其他线程似乎都通过更改环境变量解决了类似的问题,但这并不能解决我在这种情况下的问题.

I am really stumped on this problem. All other threads seem to get similar issues resolved via changing the environment variable but this is not solving my problem in this situation.

当我在 Console2 中运行 java -version 时,它说当前使用的 Java 版本是 1.6,我不知道为什么会这样.

When I run java -version in Console2 it says that the currently used version of Java is 1.6 and I am not sure why this is the case.

推荐答案

不确定是否是这个原因,但在您发布的路径中

Not sure if this is the cause, but in the path you posted

C:Program FilesJavajdk1.7.0_45 in

C:Program FilesJavajdk1.7.0_45 in

jdk1.7.0_45"和in"之间好像多了一个空格

Looks like an extra space in between of "jdk1.7.0_45" and "in"

附加;"总是好的最后.

Also it's always good to append ";" at the end.

PATH = C:Program FilesJavajdk1.7.0_45in;

PATH = C:Program FilesJavajdk1.7.0_45in;

这篇关于设置环境变量后找不到 javac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆