CrazyEngineers
  • how to run a java file using command prompt?

    Rits rishi

    Member

    Updated: Oct 26, 2024
    Views: 6.1K
    guys plz tell me the answer...
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Anoop Kumar

    MemberMay 21, 2012

    see this:
    #-Link-Snipped-#
    Are you sure? This action cannot be undone.
    Cancel
  • nareshkumar6539

    MemberMay 21, 2012

    First you need to compile the java program by using the following command
    javac filename
    for executing below command is used
    java classname
    if u r java file name Demo.java and classname is Demo
    for compiling javac Demo.java
    for executing java Demo
    Note: before that you need to set class path
    Are you sure? This action cannot be undone.
    Cancel
  • kamba giri

    MemberMay 23, 2012

    first of all you need to set class path in environment variables
    1.goto my computer-> system properties -> advanced system settings -> environment variables.
    2. in the environment variables menu in the first box you need to set the path of the java i.e., jdk path
    ex:- .;C:\Program Files (x86)\Java\jdk1.6.0\bin;
    and then okk..
    3. now you can compile and execute the java program as mentioned by nareshkumar..
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register