HelloWorld can be complied but can't run:NoClassDefFoundError

so simple programe but I can't figure out, I hate myself.
package com.aplha.simple;
public class HelloWorld
     public static void main(String[] args) {
          System.out.println("hello world");
}HelloWolrd.java and HelloWorld.class in the same directory:com\alpha\simple exactly same with the package hierarchy. HelloWorld.java can be compiled to HelloWorld.class, but everytime when I use java command to run the program I receive the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong nam
e: com/aplha/simple/HelloWorld)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)I have configured current directory(.) into the CLASSPATH environment variable and My environment is
OS: XP SP3
JDK: 1.6.0_06
Can anyone tell me the reason why I can't launch the program, any help is appreciated !

laianfa_alpha wrote:
my directory structure:
E:\test\src\com\alpha\simple
now I am in simple directory I type : java com.alpha.simple.HelloWorld, still the error message
Exception in thread "main" java.lang.NoClassDefFoundError: com/alpha/sim
oWorld
Caused by: java.lang.ClassNotFoundException: com.alpha.simple.HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
In my previous reply post, I didn't mean to guess what directory structure you actually had, but was providing you with an example for you to adapt to; point being that you must be up the directory stream to run it ... have a reread of my post and it will become clear.

Similar Messages

  • I have been having trouble getting my email on my iPad. It started when I brought it to the US on vacation (I live in London and my email provider is Virgin Media). It worked once since I returned, but that is it. I can send emails, but can't get them

    I have been having trouble getting my email on my iPad2.
    It started when I brought it to the US on vacation (I live in London and my email provider is Virgin Media). It worked once since I returned, but that is it.
    I can send emails, but can't get them.
    Any ideas, people?

    Hi Kharels
    Just posted this reply to 2 others with same sort of question:
    I have the same issue as i have my own email address and only want to use.
    There are two ways around this annoying problem. The first is to set up your own domain email account alongside your iCloud one, and when you go to send each email tap on From and you get a choice of emails addresses to reply from... ie your own domain or the iCloud one.  This is tedious though.
    The other is to set up your iCloud email as normal, then create a new one altogether. Choose 'Other' when creating this new account. Then put for the incoming server mail.me.com, along with your user name and password. For the outgoing server put the server you want to use - ie your own domain one. This is therefore a hybrid account and does work.
    Now switch off the email for iCloud (leaving on Calendar, Address Book etc). Switch on the email for your hybrid account (which of course is iCloud incoming as well).
    Providing you have directed your own domain email address to your me.com one, you will find the iPhone should behave itself and you can use the folders etc and these will synch with your Mac ok.
    Hope this work for you - let us know.
    Simon

  • I updated my first generation iPad to version 5.1.1 and won't go past the setup screen that asks if I want to use the iPad locator. I can go back but can't get any further.

    I updated my first generation iPad to version 5.1.1 and won't go past the setup screen that asks if I want to use the iPad locator. I can go back but can't get any further

    I just updated my original iPad 32 GB WiFi to iOS 5.1 about fifteen minutes ago.  But I did it with the system restore feature in iTunes.  So it wiped out everything on my iPad.  But it did work.  Then I restored an earlier backup and all went fine.  Maybe you could try backing up your iPad and then using Restore to get it back to factory settings to see what happens. 

  • Problem: Cannot send mail unless Password is transmitted insecurely & Port is set to 587.. Can receive mail but can't send..

    Problem: Cannot send mail unless Password is transmitted insecurely & Port is set to 587.. Can receive mail but can't send Code 501..
    Need help with T-bird.. My OS is Win XP-64..Have been using Mozilla for about 10 years with little or no problems.. This happened when I upgraded to 3.17.. Spent hours on T-Bird diagnostics web site.. Called Comcast & talked to a net tech.. he ran some tests on his end & had me log into my Comcast e-mail account & all worked well,, so he concluded the problem was in T-Bird.. He had me change my port to 587 & disable connection security & authentication to none & I was able to send mail.. That was all he could do.. Comcast was working.. the problem is in T-Bird.. Can any one help with this problem.. I don't want to send mail with my password transmitted insecurely..
    Thanks
    Richard

    It was not intended to be "snide". You said two separate things that at face value would be out of the ordinary.
    I considered if it might be a typo for 31.7. Since 31.5 is the current formal release, I would have to thank you for volunteering to test a pre-release beta version. If it was truly 3.1.7 then it would appear that you have chosen, or have become stuck with a somewhat ancient version. In either case it's harder to reach out to you with any meaningful comments or advice. However I do watch various other sites and newsgroups and I don't see a clamour of distressed users, so it seems fair to suppose that this feature isn't actually broken in 31.7.
    And you said XP 64. XP is obsolete and no longer supported and if there is a 64-bit version, then again you have set yourself apart from the mainstream.
    I had a look at the comcast site and found some puzzling recommendations. Some users come here asking how to set up a secured connection in Thunderbird when it isn't offered by the server. Comcast are different, in that they mention the ports 143 and 587, and also 993 and 465. So far so good, in that security is actually on offer, but they also suggest that you enable SSL, regardless of which port is being used. It would be unusual and unconventional to offer TLS or SSL on ports 143 and 587. STARTTLS would be more credible on these ports.
    Have you tried IMAP on 993 and SMTP on 465? SMTP on 587 with SSL, or TLS, is not impossible, but is improbable.

  • Using the camera on my iPad 2, I can record videos, but can't get them to play back.  I'd appreciate your  help with this!

    Using the camera on my iPad 2, I can record videos, but can't get them to play back.  Can you help me with this?     Thank you!

    Previous version was a touch to change, this one is a slide to change.  

  • HT203477 PLEASE HELP I CAN HEAR SOUND BUT CAN'T SEE VIDEO(final cut pro x)what gonna on?

    PLEASE HELP I CAN HEAR SOUND BUT CAN'T SEE VIDEO(final cut pro x)what gonna on?os x lion 10.7.4(11e53)

    What's the video exactly? Open into the QT player and report what it says in the movie inspector or post a screen shot.

  • Brand new mac pro has blank screen on start up...why? Can here instructions but can't see

    I hae a brand new mac pro and the screen is blank during start up. ***...I can here instructions but can't see screen.

    That Mac comes with 90 days free phone support from trained Applecare reps. You should take advantage of it.
    Another alternative is to make an appointment at the Genius Bar and have them put their hands on it.
    Be sure you do something before your 14-day return/exchange (if you bought it direct from Apple) expires, or you may face a 3 to 5 day repair cycle.
    Shine a bright light at the screen when it has booted up.
    ¿ Is the picture "there" but not lit up?   that could be a backlight failure.
    The F2 key is used to turn up the brightness, if it accidentally got turned down low.

  • Can access Yahoo, but can't open Yahoo Mail in Firefox. Can on Internet explorer.

    Can access Yahoo, but Can't open Yahoo Mail in Firefox. Can open Yahoo Mail on Internet Explorer. Checked Password.

    PROBLEM: This is the error I get when I simply try to open an email in Firefox. File not found Firefox can't find the file at http://us.mg1.mail.yahoo.com/dc/blank.html?bn=555&.intl=us&.lang=en-US. * Check the file name for capitalization or other typing errors. * Check to see if the file was moved, renamed or deleted.
    POSSIBLE SOLUTION:
    I contacted Yahoo and they had me clear (1) cookies and (2) cache. This did work so that I can now open the emails in Firefox.
    COMMENTS:
    Yahoo support said "Please rest assured that Yahoo! Mail is properly working as of this time. It would be best if you contact Mozilla Firefox help support. They have the right tools and knowledge with the settings to access Internet Sites like Yahoo! Mail on Mozilla Firefox browser."
    I'd like to know what to do to prevent this in the future because I've had this issue twice now in the last few weeks.

  • HT201412 My 4s is not picking up phone signal I do not no how to sort this out I have tried resetting it and its not working still I do receive messages and can send them but can not call as it just says call fail

    My 4s is not picking up phone signal I do not no how to sort this out I have tried resetting it and its not working still I do receive messages and can send them but can not call as it just says call fail

    Try resseting the network settings in settings>general then go to reset a the bottom.
    Then reset NETWORK settings.

  • My iphone 4s had upgrade to ios 8.1.1 and wifi can turn on but can not detect wifi. how to downgrade ios org back in to ios 6 again?

    my iphone 4s has upgrade to ios 8.1.1 and wifi can turn on but can not detect wifi. how to downgrade ios or back in to ios 6 again? i have try to restore iphone , reset all but it can't solve my problem. any one can help me?

    You can't downgrade the iOS level.
    Try using Settings > General > Reset > Reset Network Settings.

  • I bought a EarPods October last year in USA, the day before yesterday the remoter can not work any more, it means by the EarPod still can lisence music but can not adjust the volume and answer the phone, can I get a new one or what can I get?

    I bought a EarPods October last year in the USA, the day before yesterday the remoter can not work any more, it means by the EarPod still can listen music but can not adjust the volume and answer the phone, can I get a new one or what can I get based on the one year product warrant?

    Now I am live in Baoding city, China, what I can do, it seems there is no apple store in my city??

  • HT201320 Added email to ipad can send email but can not get email message wrong password. Can some one help

    Added email to ipad can send email but can not receive.Message wrong password .Can some one help.Thanks

    No one here will know your password

  • I can receive email but can't send on my ipad2

    I can receive email but can't send on my ipad2. It says 'rejected by the server'.

    I would that that your smtp settings are set up wrong
    I would verify them 1 by 1 against the setup guide from the mail provider
    if they were the same I would suspect that your phone company are blocking the ports
    required by smtp in which case I would take contact to them and ask why

  • I was sending text messages this morning but all of a sudden I stopped receiving them.  I have found out that I can send them but can't receive them.  Can anyone help me?

    I was sending text messages this morning but all of a sudden I stopped receiving them.  I have found out that I can send them but can't receive them on my mac book or on my wifes mac book, but can receive my messages on the iphone!!!   Can anyone help me?

    If you're referring to iMessages, then the problem is that Apple is having server issues. If the problems your having are with standard SMS, post back with further details.

  • I can receive emails but can't send emails. Can someone help me?  Thank you.

    I can receive emails but can't send emails. Can someone help me?  Thank you.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    iPhone, iPad, iPod touch: Microsoft Outlook 2003, Outlook 2007, Outlook 2010 may not display contacts and calendars after sync
    http://support.apple.com/kb/TS1944
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Delete Email on the iPad
    http://ipad.about.com/od/iPad_Guide/ss/How-To-Delete-Email-On-The-Ipad.htm
    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iCloud: Create a group and add contacts to it
    http://support.apple.com/kb/PH2667
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email  -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

Maybe you are looking for

  • I Need Help Badly With my Creative

    I have recently bought a creative nomad jukebox zen 20gb. It worked fine 2 days ago and now it wont even switch on and when i plug the adapter in the screen comes up with CREATIVE copyright (c) 2002 and stil will not switch on. Can anyone please help

  • Creating Publicrootfolder.

    Dear Friends, We have installed SAP Easy DMS v7.1 and when I try to login first time system asked "No Private root folder is created". After clicking on Icon "Yes", Private root folder has been created with doc type FOL. But I am not able to create P

  • How does one prevent cursor from jumping to previous words, deleting words?

    A question for my daughter who has a macbook pro with an intel chip using system 10.4.11. On several different programs,e.g. word, gmail, her cursor arrow jumps from the word she is on, backwards, to the previous words, deleting words, phrases, and s

  • After upgrade cannot connect to router- Cisco Connect advises "unsupported operating system"

    With the upgrade I am unable to connect to my Linksys E1200 Router.

  • Publish vs Update

    Hi there, One question is still confusing me after the iWeb v1.1 update: the issue of publishing vs updating. It seems to me that the only way to get new content (i.e., a new photo page) onto my iWeb (published to .Mac) site is to click the "Publish"