wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Aparently the claspath or the path is not correctly set?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Aparently the claspath or the path is not correctly set??" Watch "Aparently the claspath or the path is not correctly set??" New topic
Author

Aparently the claspath or the path is not correctly set??

Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
I am learning from the "Headfirst" series. I must have missed something because:

1. I have no "CATALINA_HOME" in my path (What should it be?

2. I have no "CLASSPATH" in my environment (What should it be?)

3. The compiler can not find either "Http..." nor "println"?

I am a C programmer but this one has me baffled. Any advice for this Java newbie would be welcomed.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
CATALINA_HOME is usually the installation directory of Tomcat.

CLASSPATH is an environment variable used by the Java compiler and interpreter to locate .class files. The value of the CLASSPATH is user defined.

If the CLASSPATH environment variable is not set, then the current directory is used as the CLASSPATH.

However, if the CLASSPATH is set, but does not contain the current directory, then the .class files in the current directory cannot be seen by the compiler and interpreter.

Could you be more specific about your third question?
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
Thank you for the rapid replies. When I attempt to compile any ".java" code containing either (or both) "system.out.println(...)" or any reference to any of the "Http functions (post, get), I receive an error that the compiler can not locate "system.out.println" or in the case of anything associated with "Http" functionality, the system error reads that it can not locate ...Http (I do not recall the exact error message).

Would you mind elaborating a bit more about "classpath"? Should I point to the Tomcat path housing my classes or to something else or as the Sun docs mention, leave the environment variable out completely? Oh, Tomcat runs just fine and I was able to compile and run the initial example/exercise in Heads Up Java/JSP (I retreated back to Heads up Java) though.
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
The exact error relating to the "println" statement is:
"cannot find symbol: method println(java.lang.String, java.lang.String)
location: class.java.io.PrintStream
System.out.println("Ruff", "Ruff");
^
Shyam Prasad Murarka
Ranch Hand

Joined: May 02, 2005
Posts: 209
Dear Readers,
In the println() method of java.io.PrintStream class, Java accepts only a single parameter. But looks like you have specified two parameters which is the cause of the error.
You can modify your code to include concantination like this:



Resultantly one parameter gets passed.


With Best Regards,
Shyam Prasad Murarka
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
It doesn't sound like you're reading Head First Java, which is the first book. Are you reading Head First Servlets?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
Thank you all for the answers. I took the "RUFF" "RUFF" code from page 36 of "HeadFirst Java". To answer the second question: I began with "Head First java" then needed an answer about Http Post and Get so I purchased "Head First Servlets and JSP". I quickly retreated back to the original though and will continue.

I suspect that I am having trouble with my environment and will work on that aspect. I also develop on an Apple and may move over to that.

Many thanks to all who are attempting to assist here.
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
Originally posted by Michael Reynolds:
Thank you all for the answers. I took the "RUFF" "RUFF" code from page 36 of "HeadFirst Java". To answer the second question: I began with "Head First java" then needed an answer about Http Post and Get so I purchased "Head First Servlets and JSP". I quickly retreated back to the original though and will continue.

I suspect that I am having trouble with my environment and will work on that aspect. I also develop on an Apple and may move over to that.

Many thanks to all who are attempting to assist here.


You can't make head or tail of it if you plunge headlong into advanced heady stuff; head to Head First Java first and then look ahead.


ASCII silly question, Get a silly ANSI.
Michael Reynolds
Greenhorn

Joined: Dec 26, 2005
Posts: 12
GOT IT I had to re-install the JDK and the JRE (not seperately of course). Many thanks to all who got me over this silly hump. I have been programming for about 20 years and feel rather silly but it is not the first nor I am sure the last time for that feeling.

Thanks again to all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Aparently the claspath or the path is not correctly set??