Java wont open .class file

ok i just started at this and found this web site http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#1
i copyed exactly what he says to copy:
* The HelloWorldApp class implements an application that
* displays "Hello World!" to the standard output.
public class HelloWorldApp {
public static void main(String[] args) {
// Display "Hello World!"
System.out.println("Hello World!");
then put all that in notepad save it as "HelloWorldApp.java". i go to the msdos prompt type in javac HelloWorldApp.java it turns it in to a .class file and i type it
java HelloWorldApp and it gives me an error:
Exception in thread "main" java.lang.NoClassDefFoundError: helloworldapp (wrong
name: HelloWorldApp)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
What did I/He do wrong.

thanks it worked. can you tell my why?

Similar Messages

  • Win xp not opening class file.

    win xp not opening class file.
    Runtime.getRuntime().exec("cmd /C start c:/database/Myclass.class");
    or
    Runtime.getRuntime().exec("cmd /C c:/database/Myclass.class");
    is this code wrong for xp ?

    let me give some more information...
    i have c:\database
    in this folder i have 2 class...Myclass.class and Dbconnection.class
    Myclass simply uses the database connection from Dbconnection.class , nothing else.
    you see both of the classes are in the same folder(i.e c:\database) and there is no package
    statement inside the code .
    in command prompt if i do....
    c:\database\java Myclass // this works fine
    but i want this class to run at runtime, so i did like above and it is not running!!
    what i am getting is a irritating windows file chooser is poping up and saying "class not
    found...browse or search in web...etc etc"
    Now my question is >
    Q1 . how can i run that class at runtime ?
    N.B
    here is some brief idea abt classes
    Dbconnection.java
    DriverManager.forClass("...database....");
    // only for database connection
    Myclass.java
    Connection con =db.getConnection();
    //use this con and show results for ur database related queries.
    }Q2. Can u plz tell those correct syntax how to run class file in this situation ?
    i will try all possible solutions tomorrow.
    thanx.

  • Elements 13 wont open raw files from Nikon d750

    Elements 13 wont open raw files from Nikon d750 camera, wont update either from the help menu, any ideas what to do.

    carper
    According to Adobe document, you require installation of at least Camera Raw 8.7 for your Nikon 750 for your Photoshop Elements 13 and Premiere Elements 13.
    https://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    And, I believe based on the following that Photoshop Elements 13 Premiere Elements 13 ships with Camera Raw 8.6.
    https://helpx.adobe.com/x-productkb/global/camera-raw-compatible-applications.html
    Consequently, the solution appears to revolve around getting the Help Menu/Updates to work since there is no manual install of Camera Raw 8.7 for 13.
    Until the Premiere Elements update problem is resolved, you may have to resort to using the Nikon software. There is also the DNG 8.7 Converter
    which you can download from Adobe link, not requiring the Help Menu/Update as does Camera Raw 8.7.
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.7
    There have been several reports of Help Menu/Update failures. I have not seen a generalized solution. I can only offer the
    the typical "Does the problem exist with and without the antivirus and firewall(s) disabled?"
    ATR

  • Dreamweaver can't open .class files

    Using:
    Dreamweaver CS4 Version 10 Build 4117
    on Microsoft Vista Home Premium Service Pack 2
    I'm trying to edit Menalto PHP Gallery files via Dreamweaver. Some of Gallery's core php module files use the .class file extension. I want the following extensions to be treated as PHP files in Dreamewaver.
    phtml, class, cpt
    I added these extensions to the following files.
    C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS4\configuration\DocumentTypes\MMDocumentTypes.xml
    C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS4\configuration\Extensions.txt
    C:\Users\Me\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml
    C:\Users\Me\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration\Extensions.txt
    I set Vista to use Dreamweaver as the default program for opening .class files.
    I have restarted the computer.
    I can open up phtml and cpt files just fine.  However, when I try and open .class files, I get the error:
    Dreamweaver can't open .class files
    Please choose an HTML, XML, or other compatible file
    I used Dreamweaver to create a new file in the Dreamweaver file pannel.  I called the new file test.class and opened it up in notepad.  Dreamweaver is successfully pre-populating the test.class file with the default PHP template.
    So Dreamweaver is creating the test.class file using the default PHP template, but it still can't open .class files in Dreamweaver.
    I think this might be a reserved extension or something.  Anyone else had a similar problem?

    Hey, I gave up myself.  While I still use Dreamweaver for layout (HTML, images) work and for synching my website via SFTP, I don't code PHP in it anymore. Dreamweaver really isn't a PHP development IDE.  So, I do all my PHP work in something called NetBeans.  It is less user friendly but once you set it up... my goodness... is it great for coding PHP.  So Dreamweaver for visual stuff and HTML stuff.  NetBeans for PHP app development.  That's my suggestion.

  • Off topic... - Open .class file on double click

    Hi, I'm using windows and with the assoc and ftype commands in CMD i can make files open with a certain program and load some parameters. But I'd like to use the ftype command to open the file without the extension within.
    Here is my example:
    C:\Users\myUserName\Documents\Java>
    ftype JavaClassFile=C:\Program Files\Java\jdk1.6.0_01\bin\java.exe %*And then :
    C:\Users\Viktor\Documents\Java>Hi.class(same thing on double click)
    I get this error, wich is obvious:
    Exception in thread "main" java.lang.NoClassDefFoundError: C:\Users\Viktor\Docum
    ents\Java\Hi/classSo how can I make it open with java and leave out the .class extension in the filename?

    To be more accurate I'd like it to open
    java Hiinstead of
    java Hi.class

  • Opening Class Files

    When I try to open the file it says:
    "Exception in thread "main" java.lang.NoClassDefFoundError: ILoveJava\class".
    Could you please tell me what is wrong with this program. The file is here:
    This program displays "I Love Java!" to the standard output.
    class ILoveJava {
    public static void main(String[] args) {
    System.out.println("I Love Java!");
    }

    Looks to me like you typed something like
    java .... ILoveJava.class
    try
    java ... ILoveJava

  • Excel 2008 wont open excel files from at WHS network share.

    hi all
    i have a strange problem here, i own a mac mini the 2.53ghz model bought a month ago, and a macbook (the white model) also bought a month ago, both running all the latest software updates, and office 2008 for mac, with all the latest updates
    on the mac mini, i can´t open any excel documents that are stored on a shared folder on my windows home server, it just says
    excel cannot open this file the file might have been damaged or modified from its original format
    but when i try to open the same document on the macbook, it opens just fine?
    i have tried to remove office 2008 and reinstall it on the mac mini, but that didnt help, and the strange thing is if i move the excel files, from my windows home server, to another windows home server, it opens just fine on the mac mini
    i then suspected that it was the WHS that was ****** up, and deleted the account on the WHS where the folders were stored, rebooted the whs, and added the account again, but with the same result, the mac mini wont open the excel files, it will open word files, from the same folder.
    and the macbook will still open both excel and word files, from the same folder?
    i´m really confused now, and cant seem to pinpoint the error, and hope that someone can give me some pointers of where to look?
    sincerely
    Carsten Larsen
    Denmark

    You're pobably better off posting your question on Microsoft's own forums for their Mac products, as it's their software you're having issue with:
    http://www.officeformac.com/productforums

  • Java Concurrent Program .class file location

    Hi frnds,
    I need to know the .class file location of a java concurrent prog. I know the filename from concurrent program executables and my concurrent program filepath is oracle.apps.xxogl.f04.cp.file. But I dont know where the exact location of the file is. pls help me.
    I searched for the same and found the following article in many places which doesnt seem to help me much.
    http://geektalkin.blogspot.com/2008/03/oracle-apps-java-concurrent-program.html
    pls help. thanks in advance.
    Lisan

    Hi;
    pls file can be found like
    /apps_st/appl/bom/12.0.0/patch/115/sql/
    Contains SQL*Plus scripts used to upgrade data, and .pkh, .pkb, and .pls scripts to create PL /SQL stored procedures.
    Regard
    Helios

  • Identify Java version from CLASS file

    Hi,
    I have a .class file. I would like to identify the Java version from that.
    Is there a way to find out?
    Also, is there a way to find out the Java version from JAR file?
    Thanks.

    Kavipriya wrote:
    I have a .class file. I would like to identify the Java version from that.
    Is there a way to find out?Sure, there's the major version number (48, 49, 50) included in the class files. Look for the class file specification, shouldn't be too hard to find.

  • My laptop wont open pdf file

    when I come to open my pdf online it wont open at all.

    HI Nicole Troops,
    Are you facing any error message while opening a PDF file?
    Does the error occurs with a single PDF file or with all the PDF files?
    Regards,
    Rahul

  • Java version for class file

    i have some class files, and i need to know what Java compiler used to compiled that class file (only care for the version number...like 1.4.2, 1.5.0, 1.1.0, etc)
    any one know how i can get this info? or any good google keywords?

    thanx, since now i know how the class file bytes are set up..i guess i can get the version number by looking at the hex.
    tedious (but not that tedious)...thought there be a simplier way...oh well..
    thanx again

  • Java not creating .class file ?

    I copied and pasted text into textpad then saved textpad creats the java file but no class file ! What gives ? I tried rebooting , the class name is the same (not mispelled) even did a HD search for class file and its no where to be found

    You have to compile a Java source file into a class file.
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html

  • Java version from class file

    How to decide from class file that which java version (1.3, 1.4 etc) was used to compile it?

    Sorry I made a mistake,
    its minor, major
    Dont we have some utility given by Sun for this?
    javap -verbose <classname>will print out versions plus more...
    Do I need to use InputStream for reading class file then see the version?
    DataInputStream din = new DataInputStream(new FileInputStream(classFile));
    din.readInt();
    short minor = din.readShort();
    short major = din.readShort();Why do you need to do this?

  • Firefox wont open EML files for me any more.

    I have saved some files on a flash-drive that I have opened in the past that will no longer open. They have the Firefox logo next to them but they wont open. They say they are EML files but now I can't open them.

    Opening a .eml file depends on the email software that you use. For instance, Internet Explorer can now open .eml files since they are basically formatted in the same manner as .mht files are. Simply change the filename extension from .eml to .mht, and the file can now be opened on Internet Explorer. If you have Outlook, simply click the file and it should open easily in the program. If Outlook is not your default application that opens .eml files, simply right-click on the file, choose Open With and then select Outlook Express. Using Windows Mail, simply drag and drop the .eml file into one of your folders and click on it to open it.or u can use a FIREFOX EML file viewer software .

  • Can i generate java API from class files

    I have only class files. Is it possible to generate the java API using the javadoc.If yes, pls tell me how can i do??

    Also, Javadoc 1.4.2 will contain an unsupported option -Xclasses
    that should allow you to do this. You must pass in class names
    and use -classpath to find them. For com.package.MyClass
    at /home/classes/com/package/MyClass.class,
    you would run:
    javadoc -Xclasses -classpath /home/classes com.package.MyClass
    For mroe info, see:
    http://developer.java.sun.com/developer/bugParade/bugs/4720100.html-
    Doug Kramer
    Javadoc team

Maybe you are looking for