如何在 Windows 上的 Atom 中编译和 运行 Java 类?
How can I compile and run Java classes in Atom on Windows?
在 Linux 中很容易在终端中编译和 运行 Java 文件:
$ javac App.java
$ java App
有没有办法在 Windows 中专门在 Atom 编辑器中执行此操作?
我下载了 platformio-ide-terminal
包,它打开了一个终端,但是当我 运行 javac App.java
它给我这个错误:
javac : The term 'javac' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1
+ javac App
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (javac:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果我可以 运行 Windows 中的 java 代码而无需 IDE 且无需进入虚拟机中的 Linux ,那将会很有帮助或双启动,因为我们必须使用命令行 运行 并为我们的第一学期 CS 课程编译 java。
这不是 Atom 的问题。您的 JDK 安装不正确。 JDK 不在 Windows PATH 上,因此找不到 javac
。
运行 安装程序让它为您修复 PATH,或者 manually add the JDK to the PATH yourself。
在 Linux 中很容易在终端中编译和 运行 Java 文件:
$ javac App.java
$ java App
有没有办法在 Windows 中专门在 Atom 编辑器中执行此操作?
我下载了 platformio-ide-terminal
包,它打开了一个终端,但是当我 运行 javac App.java
它给我这个错误:
javac : The term 'javac' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1
+ javac App
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (javac:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果我可以 运行 Windows 中的 java 代码而无需 IDE 且无需进入虚拟机中的 Linux ,那将会很有帮助或双启动,因为我们必须使用命令行 运行 并为我们的第一学期 CS 课程编译 java。
这不是 Atom 的问题。您的 JDK 安装不正确。 JDK 不在 Windows PATH 上,因此找不到 javac
。
运行 安装程序让它为您修复 PATH,或者 manually add the JDK to the PATH yourself。