简体   繁体   English

无法从命令行执行Java代码

[英]Can't execute a java code from command line

Hello my jdk is well installed in:D:\\java on my computer my path is : D:\\oracle\\product\\10.2.0\\db_1\\bin;%SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\apache-maven\\bin;C:\\Program Files (x86)\\apache-tomcat\\bin;C:\\Program Files (x86)\\Skype\\Phone\\;D:\\java\\bin;D:\\jboss-as-7.1.3.Final\\bin;C:\\Program Files\\TortoiseSVN\\bin;E:\\formation\\Essais\\Maven\\apache-maven-3.5.0-bin\\apache-maven-3.5.0\\bin 您好我的jdk很好地安装在计算机上的:D:\\ java中,我的路径是:D:\\ oracle \\ product \\ 10.2.0 \\ db_1 \\ bin;%SystemRoot%\\ system32;%SystemRoot%;%SystemRoot%\\ System32 \\ Wbem;%SYSTEMROOT%\\ System32 \\ WindowsPowerShell \\ v1.0 \\; C:\\ Program Files(x86)\\ apache-maven \\ bin; C:\\ Program Files(x86)\\ apache-tomcat \\ bin; C:\\ Program Files (x86)\\ Skype \\ Phone \\; D:\\ java \\ bin; D:\\ jboss-as-7.1.3.Final \\ bin; C:\\ Program Files \\ TortoiseSVN \\ bin; E:\\ formation \\ Essais \\ Maven \\ Apache的行家-3.5.0-BIN \\ Apache的行家-3.5.0 \\ BIN

my Java_Home :D:\\java my little program is in :E:\\Zoo.java 我的Java_Home:D:\\ java我的小程序在:E:\\ Zoo.java

my program is completely: 我的程序是完全:

public class Zoo {
    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

in the command prompt i type this : javac Zoo.java 在命令提示符下,键入:javac Zoo.java

I don't get "Hello": please will like to know why and what to do 我没有收到“你好”:请想知道为什么以及该怎么做

Compile it with javac Zoo.java and run it with java Zoo . 使用javac Zoo.java编译,并使用java Zoo运行。 From the comments :- 从评论:

Please is there a way to compile and run it at once? 请问有没有一种方法可以立即编译并运行它?

No , Java is both compiled and interpreted. 不可以 ,Java既可以编译也可以解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM