Results 1 to 7 of 7
  1. #1
    thelukestir is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default 'cmd' is not recognized as an internal or external command

    Hi i am trying to use some tutorials online to learn the basics of java but i cant seem to get anything to work :( this is the tut im using now codelords.net/mambo3/content/view/26/39/1/0/ Part 2: Getting started - The Tutorial Den[/url] but once i get to page 3 and i try to run cmdline.bat it gives me this error:'cmd' is not recognized as an internal or external command, operable program or batch file then it says press any key to continue .... help? i think it may be somehting about me editing my path variables... i cant seem to get those right :(
    Last edited by thelukestir; 07-29-2008 at 01:20 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,558
    Rep Power
    25

    Default

    You need to show the command that you are entering. Copy the full text of the console here.
    What OS are you on?

  3. #3
    thelukestir is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default

    i have done this so far
    i put this into a notepad document and saved as Jackpot.java

    class Jackpot
    {
    public static void main(String[] args)
    {
    System.out.println("Welcome to Jackpot3000!");
    }
    }

    then put this into a notepad and saved as cmdline.bat

    cmd
    pause

    then i run cmd.bat and the error message opens... im running Windows XP Professional

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,558
    Rep Power
    25

    Default

    Copy the full text of the console here.
    What are you expecting to happen?
    What you've typed above is very confusing.
    How is the Jackpot.java file involved in your project?
    If your create a batch file named cmdline.bat and then enter cmd.bat ??? Should you be entering: cmdline.bat instead?

    Here's what I see on a console on XP:
    C:\Temp>cmdline.bat

    C:\Temp>cmd
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

  5. #5
    thelukestir is offline Member
    Join Date
    Jul 2008
    Posts
    3
    Rep Power
    0

    Default

    i have a link to the tutorial in my first post but you have to copy + paste into browser... the issue is i cannot type anything into the command prompt because when i open it it comes up with this

    'cmd' is not recognized as an internal or external command, operable program or batch file then it says press any key to continue

    so i cannot enter any commands of any sort because if i type any key it will close the prompt.....

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,558
    Rep Power
    25

    Default

    What OS are you on?
    How are you opening the command prompt?

  7. #7
    Alan-LB's Avatar
    Alan-LB is offline Member
    Join Date
    Jun 2008
    Location
    Junee, NSW, Australia
    Posts
    19
    Rep Power
    0

    Default

    You will need to compile your first file - Jackpot.java.

    In Windows XP go to Start > All Programs > Accessories > Command Prompt. In this window you will need to type
    "javac Jackpot.java" (without the quotes) this will compile your source code into a Bytecode file called Jackpot.class

    Then type "java Jackpot" (without the quotes) to execute your program. After running your program type "exit" to close the Command Prompt window.

    You can also open the Command Prompt window by going Start > Run (or Windows key + R) and entering "cmd" (without the quotes) .

    Forget your cmdline.bat file. I think you need to learn what "command line" really means and how to use it. If your program doesn't compile or execute post the errors IN FULL here. You may need to know how to set your Path to point to the JDK directory.

    Alan
    There are 10 types of people - those who understand binary and those who don't!!
    Today is the Beta version of Tomorrow!!

Similar Threads

  1. Replies: 28
    Last Post: 10-26-2010, 04:39 AM
  2. Internal Frame order and canvas Z Index
    By dazza-s in forum New To Java
    Replies: 3
    Last Post: 05-29-2008, 06:20 AM
  3. Eclipse's internal Tomcat
    By vadimf in forum Eclipse
    Replies: 0
    Last Post: 02-14-2008, 09:37 AM
  4. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM
  5. an internal error occurred during refresh
    By christina in forum Eclipse
    Replies: 1
    Last Post: 08-06-2007, 09:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •