HelloWorldApp

I was doing the HelloWorldApp. and I can't switch to the c:\java> when I typed the command it says c:\java is not recognized as an internal or external command, operable program or batch file. What do I do?
Message was edited by:
2tone3

> I was doing the HelloWorldApp. and I can't switch to
the c:\java> when I typed the command it says c:\java
is not recognized as an internal or external command,
operable program or batch file. What do I do?
You need to set your path.
Read this: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
and/or: http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm
Good luck.

Similar Messages

  • Could not find the main class : HelloWorldApp program will exit

    please help me
    i downloaded and installed jdk-6u13-windows-i586-p(1) from sun.java.com
    in my computer --> Advanced --> environment variables --> i had set
    user variable :
    variable value
    java_home C:\Program Files\Java\jdk1.6.0_13\bin
    System variable:
    path : C:\Program Files\Java\jdk1.6.0_13\bin
    after that i wrote a program
    * The HelloWorldApp class implements an application that
    * simply prints "Hello World!" to standard output.
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); // Display the string.
    i saved in c:\ mywork
    i compiled it with
    javac HelloWorldApp.java and then
    java HelloWorldApp
    output / result also came
    but iam unable to create jar file . when it is created it is showing
    could not find the main class : HelloWorldApp program will exit
    i created jar file by following way
    i created
    manifest.txt
    Min-Class : HelloWorldApp and then
    start -->run--> cmd-->
    c:\mywork> jar cfm test.jar manifest.txt HelloWorldApp.class
    c:\ java -jar test.jar
    but it displays a message
    " could not find the main class : HelloWorldApp program will exit "
    please please please help me please 1000's of please help me

    Peter__Lawrey wrote:
    You have to specify the manifest with a special option (I think its was -M)
    Otherwise the jar will create one (even if you provide it)No, the text file passed as a parameter will be incorporated in the manifest file generated by the JAR tool.
    @OP: This will work:
    JarTest.java
    public class JarTest {
      public static void main(String[] args) {
        System.out.println("JarTest works!");
    }manifest.txt
    Main-Class: JarTest+(note there is an extra new line in the manifest.txt!)+
    Now execute these commands:
    javac JarTest.java
    jar cfm MyJar.jar manifest.txt JarTest.class
    java -jar MyJar.jar And on my machine, the string "JarTest works!" is displayed on the screen.
    And if you look in the MANIFEST.MF file inside your jar file (you can use almost any zip-utility for this), you will see the following:
    Manifest-Version: 1.0
    Created-By: 1.6.0_0 (Sun Microsystems Inc.)
    Main-Class: JarTestOr something similar.

  • Se development kit (jdk 6) problem creating class file with HelloWorldApp

    I downloaded the java SE Development kit (JDK 6) with Java FX SDK and used the download manager from Java web site, the program downloaded the
    jdk-6u13-javafx-1_1_1-windows-i586 icon to my desktop and the java program to
    C\Program Files\Java\jdk1.6.0_13
         Jre1.5.0_05
         Jre1.6.0_03
         Jre6
    I then created a Java source file which was HelloWorldApp.java. and typed in the Hello World Code as requested I saved it to
    C\Documents and Settings\Compaq_owner\Java.
    Then I try to compile my source file into a .class file and get stuck as I am told to open a command window which I do through, start\allprograms\accessories\command promt.
    My command window says C:\Documents and Setting\Compaq_Owner>
    I am told to compile my source file and I must change my directory in the command window to the directory where my file is located.
    I type after the existing promt, cd C:\java and also tried, cd C:\Documents and Settings\Compaq_Owner\Java\HelloWorldApp. And was told both times the system cannot find the path specified
    I typed dir after the promt and can see the java directory there in the list, but have I placed my HelloWorldApp File in the wrong place what is wrong please help I cannot get off the ground
    Kind regards pete

    petefizz wrote:
    I then created a Java source file which was HelloWorldApp.java. and typed in the Hello World Code as requested I saved it to
    C\Documents and Settings\Compaq_owner\Java.Then the full path to your HelloWorldApp.java file is: C\Documents and Settings\Compaq_owner\Java\HelloWorldApp.java.
    Then I try to compile my source file into a .class file and get stuck as I am told to open a command window which I do through, start\allprograms\accessories\command promt.
    My command window says C:\Documents and Setting\Compaq_Owner>
    I am told to compile my source file and I must change my directory in the command window to the directory where my file is located. You file is located in the directory, C\Documents and Settings\Compaq_owner\Java
    I type after the existing promt, cd C:\java and also tried, cd C:\Documents and Settings\Compaq_Owner\Java\HelloWorldApp. And was told both times the system cannot find the path specifiedcd stands for Change Directory. You want to change to the directory where your .java file is. You can not use a path that ends in a file because a file is not a directory.
    You may need to put C\Documents and Settings\Compaq_owner\Java inside double quotes, "C\Documents and Settings\Compaq_owner\Java" I think newer versions of Windows will not require the double quotes.

  • Error: cannot read HelloworldApp.java

    Hello
    When I compile the HelloWorldApp.java program. I have this problem:
    I get: error: cannot read HelloworldApp.java. What can I do?
    In addition, How do I use the options? For example:
    javac -g HelloworldApp.java
    I get an error saying that I did not use well the flag g. Is the command bad written?.

    You post has different capitalization of the program name:
    ". . .compile the HelloWorldApp.java program. I have this problem:
    I get: error: cannot read HelloworldApp.java.
    Java is case-sensitive, make sure to capitalize correctly.
    Open a cmd/command window in the directory that contains your .java file and do a "dir helloworldapp.java" command to verify the file exists with the correct name.
    Read the documentation for the javac command to learn how to use the command options.

  • "Error:cannot read:HelloWorldApp.java" message

    As the caption says,after finding the file I want to compile and start compiling there is the message shown in the subject.Any help would have been valuable...The program is the HelloWorldApp

    The error means that the javac compiler can not read the file you specified. Some common reasons are:
    1. The file is actually named HelloWorldApp.java.txt instead of HelloWorldApp.java To check this, use the command prompt dir command. Do not use a Windows folder view because Windows might hide the .txt. Programs like Notepad will add .txt to the end of the file name unless you put "" around the file name.
    2. You did not specify the right path to the file.

  • Java HelloWorldApp: Error java.lang.NoClassDefFoundError

    Hi,
    Kindly anyone help me when i am trying to execute in $ prompt:java HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    Caused by: java.lang.ClassNotFoundException: HelloWorldApp
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
    Any help will be needful for me

    user598986 wrote:
    Hi,
    Kindly anyone help me when i am trying to execute in $ prompt:java HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    Caused by: java.lang.ClassNotFoundException: HelloWorldApp
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
    Any help will be needful for meSorry but it's not a Java forum. If you have any question related with JDBC, then post your question unde [SQLJ/JDBC forum|http://forums.oracle.com/forums/forum.jspa?forumID=99]

  • Class names, 'HelloWorldApp.java.exe' are only accepted if annotation -----

    {font:#mce_temp_font#}Class names, 'HelloWorldApp.java.exe', are only accepted if annotation processing is explicitly requested.
    1error
    In continuation to reply "All you should be doing is accessing the .exe files in/bin. That means adding that directly to your PATH so that the os------to find the .exe files.
    I,d recommend-------DOS file path convention"(e.g. "C\Progra~1\Java\jdk1.6.0\bin")------
    Question: May i ask you -there are so many .exe files under the folder
    "C\Progra~1\Java\jdk1.6.0\bin" such as
    java.exe, jar.exe, appletviewer.exe -------etc Which files are you refering to?
    Suppose, java.exe is the correct file, if ENTER on following command
    in Command Prompt
    C:\Progra~1\Java\jdk1.6.0\bin\javac HelloWorldApp.java.exe
    (Here, My file name>>HelloWorldApp)
    i get Clas names, 'HelloWorldApp.java.exe', are only accepted if annotation processing is explicitly requested.
    1error
    Am i proceeding in the correct way? If correct, what to do next?
    damp{font}

    Work through the Tutorial:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Your source file is called
        HelloWorld.javaIn the directory containing thes file you compile with
        javac -cp . HelloWorld.javaAnd run with
        java -cp . HelloWorldThere is no ".exe" anywhere.

  • Error with HelloWorldApp.Java

    cannot read: HelloWorldApp.java from the tutorial. I use a string to get to the javac file and i still get the message. The file is a notepad file.

    Not sure what your problem is. Maybe this will help.
    1)Copy and paste the HelloWorldApp example code into notepad.
    2)Save the file as HelloWorldApp.java (not HelloWorldApp.txt or HelloWorldApp.java.txt)
    3) make sure you have the JDK from sun.com installed.
    4) Open a command prompt window to the directory where you saved the file.
    5) Compile the file by typing javac HelloWorldApp.java (you may have to add javac.exe to your path or type in the fullpath, e.g. c:\jdk1.4\bin\javac.exe HelloWorldApp.java)
    6) run the example by typing java HelloWorldApp at the same prompt. (again you may have to add java.exe to your path or type in the full path)

  • Beginners errors with HelloWorldApp

    Would much appreciate any help. Getting the following errors which I can't get to grips with.
    Written a basic beginners java text-the HelloWorldApp.java, saved in c:\Java. In there is also bin\javac.exe.
    When I type java\javac HelloWorldApp.java, get the error 'javac'is not recognizable.
    When I move a copy of javac.exe to the same file as HelloWorldApp.java, I get the error java.lang.NoClassDefFoundError:
    Tried also\jsdk1.4.1\bin\javac HelloWorldApp.java, but cannot find path...
    I have java2 sdk1.4.1, have followed the troubleshooters on the java.sun page but still cant get to grips with the prob.
    Thanks

    first of all, you shouldn't be playing around inside the bin folder and you shouldn't have moved javac.exe at all. it's an executable which compiles your java code. the problem you're having is that you haven't set your PATH. depending on your OS is how you would set it. assuming you're using winXP, you would go into System Properties, Advanced, Environment Variables and make the necessary modification. eg.Under "User variables for XXX" you would select "new" and type PATH under "variable name". Under "variable value" you would something like this "C:\j2sdk1.4.1_02\bin". you ok all this, and when you go back to your command console, if you type javac you will not get an unrecognised batch command or whatever the error is.
    you rally need to read the above links though before you ask anymore questions. the instructions are very straightforward and you wont get better answers here than what you get there.

  • Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

    I have set the path, classpath and also compiled the HelloWorldApp.java file and my main is public static void main.
    public class HelloWorldApp
    public static void main(String[] args)
    // Display "Hello World!"
    System.out.println("Hello World!");
    I still get this error
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

    For better understanding:
    I have set the classpath in the autoexec.bat following:
    set CLASSPATH="C:\TEST;.;";
    and I have a userdefined class in c:\jdk1.3.1_01\jre\lib\ext\myclass.jar
    compiling works, but when I run the program in c:\TEST\Hello.java I get the java.lang.NoClassDefFoundError Message.
    My source code looks like this:
    import myclass.*;
    public class Hello extends MyClass{
         public static void main(String[] args)     {
              System.out.println("Hello");

  • HelloWorldApp throws Exception in Main

    Hi folks,
    Can some one help me to get this working. It compiles fine but when i run using the
    java HelloWorldApp
    it throws this error
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    the program i am trying to run is
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); //Display the string.
    Thanks
    pavan

    Perhaps:
    mkdir c:\java\classes
    javac -d c:\java\classes YourClass.java
    That'll put the output classes in the classes directory, which is cleaner anyway, rather than keeping them with your source.
    Then set your classpath to include c:\java\classes

  • HelloWorldApp - Exception in thread "main" ...

    the following program saved as c:\windows\desktop\java\HelloWorldApp.java gives the following error when run from the command line as:
    java HelloWorldApp
    Exception in thread "main" java.lang.NoClassDefFoundError:helloworldapp
    I have added C:\PROGRA~1\Java\j2re1.4.0_01\lib to the path in autoexec.bat. That did not work so I tried c:\progra~1\java\j2re1.4.0_01\bin. Again, the same error. Any suggestions would be greatly appreciated from a new (1st day) java wannabe.
    Thanks in advance,
    Kev

    Hi Kev...
    I think... you better understand about Java Compiler and JVM ...The exception that is arising is that is JVM is unable to search your HelloWorldApp main class..... I think .....you should make these changes in your Autoexec.bat file .......
    Path=%Path%;c:\j2skd1.4.0_01\bin
    Set classPath=c:\windows\desktop
    Doskey
    Then restart your computer or simply run autoexec.bat file ...
    you compile your program by this command...
    javac HelloWorldApp.java
    then Run your Program
    java HelloWorldApp
    you have to care about case sensitive ......
    I think ... It will help you .... best Regards
    ARSHOO

  • Help with HelloWorldApp

    // i have HelloWorldApp prog on the c disk
    then i entered the command
    C:\> .\j2sdk1.4.2\bin\javac HelloWorldApp.java
    //no problems
    //then i entered
    C:\> c:\ javac HelloWorldApp.java
    //class is created
    //then i entered
    c:\ java HeyWorld
    //no errors but no output could you please help

    Try giving your class the same name as your file. Call the class HelloWorldApp. Then, after you compile, you should just be able to type in
    C:\java HelloWorldApp

  • Problem running HelloWorldApp

    Hi! I had just installed the j2sdk1.4.2 this morning and was trying to run the program HelloWorldApp. I managed to create 'HelloWorldApp.java' using NotePad (exactly copied from Java Tutorial) and compile it successfully. But when trying to run it, system display the following error:
    Exception in thread "main" java.lang.NoClassDefFoundErr: HelloWorldApp
    Any help will be appreciated!

    Confirm that class was created for HelloWorldApp, it is stored in c:\j2sdk1.4.2_04\
    Does it matter if I try to compile the program this way
    c:\j2sdk1.4.2_04\bin>javac c:\j2sdk1.4.2_04\HelloWorldApp.java
    and run the program like this
    c:\j2sdk1.4.2_04>java c:\j2sdk1.4.2_04\HelloWorldApp

  • Need help with HelloWorldApp

    I am trying to run the HelloWorldApp tutorial. After typing in the javac command I get an error message that reads:
    "error: cannot read: HelloWorldApp.java
    1 error"
    Please tell me what this means. I have done a minimal bit of programming many years ago so I do know to check for absolute accuracy. I cut and pasted the program from the tutorial page and then checked that there were no extra spaces before or after. I can find no errors or differences in the program. Thanks for your help.
    Here is the program as copied:
    * The HelloWorldApp class implements an application that
    * simply displays "Hello World!" to the standard output.
    class HelloWorldApp {
    public static void main(String[] args) {
    //Display "Hello World!"
    System.out.println("Hello World!");
    }

    >
    No, do question it. You should not be putting your
    code in the /bin directory.
    If you open a command shell and type "java -version",
    what happens? If you see the version of Java you
    have installed, that's good. If you see an error
    message that says it can't find java.exe, then you
    have to add the Java /bin directory to your PATH (NOT
    CLASSPATH) so the OS can find javac.exe and
    java.exe.
    %Fortunately, it shows the version of Java that I have. However, the tutorial explained about putting the Java\bin directory in the PATH so that it could find the javac without being in that directory but as you saw it would not run the javac from the Java directory without being in the bin subdirectory and it would not find the HelloWorldApp.java if that file was not in the same directory. I know I don't know everything here but I know enough that I typed in the command you gave me EXACTLY as you gave it to me. Could you explain the problem?

Maybe you are looking for

  • Error while adding conditions in Imports PO

    Dear Sir, We want add Freight charges and Custom Clearing Charges in Imports PO as Misc. Charges in condition ZMIS. But we try to add these as 3 % it gives following error Provision account key missing for condition type ZMIS in schema ZHILI1 Message

  • Executing a procedure in ADF model

    Dear All, I have created a new fusion web application in ADF, in that i have created a custom entity class that overrides doDML method. This is because i have to perform the insert, update and delete via stored procedure. But the problem is that i am

  • Where can i get a copy to OS X lion Server?

    I can't upgrade to OS X Mountain Lion because i really need to use a piece of software that does not work with Mountain Lion but i also need to get OS X Server. When i try and get it from the mac app store it says i need mountain lion. Where could i

  • Osb 10.3 sync async bridge

    Hello guys, For a client I need to bridge a synchronous client call to a asynchronous business server. The OSB manual briefly mentions it is possible in 2 lines: "In sync-async bridging, a synchronous client issues a request to an asynchronous provid

  • Editing online

    Hi, I have seen a similar question, but I am not sure if that's the answer I was looking for. We have purchased a subscription online and the person who purchased it said they read something about being able to edit PDFs that have been uploaded onto