You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Galon, Mary-Jay" <Ga...@daugherty.com> on 2001/04/24 20:14:54 UTC

Thread error....WHY?

Im sending to both groups for maximized feedback.

I am executing a compiled Xalan sample and getting an error.  Does anyone
know why I could be getting "thread" issues.


----------------------------------------------------------------------------
--
REVISED CLASSPATH (i re-installed jdk to root drive instead of under Program
Files):
d:\jdk1.3;d:\jdk1.3\bin;d:\jsdkee1.3;d:\ant\lib\ant.jar;D:\Progra~1\junit3.6
;d:\xalan\xalan.jar;d:\xalan\xerces.jar



COMMAND CODE MSG:
D:\XALAN\SAMPLES\SIMPLE~1>javac SimpleTransform.java

D:\XALAN\SAMPLES\SIMPLE~1>java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTransform

D:\XALAN\SAMPLES\SIMPLE~1>

RE: Thread error....WHY?

Posted by Owen Taylor <ow...@customware.com>.
It is a good idea to add . ( current directory ) to your CLASSPATH -also get
in the habit of compiling your classes so that any required package
structure is created properly.  You do this by specifying an output
directory for the javac command.

If you wanted to compile the class starting from the current directory:
 not my favorite technique )

D:\XALAN\SAMPLES\SIMPLE~1>javac -d . SimpleTransform.java

If you wanted to compile the class into an established directory which is
already a part of your classpath:   ( My favorite technique )
if CLASSPATH were:

d:\jdk1.3;d:\jdk1.3\bin;d:\jsdkee1.3;d:\ant\lib\ant.jar;D:\Progra~1\junit3.6
;d:\xalan\xalan.jar;d:\xalan\xerces.jar;d:\testClasses

D:\XALAN\SAMPLES\SIMPLE~1>javac -d d:\testClasses SimpleTransform.java

ALWAYS pass the fully-qualified package name and class name to the java
command:

example package name ==  com.fred.stuff
class name  == SomeClass

command line used to run that class:

d:\>java com.fred.stuff.SomeClass

If you do not do one of the above, make sure you have navigated to the
directory from which your interesting root package name directory has been
created.

example:

your java source has a package declaration of:

package fred;

You compile using javac as shown in your email:

D:\XALAN\SAMPLES\fred>javac Example.java

You would then have to navigate up the directory tree to the directory that
contained fred ( the root package name ) before attempting to invoke java
with that class as the argument:

D:\XALAN\SAMPLES\fred>cd..

D:\XALAN\SAMPLES>java fred.Example

( also note the fully-qualified package name and classname is what is passed
to the java command )

HTH

Owen.




-----Original Message-----
From: Galon, Mary-Jay [mailto:Galon@daugherty.com]
Sent: Tuesday, April 24, 2001 2:15 PM
To: Tomcat (E-mail); Struts-User@Jakarta. Apache. Org (E-mail)
Subject: Thread error....WHY?


Im sending to both groups for maximized feedback.

I am executing a compiled Xalan sample and getting an error.  Does anyone
know why I could be getting "thread" issues.


----------------------------------------------------------------------------
--
REVISED CLASSPATH (i re-installed jdk to root drive instead of under Program
Files):
d:\jdk1.3;d:\jdk1.3\bin;d:\jsdkee1.3;d:\ant\lib\ant.jar;D:\Progra~1\junit3.6
;d:\xalan\xalan.jar;d:\xalan\xerces.jar



COMMAND CODE MSG:
D:\XALAN\SAMPLES\SIMPLE~1>javac SimpleTransform.java

D:\XALAN\SAMPLES\SIMPLE~1>java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTransform

D:\XALAN\SAMPLES\SIMPLE~1>


RE: Thread error....WHY?

Posted by Owen Taylor <ow...@customware.com>.
It is a good idea to add . ( current directory ) to your CLASSPATH -also get
in the habit of compiling your classes so that any required package
structure is created properly.  You do this by specifying an output
directory for the javac command.

If you wanted to compile the class starting from the current directory:
 not my favorite technique )

D:\XALAN\SAMPLES\SIMPLE~1>javac -d . SimpleTransform.java

If you wanted to compile the class into an established directory which is
already a part of your classpath:   ( My favorite technique )
if CLASSPATH were:

d:\jdk1.3;d:\jdk1.3\bin;d:\jsdkee1.3;d:\ant\lib\ant.jar;D:\Progra~1\junit3.6
;d:\xalan\xalan.jar;d:\xalan\xerces.jar;d:\testClasses

D:\XALAN\SAMPLES\SIMPLE~1>javac -d d:\testClasses SimpleTransform.java

ALWAYS pass the fully-qualified package name and class name to the java
command:

example package name ==  com.fred.stuff
class name  == SomeClass

command line used to run that class:

d:\>java com.fred.stuff.SomeClass

If you do not do one of the above, make sure you have navigated to the
directory from which your interesting root package name directory has been
created.

example:

your java source has a package declaration of:

package fred;

You compile using javac as shown in your email:

D:\XALAN\SAMPLES\fred>javac Example.java

You would then have to navigate up the directory tree to the directory that
contained fred ( the root package name ) before attempting to invoke java
with that class as the argument:

D:\XALAN\SAMPLES\fred>cd..

D:\XALAN\SAMPLES>java fred.Example

( also note the fully-qualified package name and classname is what is passed
to the java command )

HTH

Owen.




-----Original Message-----
From: Galon, Mary-Jay [mailto:Galon@daugherty.com]
Sent: Tuesday, April 24, 2001 2:15 PM
To: Tomcat (E-mail); Struts-User@Jakarta. Apache. Org (E-mail)
Subject: Thread error....WHY?


Im sending to both groups for maximized feedback.

I am executing a compiled Xalan sample and getting an error.  Does anyone
know why I could be getting "thread" issues.


----------------------------------------------------------------------------
--
REVISED CLASSPATH (i re-installed jdk to root drive instead of under Program
Files):
d:\jdk1.3;d:\jdk1.3\bin;d:\jsdkee1.3;d:\ant\lib\ant.jar;D:\Progra~1\junit3.6
;d:\xalan\xalan.jar;d:\xalan\xerces.jar



COMMAND CODE MSG:
D:\XALAN\SAMPLES\SIMPLE~1>javac SimpleTransform.java

D:\XALAN\SAMPLES\SIMPLE~1>java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTransform

D:\XALAN\SAMPLES\SIMPLE~1>