Home > Archive > Java Help > October 2004 > ALL OF A SUDDEN can't find ANY classes....
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ALL OF A SUDDEN can't find ANY classes....
|
|
| Frances Del Rio 2004-10-11, 4:01 pm |
| I know this question of NoClassDefFoundError has been answered here
before, but: why, if I have been compiling and running apps successfuly
for months now all of a sudden no matter what app I run (apps I have run
before w/no problems..) do I all of a sudden get this error??? this is
very puzzling.. I have not changed any settings.. I'm on Windows 2000,
I set the path following the instructions at java.sun... (what confuses
me is that in the Env var's there's a PATH and a CLASSPATH, why two???
at any rate they are both set to c:\java\bin.. this is how I've always
had it set, have not changed any settings at all.. (before setting
anything I renamed my SDK/JRE folder "java" to keep things simple..)
have not moved my apps to another directory, have not changed ANYTHING..
would appreciate any suggestions.. am at a loss.. thank you very
much.. Frances
| |
|
| On Mon, 11 Oct 2004 12:16:53 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>I know this question of NoClassDefFoundError has been answered here
>before, but: why, if I have been compiling and running apps successfuly
>for months now all of a sudden no matter what app I run (apps I have run
>before w/no problems..) do I all of a sudden get this error??? this is
>very puzzling.. I have not changed any settings.. I'm on Windows 2000,
>I set the path following the instructions at java.sun... (what confuses
>me is that in the Env var's there's a PATH and a CLASSPATH, why two???
>at any rate they are both set to c:\java\bin.. this is how I've always
>had it set, have not changed any settings at all.. (before setting
>anything I renamed my SDK/JRE folder "java" to keep things simple..)
>have not moved my apps to another directory, have not changed ANYTHING..
> would appreciate any suggestions.. am at a loss.. thank you very
>much.. Frances
Command Line? Whats the error you get (exact text please)?
--
now with more cowbell
| |
|
| On Mon, 11 Oct 2004 12:16:53 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>(what confuses
>me is that in the Env var's there's a PATH and a CLASSPATH, why two???
PATH is Windows path. Nothing to do with Java
CLASSPATH is the path that Java uses to find classes. I don't use the
CLASSPATH environment variable though... I specify it on the command
line if needed.
--
now with more cowbell
| |
| Frances Del Rio 2004-10-11, 4:01 pm |
|
Bryce wrote:
> On Mon, 11 Oct 2004 12:16:53 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> Command Line? Whats the error you get (exact text please)?
ok, here it is:
C:\Documents and Settings\fdelrio\My Documents>cd myjava
C:\Documents and Settings\fdelrio\My Documents\myjava>javac hamlet.java
C:\Documents and Settings\fdelrio\My Documents\myjava>java hamlet
Exception in thread "main" java.lang.NoClassDefFoundError: hamlet
C:\Documents and Settings\fdelrio\My Documents\myjava>
THANK YOU!!! Frances
| |
| Frances Del Rio 2004-10-11, 4:01 pm |
|
Bryce wrote:
> On Mon, 11 Oct 2004 12:16:53 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> PATH is Windows path. Nothing to do with Java
>
> CLASSPATH is the path that Java uses to find classes. I don't use the
> CLASSPATH environment variable though... I specify it on the command
> line if needed.
so why does it say in java.sun to set PATH??
here what it says (http://java.sun.com/j2se/1.4.2/install-windows.html):
Microsoft Windows NT, 2000, and XP - To set the PATH permanently:
1. Choose Start, Settings, Control Panel, and double-click System.
On Microsoft Windows NT, select the Environment tab; on Microsoft
Windows 2000 select the Advanced tab and then Environment Variables.
Look for "Path" in the User Variables and System Variables. If you're
not sure where to add the path, add it to the right end of the "Path" in
the User Variables. A typical value for PATH is:
C:\j2sdk1.4.2_<version>\bin
Capitalization doesn't matter. Click "Set", "OK" or "Apply".
The PATH can be a series of directories separated by semi-colons
(;). Microsoft Windows looks for programs in the PATH directories in
order, from left to right. You should only have one bin directory for a
Java SDK in the path at a time (those following the first are ignored),
so if one is already present, you can update it to
j2sdk1.4.2_<version>\bin.
Following these instructions I set Path; had no problems until now...
again, many thanks.. Frances
| |
| Paul Lutus 2004-10-11, 8:57 pm |
| Frances Del Rio wrote:
>
>
> Bryce wrote:
>
> ok, here it is:
>
> C:\Documents and Settings\fdelrio\My Documents>cd myjava
>
> C:\Documents and Settings\fdelrio\My Documents\myjava>javac hamlet.java
>
> C:\Documents and Settings\fdelrio\My Documents\myjava>java hamlet
> Exception in thread "main" java.lang.NoClassDefFoundError: hamlet
First, is this exactly what you typed? Did you copy your typing and the
system's replies directly from the command window?
Please tell us whether at this point there is a file in the current
directory named "hamlet.class". Also tell us what happens when you type:
java -version
If you re-install the java SDK, other problems will almost certainly be
fixed automatically.
--
Paul Lutus
http://www.arachnoid.com
| |
|
| On Mon, 11 Oct 2004 15:53:03 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>
>Bryce wrote:
>
>
>so why does it say in java.sun to set PATH??
Because setting the PATH allows you to type:
javac MyClass.java
instead of:
c:\jdk1.4.02_03\bin\javac MyClass.java
Again, Path and Classpath are two totally different entities.
>here what it says (http://java.sun.com/j2se/1.4.2/install-windows.html):
>
>Microsoft Windows NT, 2000, and XP - To set the PATH permanently:
>
> 1. Choose Start, Settings, Control Panel, and double-click System.
>On Microsoft Windows NT, select the Environment tab; on Microsoft
>Windows 2000 select the Advanced tab and then Environment Variables.
>Look for "Path" in the User Variables and System Variables. If you're
>not sure where to add the path, add it to the right end of the "Path" in
>the User Variables. A typical value for PATH is:
>
> C:\j2sdk1.4.2_<version>\bin
>
> Capitalization doesn't matter. Click "Set", "OK" or "Apply".
>
> The PATH can be a series of directories separated by semi-colons
>(;). Microsoft Windows looks for programs in the PATH directories in
^^^^^^^^^^^^^^^^
Note, Microsoft Windows looks for programs, not Java looks for
programs.
Classpath is where JAVA looks for classes.
>order, from left to right. You should only have one bin directory for a
>Java SDK in the path at a time (those following the first are ignored),
>so if one is already present, you can update it to
>j2sdk1.4.2_<version>\bin.
>
>Following these instructions I set Path; had no problems until now...
>
>again, many thanks.. Frances
>
>
>
--
now with more cowbell
| |
| Frances Del Rio 2004-10-11, 8:57 pm |
|
Paul Lutus wrote:
> Frances Del Rio wrote:
>
>
>
>
> First, is this exactly what you typed? Did you copy your typing and the
> system's replies directly from the command window?
>
> Please tell us whether at this point there is a file in the current
> directory named "hamlet.class". Also tell us what happens when you type:
>
> java -version
Paul, thank you very much for yr help.. here it is, copied and pasted
from DOS shell (as I did w/above...)
C:\java>java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
> If you re-install the java SDK, other problems will almost certainly be
> fixed automatically.
I guess I can always re-download and install SDK.. but am still
mystified as to what could have happened here.. again, many thanks for
your help.. Frances
| |
| Frances Del Rio 2004-10-11, 8:57 pm |
|
Bryce wrote:
[color=darkred]
> On Mon, 11 Oct 2004 15:53:03 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> Because setting the PATH allows you to type:
>
> javac MyClass.java
>
> instead of:
> c:\jdk1.4.02_03\bin\javac MyClass.java
>
>
> Again, Path and Classpath are two totally different entities.
>
>
>
> ^^^^^^^^^^^^^^^^
>
> Note, Microsoft Windows looks for programs, not Java looks for
> programs.
>
> Classpath is where JAVA looks for classes.
>
>
Bryce, thank you for your help.. here what I have under CLASSPATH:
%SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\tom
cat\bin
(dir in which my SDK/JRE is in is called 'java', i.e., path to it is
c:\java...)
this is so weird.. thank you again.. Frances
| |
| Paul Lutus 2004-10-11, 8:57 pm |
| Frances Del Rio wrote:
/ ...
>
> Paul, thank you very much for yr help..
Please read more carefully. "Please tell us whether at this point there is a
file in the current directory named 'hamlet.class'."
/ ...
>
> I guess I can always re-download and install SDK..
This time, don't throw it away. Keep it handy for things like this. And find
out whether the class file is present as explained above.
> but am still
> mystified as to what could have happened here..
You may or may not know that "Windows" is the name of a fate as well as the
name of an OS.
--
Paul Lutus
http://www.arachnoid.com
| |
|
| On Mon, 11 Oct 2004 16:53:52 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>Bryce, thank you for your help.. here what I have under CLASSPATH:
>
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\tom
cat\bin
>
>(dir in which my SDK/JRE is in is called 'java', i.e., path to it is
>c:\java...)
>
>this is so weird.. thank you again.. Frances
CLASSPATH? That looks more like your PATH variable.
I don't even have a CLASSPATH variable in my environment. I would get
rid of your CLASSPATH and make sure you have a PATH.
--
now with more cowbell
| |
| andreas kinell 2004-10-11, 8:57 pm |
|
>
> Bryce, thank you for your help.. here what I have under CLASSPATH:
>
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\tom
cat\bin
>
> (dir in which my SDK/JRE is in is called 'java', i.e., path to it is
> c:\java...)
>
> this is so weird.. thank you again.. Frances
>
PATH specifies the paths, where windows or unix systems would look for a
program
when you type something like C:\someDir\myProgram
this is convenient because you want to execute programs without having to
change
to the directory where your program is located.
your PATH variable makes windows search in "SystemRoot\system32", then in
"SystemRoot" and so on, until the specified program is found. (note the
problem, in case
two different programs with the same name are located in two different
directories of the PATH,
the first one will be executed!)
CLASSPATH does more or less the same. instead of searching for programs, it
searches for
class-files.
see:
http://java.sun.com/j2se/1.3/docs/t.../classpath.html
since
C:\Documents and Settings\fdelrio\My Documents\myjava>javac hamlet.java
worked fine, but
C:\Documents and Settings\fdelrio\My Documents\myjava>java hamlet
Exception in thread "main" java.lang.NoClassDefFoundError: hamlet
didnt, i can only guess, that hamlet.class is not in the current directory
nor in
one of the directories set in the CLASSPATH variable.
another explanation for a NoClassDefFoundError is, that you simply forgot to
implement the main() method :-)
andreas
| |
| Frances Del Rio 2004-10-12, 3:57 am |
|
Paul Lutus wrote:
> Frances Del Rio wrote:
>
> / ...
>
>
> Please read more carefully. "Please tell us whether at this point there is a
> file in the current directory named 'hamlet.class'."
yes there is indeed, sorry Paul, this is at work, where I'm always very
busy.. this is what I find so hard to understand, I compile, Java
creates the class, then when I try to run app it says it can't find the
class by the same name of the app.. i.e., I compile hamlet.java, Java
creates hamlet.class, then says it can't find class called
hamlet.class.. VERY WEIRD.. again, thank you for your help.. Frances
> You may or may not know that "Windows" is the name of a fate as well as the
> name of an OS.
LOL....
| |
| Frances Del Rio 2004-10-12, 3:57 am |
|
Bryce wrote:
> On Mon, 11 Oct 2004 16:53:52 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> CLASSPATH? That looks more like your PATH variable.
>
> I don't even have a CLASSPATH variable in my environment. I would get
> rid of your CLASSPATH and make sure you have a PATH.
ok, I'm totally now, you said earlier CLASSPATH is where Java
looks for classes, PATH is where ... ok, this is what you said:
Note, Microsoft Windows looks for programs,
not Java looks for programs.
Classpath is where JAVA looks for classes.
why do we deal at all here w/what Windows does??? "path" seems to me a
very generic thing.. why not just CLASSPATH for Java? at any rate, am
home now, where everythign works fine, and where I have all the same
settings for everything (same location for SDK/JRE, same version of same
at home and at work, same OP (W2k), etc.. and at home have the
following under PATH:
%SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\jav
a\bin;C:\tomcat\bin
this morning I copied this under PATH at work and still it wouldn't
work.. and at home indeed have no CLASSPATH.. don't know how that one
got there at work.. I think I will have to download and install SDK/JRE
again, simply have no idea what happened here.. ok, Bryce.. thank you
very much for your help... Frances
| |
| Frances Del Rio 2004-10-12, 3:57 am |
|
Bryce wrote:[color=darkred]
> On Mon, 11 Oct 2004 15:53:03 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
so every time you compile an app you first specify class path in command
line?? isn't this kind of a pain?? here at home I have only PATH set,
and I never have to set path in command line.. (which is how it was also
at work until about three days ago, when mysteriously things stopped
working there..) again thank you for your help... Frances
| |
| Paul Lutus 2004-10-12, 3:57 am |
| Frances Del Rio wrote:
> Bryce wrote:
/ ...
>
> so every time you compile an app you first specify class path in command
> line??
That is not what he said. Ordinarily you do not have to do this. Only rarely
is this necessary to achieve a particular result.
In general, you should be able to invoke the compiler and runtime without
any arguments beyond the file or class name.
--
Paul Lutus
http://www.arachnoid.com
| |
| Frances Del Rio 2004-10-12, 3:57 am |
|
Paul Lutus wrote:
> Frances Del Rio wrote:
>
>
> / ...
>
>
> That is not what he said. Ordinarily you do not have to do this. Only rarely
> is this necessary to achieve a particular result.
>
> In general, you should be able to invoke the compiler and runtime without
> any arguments beyond the file or class name.
I know, this is what I have been doing all along..
so: following instructions on java.sun I set PATH, just like Bryce said
you have to do..
C:\Documents and Settings\fdelrio\My Documents>cd myjava
(where my java apps are..)
C:\Documents and Settings\fdelrio\My Documents\myjava>javac hamlet.java
C:\Documents and Settings\fdelrio\My Documents\myjava>java hamlet
at it runs fine.. this was also the case at work until just a few days
ago...
at work I have, in addition to PATH, env var CLASSPATH, don't know where
that came from.. but, as Bryce said, I will get rid of it.. and
attempt again tomorrow to copy PATH settings from here (home) to machine
at work, if this doesn't work will have to download and install SDK/JRE
again.. thank you again for your help, Paul..
| |
| Frances Del Rio 2004-10-12, 3:57 am |
|
Bryce wrote:
> On Mon, 11 Oct 2004 16:53:52 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> CLASSPATH? That looks more like your PATH variable.
>
> I don't even have a CLASSPATH variable in my environment. I would get
> rid of your CLASSPATH and make sure you have a PATH.
ok, here's where I got the CLASSPATH thing.. has to do w/tomcat:
http://www.coreservlets.com/Apache-.../#Set-CLASSPATH
and you know, I can't even run servelets on tomcat (yes, can run JSP's,
but not servlets, but that's for another post/thread.. for when I move
on to JSP.. oh man..........) thanks again..... Frances
| |
| andreas kinell 2004-10-12, 3:57 am |
| > attempt again tomorrow to copy PATH settings from here (home) to machine
> at work, if this doesn't work will have to download and install SDK/JRE
> again.. thank you again for your help, Paul..
NO! do not copy your PATH variable from one pc to another. please read my
first
post, it should make some things clear about PATH and CLASSPATH.
also, i have given some hints how to further localize your problem.
andreas
| |
| Chris Smith 2004-10-12, 3:57 am |
| Frances Del Rio wrote:
> Bryce, thank you for your help.. here what I have under CLASSPATH:
>
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\tom
cat\bin
>
> (dir in which my SDK/JRE is in is called 'java', i.e., path to it is
> c:\java...)
That's the problem. You need a "." in your classpath, if you wish to
set it at all. Otherwise, Java doesn't look for classes in the current
directory. Since you were trying to run a class that's in the current
directory, there are going to be problems.
Incidentally, you almost certainly don't need most of that stuff. You
can probably remove everything from your classpath entirely, since it is
unlikely there are any Java classes in any of those directories anyway.
Since that's the case, the simplest answer is to unset the CLASSPATH
variable entirely. If you don't specify CLASSPATH, then it defaults to
".", which is exactly what you need.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
| |
| Tor Iver Wilhelmsen 2004-10-12, 3:57 am |
| Xref: number1.nntp.dca.giganews.com comp.lang.java.help:253727
Frances Del Rio <fdr58@yahoo.com> writes:
> C:\Documents and Settings\fdelrio\My Documents\myjava>java hamlet
> Exception in thread "main" java.lang.NoClassDefFoundError: hamlet
The current directory is not default included in the classpath. You
need to do
java -classpath . hamlet
| |
|
| On Mon, 11 Oct 2004 21:52:38 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>
>Bryce wrote:
>
>
>ok, I'm totally now, you said earlier CLASSPATH is where Java
>looks for classes, PATH is where ... ok, this is what you said:
>
> Note, Microsoft Windows looks for programs,
> not Java looks for programs.
>
> Classpath is where JAVA looks for classes.
>
>why do we deal at all here w/what Windows does??? "path" seems to me a
>very generic thing..
>
Because, when you are at the command line, and type javac .... Its
Windows that interprets the command line, and calls the program. It
calls the program by first looking in the current directory, then it
follows the PATH environment variable looking for a program called
javac.
Now, once javac is executing by Windows, its up to javac to do its
stuff.
CLASSPATH and PATH are two TOTALLY seperate entities. Its like that in
Linux too. Linux has a PATH variable that is the same thing.
Java uses CLASSPATH to find classes. This is NOT and should NOT be the
same as the PATH variable for what should be obvious reasons.
Now, if you don't specify a CLASSPATH variable, then Java is going to
use its standard system libraries. Its generally best practice to only
specify the classpath at compile/runtime.
javac -classpath <class search path for jars and classes> <Source
File(s)>
or java -cp <class search path for jars and classes> <class file>
If you are debugging this, here's what I'd do. Create a
HelloWorld.java file:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello");
}
}
On your command line, attempt to compile and run it. The above file
should not require any additional classes to be in your CLASSPATH. If
that runs, try your more complex program.
>why not just CLASSPATH for Java?
See above.
>at any rate, am
>home now, where everythign works fine, and where I have all the same
>settings for everything (same location for SDK/JRE, same version of same
>at home and at work, same OP (W2k), etc.. and at home have the
>following under PATH:
>
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\jav
a\bin;C:\tomcat\bin
>
>this morning I copied this under PATH at work and still it wouldn't
>work.. and at home indeed have no CLASSPATH.. don't know how that one
>got there at work.. I think I will have to download and install SDK/JRE
>again, simply have no idea what happened here.. ok, Bryce.. thank you
>very much for your help... Frances
Remember
PATH - OS's path to search for executables.
CLASSPATH - Java's path to search for classes. It can contain paths to
jar files or folders containing class files.
Example of a classpath:
java -cp c:/mylibs/mylib.jar;c:/myprojects/bin
--
now with more cowbell
| |
|
| On Mon, 11 Oct 2004 23:19:19 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>ok, here's where I got the CLASSPATH thing.. has to do w/tomcat:
>http://www.coreservlets.com/Apache-.../#Set-CLASSPATH
>
>and you know, I can't even run servelets on tomcat (yes, can run JSP's,
>but not servlets, but that's for another post/thread.. for when I move
>on to JSP.. oh man..........) thanks again..... Frances
The key point in that article is this:
" The server already knows about the servlet classes, but the compiler
(i.e., javac) you use for development probably doesn't. "
What does this mean? Well, you don't need to specify a classpath for
the servlet container because it already knows where to find the
classes it needs.
But if you are developing servlets, your compiler needs to know where
to find the libraries for it to build your classes (JSPs are compiled
by the servlet container, usually, so it doesn't apply to them).
A couple of examples.
Lets say I have the following simple servlet:
public class TestServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
// do some servlet stuff in here.
}
}
1. Command Line: If you attempt to compile this just typing
javac TestServlet
You will get many errors, mainly that
"HttpServlet cannot be resolved or is not a valid superclass"
This is because it needs the Servlet API libraries to compile, which
isn't included in the standard J2SE distribution. If you are using
Tomcat, the libraries are in its common/lib directory. Specifically,
you will need the servlet.jar.
So, now, if we type:
javac -classpath d:/tomcat/common/lib/servlet.jar TestServlet.jar
It should compile fine (assuming your tomcat lives in d:/tomcat).
2. IDE: If you are using an IDE, such as Eclipse, all you have to do
is edit your project to add the servlet.jar file. In eclipse, you
right-click on your project, go to Properties -> Java Build Path ->
Libraries. Click the button Add External Jars, browse to servlet.jar,
and click ok. Everything should build fine.
NOTE: All we have done now is compile. To run in Tomcat, all we have
to do is setup or webapp, copy our class to the WEB-INF/classes
folder, setup our web.xml file defining our servlet, and thats it.
Since Tomcat knows about servlet.jar, there's no need to include it
anywhere.
I hope this helps.
--
now with more cowbell
| |
|
| On Mon, 11 Oct 2004 22:23:38 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>
>Bryce wrote:
>
>so every time you compile an app you first specify class path in command
>line?? isn't this kind of a pain??
No. Because either I setup my IDE to include it in the project, or I
create a .bat or .sh file to run it.
>here at home I have only PATH set,
>and I never have to set path in command line.. (which is how it was also
>at work until about three days ago, when mysteriously things stopped
>working there..) again thank you for your help... Frances
--
now with more cowbell
| |
|
| On Mon, 11 Oct 2004 23:11:58 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>at work I have, in addition to PATH, env var CLASSPATH, don't know where
>that came from.. but, as Bryce said, I will get rid of it.. and
>attempt again tomorrow to copy PATH settings from here (home) to machine
>at work, if this doesn't work will have to download and install SDK/JRE
>again.. thank you again for your help, Paul..
I was just stating that in general, you shouldn't need a global
environment variable named CLASSPATH.
PATH, on the other hand, is probably going to be different between
machines, therefor, its not likely you will want to copy it form
another machine. Just check your PATH settings to make sure your
java/bin directory is in there, so you can type 'java' on the command
line as opposed to c:\jdk1.4.2_02\bin\java. Other than that, leave
your PATH variable alone. Other programs may break if you alter it
without knowing what you are doing.
--
now with more cowbell
| |
| Frances Del Rio 2004-10-12, 3:59 pm |
| Bryce wrote:
> On Mon, 11 Oct 2004 23:11:58 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> I was just stating that in general, you shouldn't need a global
> environment variable named CLASSPATH.
>
> PATH, on the other hand, is probably going to be different between
> machines, therefor, its not likely you will want to copy it form
> another machine. Just check your PATH settings to make sure your
> java/bin directory is in there, so you can type 'java' on the command
> line as opposed to c:\jdk1.4.2_02\bin\java. Other than that, leave
> your PATH variable alone. Other programs may break if you alter it
> without knowing what you are doing.
Bryce, I downloaded and installed SDK/JRE again.. now it's working
again.. but: NOW MY TOMCAT ISN'T WORKING!! man.. this never ends..
just read up on the instructions for setting up Tomcat I used initially
(http://www.onjava.com/pub/a/onjava/...9/tomcat.html.. you know,
to set JAVA_HOME and TOMCAT_HOME env vars.. all I changed this time is
that SDK/JRE folder I left w/orig name (also following yr advice I
deleted CLASSPATH env var, but not sure this has anything to do w/it, at
home don't have CLASSPATH env var and Tomcat AND java compiler/runner
work fine..) ok, so now I have:
PATH:
%SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\j2s
dk1.4.2_06\bin;C:\tomcat\bin
JAVA_HOME: c:\j2sdk1.4.2_06
TOMCAT_HOME: c:\tomcat
and restarted, and still tomcat won't work.. I just love this...
again, many many thanks for all yr help.. Frances
| |
| Frances Del Rio 2004-10-12, 3:59 pm |
| Bryce, when I said Tomcat isn't working I meant can't run it at all,
don't see what I'm sup. to see in browser when I go to localhost, and
doesn't come on when I run startup.bat.. (haven't even tried to compile
servlets yet.. that's for a whole other headache....;).. I just need to
make sure my tomcat is always running right b/c I don't want to have to
deal w/it when I move on to JSP's.. (pretty soon, I hope, if I can solve
all these problems..)) again, needless to say, your help is very much
appreciated... Frances
Frances Del Rio wrote:
> Bryce wrote:
>
>
>
> Bryce, I downloaded and installed SDK/JRE again.. now it's working
> again.. but: NOW MY TOMCAT ISN'T WORKING!! man.. this never ends..
> just read up on the instructions for setting up Tomcat I used initially
> (http://www.onjava.com/pub/a/onjava/...9/tomcat.html.. you know,
> to set JAVA_HOME and TOMCAT_HOME env vars.. all I changed this time is
> that SDK/JRE folder I left w/orig name (also following yr advice I
> deleted CLASSPATH env var, but not sure this has anything to do w/it, at
> home don't have CLASSPATH env var and Tomcat AND java compiler/runner
> work fine..) ok, so now I have:
>
> PATH:
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\j2s
dk1.4.2_06\bin;C:\tomcat\bin
>
> JAVA_HOME: c:\j2sdk1.4.2_06
> TOMCAT_HOME: c:\tomcat
>
> and restarted, and still tomcat won't work.. I just love this...
>
> again, many many thanks for all yr help.. Frances
>
| |
|
| On Tue, 12 Oct 2004 14:42:29 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>PATH:
> %SystemRoot%\system32;%SystemRoot%;%Syst
emRoot%\System32\Wbem;C:\java\bin;C:\j2s
dk1.4.2_06\bin;C:\tomcat\bin
>JAVA_HOME: c:\j2sdk1.4.2_06
>TOMCAT_HOME: c:\tomcat
>
>and restarted, and still tomcat won't work.. I just love this...
>
>again, many many thanks for all yr help.. Frances
I don't understand "tomcat won't work". What's the error you are
getting?
--
now with more cowbell
| |
|
| On Tue, 12 Oct 2004 14:55:54 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>Bryce, when I said Tomcat isn't working I meant can't run it at all,
>don't see what I'm sup. to see in browser when I go to localhost, and
>doesn't come on when I run startup.bat..
what happens? Does a dos window come up then disappear?
What version of Tomcat did you download?
>(haven't even tried to compile
>servlets yet.. that's for a whole other headache....;)..
Thats good. Always try to simplify your problem first, then add
complexity.
>I just need to
>make sure my tomcat is always running right b/c I don't want to have to
>deal w/it when I move on to JSP's.. (pretty soon, I hope, if I can solve
>all these problems..)) again, needless to say, your help is very much
>appreciated... Frances
--
now with more cowbell
| |
| Frances Del Rio 2004-10-12, 8:57 pm |
|
Bryce wrote:
> On Tue, 12 Oct 2004 14:55:54 -0400, Frances Del Rio <fdr58@yahoo.com>
> wrote:
>
>
>
>
> what happens? Does a dos window come up then disappear?
yes, this is exactly what happens.. you know, when I first dl'd tomcat
it took me about two w s to figure out how to set it up, and this is
exactly what happened all the time before I finally managed to set it up
successfully...
> What version of Tomcat did you download?
5.0.27
I really hope I don't have to dl tomcat again, and configure all those
xml's again.. but of course this now has nothing to do w/tomcat.. I
hadn't touched it in w s..
again, many thanks for your help..
| |
| William Brogden 2004-10-13, 4:00 pm |
| On Tue, 12 Oct 2004 17:07:13 -0400, Frances Del Rio <fdr58@yahoo.com>
wrote:
>
>
> Bryce wrote:
>
>
> yes, this is exactly what happens.. you know, when I first dl'd tomcat
> it took me about two w s to figure out how to set it up, and this is
> exactly what happened all the time before I finally managed to set it up
> successfully...
>
>
> 5.0.27
>
> I really hope I don't have to dl tomcat again, and configure all those
> xml's again.. but of course this now has nothing to do w/tomcat.. I
> hadn't touched it in w s..
>
> again, many thanks for your help..
>
If you get a window that opens and closes before you can see what went
wrong, change the line in startup.bat that now reads:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
to
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
This will run catalina.bat in the same window.
That way when you execute startup.bat from a command window the
window will stay open and you can see the last output when tomcat
fails
Bill
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
| |
|
| On Wed, 13 Oct 2004 08:03:56 -0500, "William Brogden"
<wbrogden@bga.com> wrote:
>If you get a window that opens and closes before you can see what went
>wrong, change the line in startup.bat that now reads:
>call "%EXECUTABLE%" start %CMD_LINE_ARGS%
>to
>call "%EXECUTABLE%" run %CMD_LINE_ARGS%
>
>This will run catalina.bat in the same window.
>That way when you execute startup.bat from a command window the
>window will stay open and you can see the last output when tomcat
>fails
>Bill
Thank you Bill. This is what I was trying to look up. Like Bill said,
make sure you run this from a command line, instead of just double
clicking startup.bat. that way, when Tomcat exits, the DOS window
won't disappear.
--
now with more cowbell
| |
| Tony Morris 2004-10-14, 4:00 pm |
| Unset your CLASSPATH (it should NOT - repeat NOT - be set).
Rename your directory back.
--
Tony Morris
http://xdweb.net/~dibblego/
|
|
|
|
|