By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

xalan

P: n/a
Hi all

ok i am not a java programmer I am a sys-admin, my users want xalan and have
already got j2sdk_1.4.2

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan
-j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar:/
usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar

But the samples all return the same error
[root@unix1 SimpleTransform]# java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError:
SimpleTransform
[root@unix1 SimpleTransform]#

does anyone have a clue where i am going wrong. It does not exactly look
like a complex thing to install

Thanks

Dav
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
SimpleTransform is a class in xalansamples.jar right?

You don't want to add xalansamples.jar the the classpath (the other xalan
jars you do want to).
Because xalansamples.jar isn't a library (other java programs won't use it),
it's just a sample that uses the xalan library.

So you want to run SimpleTransform.class, which is a class inside
xalansamples.jar.
It might be something similar as this in a directory with that jar:
java xalansamples.jar?org.apache...SimpleTransform
Check the java command properties, I forgot how to run a file from a jar.
Might be a $ intead of ?

--
wkr,
Geoffrey
"al dav" <al****@bigfoot.com> schreef in bericht
news:br**********@jura.cc.ic.ac.uk...
Hi all

ok i am not a java programmer I am a sys-admin, my users want xalan and have already got j2sdk_1.4.2

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan -j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar :/ usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar

But the samples all return the same error
[root@unix1 SimpleTransform]# java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError:
SimpleTransform
[root@unix1 SimpleTransform]#

does anyone have a clue where i am going wrong. It does not exactly look
like a complex thing to install

Thanks

Dav

Jul 17 '05 #2

P: n/a

"al dav" <al****@bigfoot.com> wrote in message
news:br**********@jura.cc.ic.ac.uk...
Hi all

ok i am not a java programmer I am a sys-admin, my users
want xalan and have already got j2sdk_1.4.2

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:
/usr/local/java/xalan-j_2_5_2/bin/xml-apis.jar:/usr/local/
java/xalan-j_2_5_2/bin/xercesImpl.jar:/
usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar

But the samples all return the same error
[root@unix1 SimpleTransform]# java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError:
SimpleTransform
[root@unix1 SimpleTransform]#

does anyone have a clue where i am going wrong. It does
not exactly look like a complex thing to install


This problem even catches the most seasoned professional out :) ! The remedy
is to include the current directory in the CLASSPATH, like so:

...
CLASS_PATH=.:/usr/local/java/...etc ...
...

and, hopefully, SimpleTransform.class will be found :) !

Actually, being a *NIX sys-admin you'll appreciate the same problem with
users [unsuccessfully] launching their shell scripts by typing in:

myscript.sh

instead of:

./myscript.sh

I hope this helps.

Anthony Borla
Jul 17 '05 #3

P: n/a
al dav wrote:
Hi all

ok i am not a java programmer I am a sys-admin, my users want xalan and have
already got j2sdk_1.4.2

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan
-j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar:/
usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar

But the samples all return the same error
[root@unix1 SimpleTransform]# java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError:
SimpleTransform
[root@unix1 SimpleTransform]#

does anyone have a clue where i am going wrong. It does not exactly look
like a complex thing to install


Ouch! The solution is too simple....

Use CLASSPATH instead of CLASS_PATH.

Ray

Jul 17 '05 #4

P: n/a

"Raymond DeCampo" <rd******@spam-I-am-not.twcny.rr.com> wrote in message
news:j2*****************@twister.nyroc.rr.com...

al dav wrote:
Hi all

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan

-j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar

:/ usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar


Ouch! The solution is too simple....

Use CLASSPATH instead of CLASS_PATH.


Ay caramba - a case of the blind leading the blind ! Me thinks I'll have to
go for that eye test after all :) !

Cheers,

Anthony Borla

P.S.

I *really* hope the OP has solved this one by now !
Jul 17 '05 #5

P: n/a
ah, you need to set CLASSPATH and not CLASS_PATH

Also make sure you are using fully qualified name of the class, It might be
org.apache.xalan.example.SimpleTransform

For example in the Exception you have posted
Fully qualified name of NoClassDefFoundError is
"java.lang.NoClassDefFoundError"

and on the file system or jar file it will be placed like this

java/lang/NoClassDefFoundError.class

If you were to run it you would do

java java.lang.NoClassDefFoundError

and not

java NoClassDefFoundError
Hope that helps.

cheers.
"al dav" <al****@bigfoot.com> wrote in message
news:br**********@jura.cc.ic.ac.uk...
Hi all

ok i am not a java programmer I am a sys-admin, my users want xalan and have already got j2sdk_1.4.2

so i have downloaded it and set the CLASS_PATH

export
CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan -j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar :/ usr/local/java/xalan-j_2_5_2/bin/xalansamples.jar

But the samples all return the same error
[root@unix1 SimpleTransform]# java SimpleTransform
Exception in thread "main" java.lang.NoClassDefFoundError:
SimpleTransform
[root@unix1 SimpleTransform]#

does anyone have a clue where i am going wrong. It does not exactly look
like a complex thing to install

Thanks

Dav

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.