Question:

How to run Java script on command prompt and how to create class using command prompt?

by  |  earlier

0 LIKES UnLike

Why is it when I run my java script using JCreator, the print out appear in the box below in JCreator and not in command prompt? How can I make it pop up on command prompt window?

Another question is I try to compile my HelloWorld.java using command prompt,

javac HelloWorld.java

but it won't work. By right it should create a HelloWorld.class. But it keep giving me error message saying it's not recognise command.

 Tags:

   Report

1 ANSWERS


  1. You have a problem with you path environment variable. The path env variable should point to the JDK bin directory.

    --------------------------------------

    In your C:\Program Files\Java\jdk1.6.0_07\bin you should have the javac.exe. In your environment variables>user variables you should have a PATH variable that should have the paths to different directories and files. This PATH variable should also point to C:\Program Files\Java\jdk1.6.0_07\bin;

    Once you have this in place, OPEN UP A NEW command prompt and try to run javac. In some cases you have to restart your computer to make the changes effective.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.