very n00b error....just started programming and need help?!?!

Hi i just started programming in java.

im running j2se 1.5.0 on windows xp

im on the subject of classes and objects.

here is my simple little code im trying to get to compile

publicclass Newprog

{

publicstaticvoid main(String[] args)

{

Greeter myObjectGreeter =new Greeter();

myObjectGreeter.sayHello();

}

}

now here are the error messages i get:

--Configuration: <Default>--

C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol

symbol : class Greeter

location: class Newprog

Greeter myObjectGreeter = new Greeter();

^

C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find symbol

symbol : class Greeter

location: class Newprog

Greeter myObjectGreeter = new Greeter();

^

2 errors

Process completed.

ok i get this error message alot....well actually just about everytime..

I got it working just once using texteditor but have no clue how i did it that time...now nomatter what i try i get this error

I have my enviornmental variable set at

path = C:\Program Files\Java\jdk1.5.0_07\bin;

i am using JCreator Le

i downloaded exact codes from websites and they still compile with this error..

if anybody with patience could tell me what i need to do

would i have to configure java some more with variables?

is my installation wrong?

do i have to save the work on a different file?

thanks in advance

[1891 byte] By [plzbenicetomea] at [2007-10-2 21:23:06]
# 1

Hi,

You need to set teh CLASSPATH System variable. The class path tells Java classes where to find the classes that you have created.

You can have a look at this link for more information :-

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

Regards,

Sandeep

Sandeep.Seshana at 2007-7-14 0:33:40 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

ok i looked through all that you sent me and did what it told me to do

and still same thing..

i have no idea where to set my classpath too?

is that even why the error is comming up?

why is it i had it running before maybe 2 or 3 times and the rest would give me this error message, also the book im learning from mentions nothing in early chapters about setting the classpath all it shows me to do is set the path in environmental variables

what else can i do...

plz someone with a step by step pleas show me im running out of hair to pull out :)

plzbenicetomea at 2007-7-14 0:33:40 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

> Hi i just started programming in java.

>

> im running j2se 1.5.0 on windows xp

>

> im on the subject of classes and objects.

>

> here is my simple little code im trying to get to

> compile

>

>

>

> public class Newprog

> {

> public static void main(String[] args)

> {

> Greeter myObjectGreeter = new Greeter();

> myObjectGreeter.sayHello();

> }

> }

>

>

>

> now here are the error messages i get:

>

>

> --Configuration:

> <Default>--

> C:\Program Files\Java\jre1.5.0_07\lib\Newprog.java:5:

> cannot find symbol

> symbol : class Greeter

> location: class Newprog

> Greeter myObjectGreeter = new

> Greeter();

>^

> s\Java\jre1.5.0_07\lib\Newprog.java:5: cannot find

> symbol

> symbol : class Greeter

> location: class Newprog

> Greeter myObjectGreeter = new

> Greeter();

> ^

> get this error message alot....well actually just

> about everytime..

> I got it working just once using texteditor but have

> no clue how i did it that time...now nomatter what i

> try i get this error

>

> I have my enviornmental variable set at

>

> path = C:\Program Files\Java\jdk1.5.0_07\bin;

>

> i am using JCreator Le

>

> i downloaded exact codes from websites and they still

> compile with this error..

>

> if anybody with patience could tell me what i need to

> do

> would i have to configure java some more with

> variables?

> is my installation wrong?

> do i have to save the work on a different file?

>

> thanks in advance

Well here is all that goes

As you said you were pretty new

I suspect the following error done by most of the novice programmers in JAVA

Where is the Greeter class ?

ok may be you must have defined it somewhere else

Mostly the Java Compiler hasnt found out your Greeting class

Try locating that " Greeter.java"

or mention it in an other file located in the same folder as "Newprog.java"

public class Newprog

> {

> public static void main(String[] args)

> {

> Greeter myObjectGreeter = new Greeter();

> myObjectGreeter.sayHello();

> }

> }

AJAVAYa at 2007-7-14 0:33:41 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...