avatar
c*u
1
I am trying to use ant to compile jwsdp's sample code. I've
installed jwsdp, set up environment variables and path, however
when I try "ant build" in the example code directory, it always
gives Exception in thread "main" java.lang.NoClassDefFoundError: and.
Can anybody give me some hints on how to fix this problem?
avatar
g*g
2
Make sure you have setup JAVAHOME ...

【在 c****u 的大作中提到】
: I am trying to use ant to compile jwsdp's sample code. I've
: installed jwsdp, set up environment variables and path, however
: when I try "ant build" in the example code directory, it always
: gives Exception in thread "main" java.lang.NoClassDefFoundError: and.
: Can anybody give me some hints on how to fix this problem?

avatar
m*c
3

Not JAVAHOME, it should be JAVA_HOME
Windows:
C:\...\> set JAVA_HOME=...
C:\...\> set ANT_HOME=...
C:\...\> set PATH=%JAVA_HOME%\bin;%JAVA_HOME%\bin;%PATH%
C:\...\> ant build
Unix (bash):
$ export JAVA_HOME=...
$ export ANT_HOME=...
$ export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
$ ant build

【在 g*****g 的大作中提到】
: Make sure you have setup JAVAHOME ...
avatar
c*u
4
I've set up all of them. Ant still doesn't work!

【在 m**c 的大作中提到】
:
: Not JAVAHOME, it should be JAVA_HOME
: Windows:
: C:\...\> set JAVA_HOME=...
: C:\...\> set ANT_HOME=...
: C:\...\> set PATH=%JAVA_HOME%\bin;%JAVA_HOME%\bin;%PATH%
: C:\...\> ant build
: Unix (bash):
: $ export JAVA_HOME=...
: $ export ANT_HOME=...

avatar
w*t
5
which version of ant and what jdk verson you use? and on windows?

【在 c****u 的大作中提到】
: I've set up all of them. Ant still doesn't work!
avatar
c*u
6
jdk 1.4.2,
ant 1.5.1,
windows xp.

【在 w******t 的大作中提到】
: which version of ant and what jdk verson you use? and on windows?
avatar
w*t
7
weird - it should be very simple to set up ant
I believe you tried
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%
in your script,
maybe you can try set enviroment varibale through control panel? (just a try)
on the other hand, are you sure error is caused by ant not properly set up or
ant work fine but cannot find the files need to compile?
try to delete everything and re-unzip etc to a new dir and set ant_home, path
etc and try again - that's the last suggestion I can think of - if not work,
yo

【在 c****u 的大作中提到】
: jdk 1.4.2,
: ant 1.5.1,
: windows xp.

avatar
e*g
8

let me guess, you have 'C:\Documents and Settings' somewhere in the paths.
then, the cmd line will be like
java -classpath C:\Documents and Settings\blah org.apache.tools.ant.Main
as far as java is concerned, "and" is the main class name,
everything follows are arguments.

【在 c****u 的大作中提到】
: I am trying to use ant to compile jwsdp's sample code. I've
: installed jwsdp, set up environment variables and path, however
: when I try "ant build" in the example code directory, it always
: gives Exception in thread "main" java.lang.NoClassDefFoundError: and.
: Can anybody give me some hints on how to fix this problem?

avatar
c*u
9
yeah! Admire, thanks a lot! You are really a good guesser:)

【在 e***g 的大作中提到】
:
: let me guess, you have 'C:\Documents and Settings' somewhere in the paths.
: then, the cmd line will be like
: java -classpath C:\Documents and Settings\blah org.apache.tools.ant.Main
: as far as java is concerned, "and" is the main class name,
: everything follows are arguments.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。