0

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

8
  • 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. Commented Apr 14, 2017 at 15:56
  • Please read some tutorials. javac compiles the code it doesnot run the code Commented Apr 14, 2017 at 15:56
  • Thanks very much.... I works Commented Apr 14, 2017 at 16:05
  • Please is ther a way to complie and run it at once? Commented Apr 14, 2017 at 16:07
  • @Bizi no, Java is both compiled and interpreted. Commented Apr 14, 2017 at 16:13

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.