从Java开始
所以我尝试从 Java 开始(例如,尝试让该死的东西接受代码)。我从 Java 等下载了所有需要的东西(SDK),但是当我必须在命令提示符中执行“javac”来编译记事本文件时,我只是收到消息说没有命令称为“javac”。
有人想分享一些见解吗?
So I am trying to start with Java (as in, trying to get the dang thing to accept code). I download all the needed things (the SDK) from Java and such, but when it gets to the point where I have to do "javac" in Command Prompt to compile the notepad file, I just get the message saying that there is no command called "javac".
Anybody wanna share some insight?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
设置环境变量 PATH: http://www.java.com/en/下载/help/path.xml。
我还建议使用 IDE,例如 netbeans 或 日食。它们使 Java 入门变得更加容易,而且当进入具有许多类的高级项目时,它们也有很大帮助。
To set the environment variable PATH: http://www.java.com/en/download/help/path.xml.
Also I recommend using an IDE such as netbeans or eclipse. They make it much easier when starting off in java, plus when getting into advanced projects with many classes, they help greatly.
您需要设置 java 编译器的路径,以便在使用命令提示符时找到它。 本页介绍了操作方法。
You need to set the path to your java compiler for it to be found when you use the command prompt. This page explains how.
我建议设置以下环境变量:,
JAVA_HOME
指向 java 安装的根目录,例如C:\Program Files\Java
,而不是将以下内容附加到您的
>PATH
环境变量:;%JAVA_HOME%\bin
您将能够从命令行使用
java
和javac
。如果您不熟悉,另请参阅 Microsoft 的这篇文章,了解如何设置环境变量它。
I would suggest setting the following environment variable:,
JAVA_HOME
to point to the root of your java installation e.g.C:\Program Files\Java
than append the following to your
PATH
environment variable:;%JAVA_HOME%\bin
than you will be able to use
java
andjavac
from the command line.Also see this article from Microsoft on setting environment variables if your not familiar with it.
您需要将 Java bin 目录(javac.exe 所在的位置,假设您使用的是 Windows)添加到系统 PATH 中。
右键单击“我的电脑”,进入环境变量,将安装Java的bin目录添加到PATH变量中。
You need to add the Java bin directory (where javac.exe is located, assuming you're on Windows), to your system PATH.
Right click on "My Computer", go to Environment Variables, and add the bin directory where Java is installed to your PATH variable.
您的路径上需要有 java bin 目录。因此,在 Windows 上,如果安装在 c:\java,并且 bin 是 c:\java\bin(通常你有版本号、jre 与 sdk 等),则需要将其添加到 PATH 环境变量中。 set PATH=c:\java\bin;%PATH% —— 您可以在 setlocal/endlocal 块中执行此操作,或者为您的计算机永久设置它。
另外,JRE 可能没有 javac——您可能需要下载 SDK。
You will need to have the java bin directory on your path. So, on windows, if installed at c:\java, and bin is c:\java\bin (normally you have version number, jre vs sdk, etc), you will need to add that to your PATH environment variable. set PATH=c:\java\bin;%PATH% -- you could do this in a setlocal/endlocal block or set it permanatly for your machine.
Also, the JRE may not have javac -- you may need to dowload the SDK.
通过在命令行中输入“javac”来从 java 开始,满足了我母亲对短语“从...开始”的定义……例如,
“不要从我开始,伙计。”
你的鼻子很可能会被打一拳。
为了您自己的理智,请选择 Eclipse、NetBeans、IntelliJ 或其他流行 IDE 之一,然后从那里开始。
Starting with java by typing 'javac' at the command line satisfy my mother's definition of the phrase 'starting with' ... as in,
"Don't start with me, buddy."
You are likely to end up with a punch in the nose.
For your own sanity, pick one of Eclipse, or NetBeans, or IntelliJ, or the other popular IDEs, and start from there.