trying to get started
I made this file.
class HelloWorld {
public static void main (String args[]) {
Syustem.out.printin("Hello World!");
}
}
tried to compile thus
jdk1.3\bin\javac.exe HelloWorld.java
this apeared
HelloWorld.java:3: cannot resolve symbol
Symbol : class out
Location: package System
System.out.printin(揌ello World?;
^
1 error
trying to do this first time need help I couldn抰 find what抯 wrong.
First, you should use the code tag when posting your code, it makes your code more readable.
Second, the error is pretty obvious, you mispelled System and println
you have
class HelloWorld
{
public static void main (String args[])
{
Syustem.out.printin("Hello World!"); // It should be System.out.println("Hello World!");
}
}
Be careful and look closely next time
Good Luck!
Yikes. Almost a month after this: http://forum.java.sun.com/thread.jspa?threadID=5134451and you're still stuck at the very beginning?Better think about a different career path.
> Yikes. Almost a month after this:> http://forum.java.sun.com/thread.jspa?threadID=5134451> > and you're still stuck at the very beginning?> > Better think about a different career path.ROFLMAO
Let's not be too critical. Perhaps the OP set it aside for a month.At least he's typing HelloWorld with capital 'H' and 'W' now.
I corrected it
class HelloWorld
{
public static void main (String args[])
{
System.out.printIn("Hello World!");
}
}
Now this error appeared
HelloWorld.java:5: cannot resolve symbol
Symbol: method printIn (java.Iang.String)
Location : class java.io.PrintStream
System.out.printIn(揌ello World?;
^
1 error
please help.
> Yikes. Almost a month after this:> http://forum.java.sun.com/thread.jspa?threadID=5134451> > and you're still stuck at the very beginning?> > Better think about a different career path.ROFL
println: it must be an l, like language, not an I, like Inventory ;)
jwana, are you still stuck?
If so you really should have a look at Sun's [url=http://java.sun.com/developer/onlineTraining/new2java/]New to Java Center[/url]... and bookmark it... it's an incredibly good free resource... in my day you paid about $500 for a half a dozen textbooks to learn not so much not so easily.
And please take up the previous advise to upgrade your JVM... 1.3 is an anacronism... your time will be much better spent learning the current API, and common programming paradigms... and besides 1.6 is just a lot more user friendly (unlike this pack of carnivores) to deal with than 1.3
keith.
jwana, are you still stuck?
If so you really should have a look at Sun's New to Java Center... and bookmark it... it's an incredibly good free resource... in my day you paid about $500 for a half a dozen textbooks to learn not so much not so easily.
And please take up the previous advise to upgrade your JVM... 1.3 is an anacronism... your time will be much better spent learning the current API, and common programming paradigms... and besides 1.6 is just a lot more user friendly (unlike this pack of carnivores) to deal with than 1.3
keith.
... and it's println not printIn dopey. Sheesh!... still, I suppose anyone could be forgiven for making that mistake once.
I once spent 3 days on a bug which turned out to be IMP0SSIBLE.
Run this.
class HelloWorld
{
public static void main (String args[])
{
System.out.println("Hello World!");
}
}
Thanks for helping me now there抯 no problem in HelloWorld. I made another file name 揌elloWorldApplet.java?it抯 been compiled. When I run it gives this error.
Exception in thread 搈ain?java.NoSuchMethodError: main
What could be wrong now? Keith I tried to download it but of because my connection so slow that it抯 gonna take almost 15 hours. That why I didn抰 download it. I抣l try again. I want to download only JDK without jre give me a URL where I can download only jdk.
[code]
Thanks for helping me now there抯 no problem in HelloWorld. I made another file name 揌elloWorldApplet.java?it抯 been compiled. When I run it gives this error.
Exception in thread 搈ain?java.NoSuchMethodError: main
What could be wrong now? Keith I tried to download it but of because my connection so slow that it抯 gonna take almost 15 hours. That why I didn抰 download it. I抣l try again. I want to download only JDK without jre give me a URL where I can download only jdk.
[code]
> Exception in thread 搈ain?java.NoSuchMethodError: main
Because you cant "run" an applet. It needs to be loaded by your browser/applet viewer.
Read this tutorial about applets:
http://java.sun.com/docs/books/tutorial/deployment/applet/index.html
> I want to download only JDK without jre give
> me a URL where I can download only jdk.
Every JDK ships with a JRE. Otherwise you would not be able to run the code you write.
sorry abaut this inconvience i didn't have a look at my book. again sorry
> What could be wrong now? Keith I tried to download it
> but of because my connection so slow that its gonna
> take almost 15 hours. That why I didnt download it.
> Ill try again. I want to download only JDK without
> jre give me a URL where I can download only jdk.
You can't just have the JDK without the corresponding JRE
JDK (Java Development Kit) is used to compile bytecodes from
a Java source, while the JRE (Java Runtime Environment) runs
those bytecodes so your Java program actually runs.
And it should be String[] args not String args[] although it seems to compile either way.
stilea at 2007-7-21 17:52:09 >

> And it should be >> String[] args>> not>> String args[] >> although it seems to compile either way.That's because both define an array of Strings.