Results 1 to 17 of 17
- 07-21-2012, 06:37 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
- 07-21-2012, 06:58 PM #2
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 1
Re: Need urgent help with my first project Hello world app
The compiler has a problem with this line:
Does something about that line look wrong to you?Java Code:System.out.println(Hello world!");
"Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
- 07-21-2012, 07:08 PM #3
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
ya u r rigth it should be like this
Java Code:System.out.println("Hello world!");
- 07-21-2012, 07:13 PM #4
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
-
Re: Need urgent help with my first project Hello world app
Please show your code and error messages in the forum as text, not as images, and please use [code] [/code] tags when doing so. The forum faq or my link below will explain how to do this. You can get the text from your cmd window easily by copying and pasting it.
As for your problem, the error message is telling you which identifier is not recognized, so you need to check, did you spell it correctly? If so, did you cApTaLiZe it correctly? Both matter.
Finally, please don't label your question "urgent" or anything similar as it suggests that you feel your question is more important than any other question here, and that's not being fair to the other folks who need help here.
Thanks for your cooperation in this.
- 07-21-2012, 08:13 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Re: Need urgent help with my first project Hello world app
Do you have stocks in optician equipment or something?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-22-2012, 05:40 AM #7
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
- 07-22-2012, 05:53 AM #8
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
umm i dont see any problem in it may be u can point me out
Java Code:/* This is my First program*/ class myFirst { public static void main (string [] args) { System.out.println("Hello world!"); } }Last edited by saif; 07-22-2012 at 05:59 AM.
- 07-22-2012, 06:31 AM #9
Member
- Join Date
- Sep 2011
- Location
- Mumbai, India
- Posts
- 35
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
Just have a look at the spelling of a word in the parenthesis (brackets) of main.
You have written string and its actually a class in Java so it should be String. (i.e. S is capital)
Java is case-sensitive.
-
Re: Need urgent help with my first project Hello world app
Yep. The error has a little hat symbol "^" under the "string" token notifying you that it is the offending bit. That should clue you into checking how it's spelled and capitalized.
- 07-22-2012, 06:45 AM #11
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
it comes to me with another error
Java Code:C:\Documents and Settings\SK\My Documents>java MyFirst Error: Could not find or load main class MyFirst
- 07-22-2012, 07:42 AM #12
Member
- Join Date
- Sep 2011
- Location
- Mumbai, India
- Posts
- 35
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
I am not really sure because it has been months that i haven't opened my Java book.
But then too i would like to pin-point some things
1) Its always bad to save files in the place where you are saving, its good to make a directory by your name in say D: drive and save all your .java (dot java) and .class (dot class) in it. Definitely Java has no problem where you are saving your files.
2) So are you sure that your .class (dot class) file which you got after successful compilation of your Java file, is in your same directory from which you are compiling through.
3) Anyways just try this and see
java -cp . myFirst
if it works.
( for this program don't change anything and start from step 2 of this post.)
- 07-22-2012, 07:53 AM #13
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
yes the .class is there
and i tried the code u give it has given me error
Java Code:C:\Documents and Settings\SK\My Documents>java -cp . myFirst Exception in thread "main" java.lang.NoClassDefFoundError: myFirst (wrong name: MyFirst) 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.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 sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
- 07-22-2012, 08:06 AM #14
Member
- Join Date
- Sep 2011
- Location
- Mumbai, India
- Posts
- 35
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
I am unable to find any mistakes sorry!!!!!!!
But if you want then you can take a fresh start.
1) Just open a text editor like Notepad and write your program in it.
2) Save the file as myFirst.java in the place where you want or save it in D:\saif directory. (i will consider that you are saving your file here i.e. in D:\saif directory)
3) Open command prompt it will initailly point at c:\Documents and setting\................. etc, just type d: and press enter
4) Now you would see D;\ on command prompt. Now type cd saif and press enter
5) Now command prompt will have D:\saif>
6) Now compile your program
javac myFirst.java
7) Now execute it
java -cp . myFirst
- 07-22-2012, 08:42 AM #15
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
ok i will try
- 07-22-2012, 11:54 AM #16
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Re: Need urgent help with my first project Hello world app
same error no luck
- 07-22-2012, 11:58 AM #17
Member
- Join Date
- Jul 2012
- Posts
- 17
- Rep Power
- 0
Similar Threads
-
Java world generator-real world with people and stuff
By conker5295 in forum Jobs OfferedReplies: 2Last Post: 02-23-2012, 01:22 PM -
[URGENT]SHA Encryption System...need urgent helps
By java_idiot in forum New To JavaReplies: 6Last Post: 05-02-2010, 10:04 AM -
Hello, World!
By Steve11235 in forum IntroductionsReplies: 0Last Post: 12-22-2008, 05:00 PM -
Hello World!:)
By parme in forum IntroductionsReplies: 0Last Post: 12-05-2008, 08:04 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks