0
votes

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

my Java_Home :D:\java my little program is in :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

I don't get "Hello": please will like to know why and what to do

1
javac compiles your code, it doesn't run the compiled code. You should now have a Zoo.class in that same directory. If so, run java Zoo and it'll work. - yshavit
Please read some tutorials. javac compiles the code it doesnot run the code - Sanjeev
Thanks very much.... I works - Bizi
Please is ther a way to complie and run it at once? - Bizi
@Bizi no, Java is both compiled and interpreted. - dumbPotato21

1 Answers

0
votes

Compile it with javac Zoo.java and run it with java Zoo. From the comments :-

Please is there a way to compile and run it at once?

No, Java is both compiled and interpreted.