Keep getting error message when trying out a small java program in terminal
I've been trying out running java programs in mac os x terminal. I have eclipse as well, but it's too much for me right now. I copied some programs out of the dummies book I have, just to get a feel for things -- so, I went to the desktop where the program was, and compiled it (I saved it with a .java extension). "javac javaprogram.java" to compile, which it did fine, and then 'java javaprogram' to execute it. It's just a simple line that says 'you'll love java!'. Anyway, it wouldn't execute it.
Here's the program (written in text edit):
class Displayer {
public static void main (String args []) {
System.out.println ("You'll love Java!");
I got these messages:
Exception in thread "main" java.lang.NoClassDefFoundError: javaprogram
Caused by: java.lang.ClassNotFoundException: javaprogram
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:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
Now, I noticed that the first part of the error is "java.lang.NoClassDefFoundError: javaprogram". When I tried to run the program, it 'created' or put something on the desktop called Displayer.class, so I'm not sure what's going on. I've compared what I entered to what's in the book, and there are no mistakes on my part.
Can anyone tell me what I'm doing wrong, and is there any book or site I can go to which will instruct me on running programs in terminal?
For starters, rename javaprogram.java to Displayer.java and dojavac Displayer.java
java Displayerand since you are new to Java, change your source code to public class Displayer.
In Java, files containing a Java class named "ClassName" should/have to be named "ClassName.java".
Similar Messages
-
Keep getting error message when trying to sign in to make a Genius Bar Reservation
Keep getting error message when trying to sign in to make a Genius Bar Reservation
Make the reservation by phone.
-
I keep getting error messages when I try to activate iMessage on my iPad since installing iOS7. Anyone else having this issue or a solution. I can obviously sign in with the same Apple ID information/password as I have done here and I am connecting with Wifi now and in all other apps.
After looking at some other posts I signed into iTunes and edited my password with my Mac. Then I powered off and restarted my iPad and all is good now.
-
HT201210 keep getting error message when trying to update iOS to 5.1.1
I have had no trouble updating the several iPads under my charge at work, however can't update my own. Am using iOS 5.1 currently on original iPad. I go to settings and it looks for any updates available and I click install to 5.1.1 but keep getting error message saying there was an error when trying to update. I am on my home wifi on my iPad. Have done same procedure with about 5 other iPads with no trouble. What can I do?
First, try a system reset. It cures many ills and it's quick, easy and harmless...
Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo. Ignore the "Slide to power off" text if it appears. You will not lose any apps, data, music, movies, settings, etc.
If the Reset doesn't work, try a Restore. Note that it's nowhere near as quick as a Reset. Connect via cable to the computer that you use for sync. From iTunes, select the iPad/iPod and then select the Summary tab. Follow directions for Restore and be sure to say "yes" to the backup. You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod. Again, say "yes." -
HT6147 Keep getting error message when trying to download iOS 7.0.6 to my iPhone 4s
Unable to download SSL iOS 7.0.6 update. Keep getting error message.
Hey Pster,
Thanks for the question. I understand that you are experiencing issues updating your device. The following resource may provide a solution:
Resolve iOS update and restore errors in iTunes
http://support.apple.com/kb/TS1275
Thanks,
Matt M. -
Why do I keep getting error message when trying to update iPad with ios7?
Keep getting error message ios7 won't validate? Can I reset iPad and download again? Will I lose data on iPad if reset?
NMAYO,
In your project view can you right click on the chassis in the cRIO and make sure that it is set for Scan Mode and not FPGA mode? Also, In the measurement and automation explorer you can check the cRIO and verify that it has Scan Engine Support installed on it. The tutorial below shows how to reformat a cRIO and install software on it, the later steps on software will allow you to check your cRIO.
Reformatting a CompactRIO Real-Time Embedded Controller
Ben Sisney
FlexRIO V&V Engineer
National Instruments -
I keep getting error message when trying to convert a pdf to a word doc
I keep getting an error message when ttying to convert pdf to word.
Full details, please. How are you trying to convert it? What does the error message say?
-
Keep getting error message when trying to connect
First, I am severly hearing impaired and telephone support is not an option.
I went from an iMac G5 to an iMac 3.4 GHz Intel Core i7. Contribute had been working perfectly with the old iMac. Now whenever I try to connect I get the following error message: "Access Denied. The file may not exist, or there could be a permission problem." When I go through the trouble shooting file I keep getting the error message while trying to re-configure. Can someone please help??What is the version of Contribute and also the Mac OS ?
Can you try clearing the Preferences this would be like launching Contribute freshly? -
Keep getting error message when trying to eject iPOD nano
When trying to eject iPOD, getting error message ..."cannot be ejected because it contains files that are in use by another application". No other application is open but iTUNES. What does this mean? and are there any tricks to get it to eject?
Usually this is caused when antivirus "Grabs" the drive to scan it in the background, and/or windows itself "Grabs" the drive for indexing and things. It also happens if you play a song off the ipod thru iTUnes, then stop it.
Usually rebooting will force it to let go -
Keep Getting Error Message When Trying to Upgrade
I have tried to upgrade several times it goes all the way through and then it gives an error message after trying to upgrade quicktime error message 2378
+error message 2378+
That typically indicates a problem with your VBScript. See the following troubleshooting article:
iTunes and QuickTime for Windows cannot be installed without Visual Basic Script (VBScript)
(The Vista instructions are down at the bottom of the document.) -
I keep getting error messages when trying download a tv show in iTunes
I have been trying to download this for two days now, and I keep getting various error messages. The latest have been -3256, -42, -3271. All telling me to check my network connection (which is working just fine) or telling me that there are too many files open (even when iTunes was the only thing open). I've restarted iTunes several times, and I've restarted my computer twice as well, but it still comes up. Does anyone else have this problem or know how to fix it? I really would like to watch this video I'm downloading.
This could be an issue with security software (firewall, anti-virus, etc) on your computer conflicting with iTunes. Either disable the software or configure it to properly run with iTunes:
http://docs.info.apple.com/article.html?artnum=106439
Basically, you will need to allow ports 3689 (TCP) and 5353 (UDP) access in your security software. -
Keep getting error message when trying to dowmload iso6 on my iPhone 4s
Error message keeps coming up when I am trying to finish download of iso6 please someone help
That error usually means "Disk Full". Could that be the issue?
-
Keep getting error message when trying to publish imovie '08
I keep getting the error code -34 when trying to publish a medium size movie to itunes. Any ideas on what to do now?
thanks,That error usually means "Disk Full". Could that be the issue?
-
I keep getting error messages when trying to sync my Iphone
I am not sure what the heck is going on.... the syncing has been running smooth up until now and I am not sure why it is all of a sudden doing this. I keep getting 2 error messages....
#1 being "The Iphone "Nikki's Iphone" cannot be synced. An internal device error occurred.
and
#2 Itunes cannot sync apps to the Iphone "Nikki's Iphone" because the apps installed on the phone could not be determined.....
My Iphone has the latest OS system and my Itunes is up to date.... what is going on????I seemed to have figured it out...... I hard reset my Iphone and rebooted my computer and it seemed to work. It also seemed there was a music file that was not being recognized, I just erased it and everything worked fine after that.... very strange but I am so glad I figured it out.....
-
Keep getting error message when trying to connect to Podcast directory
Whenever I try to connect to the Podcast directory on iTunes, I get an error message saying iTunes could not connect to the Music Store. The Network Connection was terminated unexpectedly. I am at loss.
IBM Thinkpad Windows XP Pro Connecting through Verizon DSLDid you ever get this figured out? I am in the same situation.
thanks
[email protected]
Maybe you are looking for
-
I recently got my moms friends old iphone5 that he had for like a month. Everything is fine with it but it wont let me update any of my apps because it asks for his apple ID password. Is there anything i can do to change/fix that?
-
I am using laptop hitting and slow system not working
i am using laptop hitting and slow system not working and very late opan file browser every think . plez help me
-
Need wireless drivers for Satellite A100-259
Hi Had to reformat my daughters laptop (A100-259 PSAA2) due to virus issues and am in the process of rebuilding it. Almost there but can't seem to get the wireless bit to work. Nothing appears in the system tray even when it's switched on (little swi
-
When i use language for non-unicode [Russian] and i insert another language
when i use language for non-Unicode [Russian] and i insert another language. it transform to Russian. i insert Thai language into MS access it transform to Russian type.i try to change anything,CharSet, sun.jnu.encoding. but it doesn't have any effec
-
TS3789 NO Sound from the Apple TV unit.
I have no sound at all. Just used it 30 minutes ago and it worked fine while using Netflix. Also tried restarting unit, but still no sound. Used AirPlay with ipad2, and get pictures but no sound. Get sound from tv using digital antenna and DVD play