You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dan MacKay <da...@kingston.hummingbird.com> on 2000/12/06 15:14:40 UTC

Ant on Linux

Hi all,

I have been trying with not much success to get Ant up and running on Linux
(Mandrake 7.2). Is there any special differences between Windows and Linux
that I should be aware of? I have been running Ant quite successfully on NT
for a while now. I have a requirement to set up a Linux build environment
and hence the problem.

Thanks in advance,

Dan MacKay

RE: Ant on Linux

Posted by Peter Donald <do...@apache.org>.
At 11:11  6/12/00 -0500, you wrote:
>Hi Weigi,
>
>Here is what I have done and the setup I have:
>
>I logged in as root and installed
>	ant in /usr/local/bin/ant from the latest jakarta-ant-bin.tar.gz
>	jaxp in /usr/local/jaxp1.0.1
>
>This is the .bash_profile:
>
>PATH=$PATH:$HOME/jtest/bin:$HOME/bin:/usr/local/jdk1.3
>BASH_ENV=$home/.bashrc
>USERNAME=""
>
>ANT_HOME=/usr/local/bin/ant
>JAVA_HOME=/usr/local/jdk1.3
>XML_HOME=/usr/local/jaxp1.0.1
>
>CLASSPATH=$CLASSPATH:/usr/local/bin/junit3/junit.jar:$XML_HOME/jaxp.jar:$XML
>_HOME/parser.jar
>
>and then I export all the variables
>
>When I attempt to run ant I consistently get the following error:
>
>Couldn't find or load essential class 'java/lang/object'
>java.lan.NoClassDefFoundError java/lang/object
>usr/local/bin/ant/bin: line 1411 aborted
>
>Any ideas would be appreciated.

One possibility is that you are using kaffe compiler/interpreter instead of
sun/ibm/whatevers version. To make sure you are not try java -version or
looking in RPM DB to see if you have kaffe installed. If it is installed
then remove it and try again ;)

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Re: Ant on Linux

Posted by Stefan Bodewig <bo...@apache.org>.
Bill Burton <bi...@progress.com> wrote:

> Hi Dan,
> 
> IMHO, the ant batch and shell scripts have a bug in them.  You can
> set JAVA_HOME and instead of the ant script running
> $JAVA_HOME/bin/java as you would expect, it happily runs whatever
> java executable it finds first in the PATH which might not be the
> one you expect.

They had, they are fixed in CVS. Just that you there is hope 8-)

Stefan

RE: Ant on Linux

Posted by Conor MacNeill <co...@ebinteractive.com.au>.
Bill,

This has been changed in CVS

Conor

--
Conor MacNeill
conor@cortexebusiness.com.au
Cortex eBusiness
http://www.cortexebusiness.com.au

> -----Original Message-----
> From: Bill Burton [mailto:billb@progress.com]
> Sent: Thursday, 7 December 2000 5:09
> To: ant-user@jakarta.apache.org
> Subject: Re: Ant on Linux
>
>
> Hi Dan,
>
> IMHO, the ant batch and shell scripts have a bug in them.  You can set
> JAVA_HOME and instead of the ant script running $JAVA_HOME/bin/java as you
> would expect, it happily runs whatever java executable it finds first in
> the PATH which might not be the one you expect.
>
> In your .bashrc after setting JAVA_HOME try adding:
>   export JAVACMD=$JAVA_HOME/bin/java
> The ant script will now run whatever java executable is exported as
> JAVACMD and will not run whatever java executable it finds first in the
> PATH.
>
> -Bill Burton
>
> Dan MacKay wrote:
> >
> > Hi Weigi,
> >
> > Here is what I have done and the setup I have:
> >
> > I logged in as root and installed
> >         ant in /usr/local/bin/ant from the latest jakarta-ant-bin.tar.gz
> >         jaxp in /usr/local/jaxp1.0.1
> >
> > This is the .bash_profile:
> >
> > PATH=$PATH:$HOME/jtest/bin:$HOME/bin:/usr/local/jdk1.3
> > BASH_ENV=$home/.bashrc
> > USERNAME=""
> >
> > ANT_HOME=/usr/local/bin/ant
> > JAVA_HOME=/usr/local/jdk1.3
> > XML_HOME=/usr/local/jaxp1.0.1
> >
> >
> CLASSPATH=$CLASSPATH:/usr/local/bin/junit3/junit.jar:$XML_HOME/jax
> p.jar:$XML
> > _HOME/parser.jar
> >
> > and then I export all the variables
> >
> > When I attempt to run ant I consistently get the following error:
> >
> > Couldn't find or load essential class 'java/lang/object'
> > java.lan.NoClassDefFoundError java/lang/object
> > usr/local/bin/ant/bin: line 1411 aborted
> >
> > Any ideas would be appreciated.
> >
> > Thanks,
> >
> > Dan
>


Re: Ant on Linux

Posted by Bill Burton <bi...@progress.com>.
Hi Dan,

IMHO, the ant batch and shell scripts have a bug in them.  You can set
JAVA_HOME and instead of the ant script running $JAVA_HOME/bin/java as you
would expect, it happily runs whatever java executable it finds first in
the PATH which might not be the one you expect.

In your .bashrc after setting JAVA_HOME try adding:
  export JAVACMD=$JAVA_HOME/bin/java
The ant script will now run whatever java executable is exported as
JAVACMD and will not run whatever java executable it finds first in the
PATH.

-Bill Burton

Dan MacKay wrote:
> 
> Hi Weigi,
> 
> Here is what I have done and the setup I have:
> 
> I logged in as root and installed
>         ant in /usr/local/bin/ant from the latest jakarta-ant-bin.tar.gz
>         jaxp in /usr/local/jaxp1.0.1
> 
> This is the .bash_profile:
> 
> PATH=$PATH:$HOME/jtest/bin:$HOME/bin:/usr/local/jdk1.3
> BASH_ENV=$home/.bashrc
> USERNAME=""
> 
> ANT_HOME=/usr/local/bin/ant
> JAVA_HOME=/usr/local/jdk1.3
> XML_HOME=/usr/local/jaxp1.0.1
> 
> CLASSPATH=$CLASSPATH:/usr/local/bin/junit3/junit.jar:$XML_HOME/jaxp.jar:$XML
> _HOME/parser.jar
> 
> and then I export all the variables
> 
> When I attempt to run ant I consistently get the following error:
> 
> Couldn't find or load essential class 'java/lang/object'
> java.lan.NoClassDefFoundError java/lang/object
> usr/local/bin/ant/bin: line 1411 aborted
> 
> Any ideas would be appreciated.
> 
> Thanks,
> 
> Dan

Re: Ant on Linux

Posted by Stefan Bodewig <bo...@apache.org>.
Dan MacKay <da...@kingston.hummingbird.com> wrote:

> JAVA_HOME=/usr/local/jdk1.3

[...]

> Couldn't find or load essential class 'java/lang/object'
> java.lan.NoClassDefFoundError java/lang/object
> usr/local/bin/ant/bin: line 1411 aborted
> 
> Any ideas would be appreciated.

What does java -version give you? Unfortunately the shell script will
use the version of java from your PATH, not the one in JAVA_HOME. I
suspect you are running kaffee instead of the jdk1.3 you intend to
run.

Stefan

RE: Ant on Linux

Posted by Dan MacKay <da...@kingston.hummingbird.com>.
Hi Weigi,

Here is what I have done and the setup I have:

I logged in as root and installed
	ant in /usr/local/bin/ant from the latest jakarta-ant-bin.tar.gz
	jaxp in /usr/local/jaxp1.0.1

This is the .bash_profile:

PATH=$PATH:$HOME/jtest/bin:$HOME/bin:/usr/local/jdk1.3
BASH_ENV=$home/.bashrc
USERNAME=""

ANT_HOME=/usr/local/bin/ant
JAVA_HOME=/usr/local/jdk1.3
XML_HOME=/usr/local/jaxp1.0.1

CLASSPATH=$CLASSPATH:/usr/local/bin/junit3/junit.jar:$XML_HOME/jaxp.jar:$XML
_HOME/parser.jar

and then I export all the variables

When I attempt to run ant I consistently get the following error:

Couldn't find or load essential class 'java/lang/object'
java.lan.NoClassDefFoundError java/lang/object
usr/local/bin/ant/bin: line 1411 aborted

Any ideas would be appreciated.

Thanks,

Dan



> -----Original Message-----
> From: Weiqi Gao [mailto:weiqigao@networkusa.net]
> Sent: Wednesday, December 06, 2000 9:42 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: Ant on Linux
>
>
> > Dan MacKay wrote:
> >
> > I have been trying with not much success to get Ant up and running on
> > Linux (Mandrake 7.2). Is there any special differences between Windows
> > and Linux that I should be aware of? I have been running Ant quite
> > successfully on NT for a while now. I have a requirement to set up a
> > Linux build environment and hence the problem.
>
> I run Ant on Linux all the time.  What kind of problems are you running
> into?
>
> --
> Weiqi Gao
> weiqigao@networkusa.net
>


Re: Ant on Linux

Posted by Weiqi Gao <we...@networkusa.net>.
> Dan MacKay wrote:
> 
> I have been trying with not much success to get Ant up and running on
> Linux (Mandrake 7.2). Is there any special differences between Windows
> and Linux that I should be aware of? I have been running Ant quite
> successfully on NT for a while now. I have a requirement to set up a
> Linux build environment and hence the problem.

I run Ant on Linux all the time.  What kind of problems are you running
into?

--
Weiqi Gao
weiqigao@networkusa.net

Re: Ant on Linux

Posted by Stefan Bodewig <bo...@apache.org>.
Dan MacKay <da...@kingston.hummingbird.com> wrote:

> Hi all,
> 
> I have been trying with not much success to get Ant up and running
> on Linux (Mandrake 7.2). Is there any special differences between
> Windows and Linux that I should be aware of?

Apart from running bootstrap.sh instead of bootstrap.bat 8-)? No.

I have JAVA_HOME set to the root of my JDK and the bootstrap script
simply works out of the box (RedHat 6.2, regularily switching between
Blackdown's 1.1.8, IBM's and Sun's 1.3 and Blackdown's 1.2.2).

Could you post the error messages bootstrap.sh generates?

Stefan

RE: Ant on Linux

Posted by Conor MacNeill <co...@m64.com>.
Dan,

Not much to go on there. Can you give us more info? Could be a
line-ending problem if you moved stuff from your NT system directly but
I am only guessing.

Conor


-----Original Message-----
From: Dan MacKay [mailto:dan.mackay@kingston.hummingbird.com]
Sent: Thursday, 7 December 2000 1:15
To: ant-user@jakarta.apache.org
Subject: Ant on Linux


Hi all,

I have been trying with not much success to get Ant up and running on
Linux (Mandrake 7.2). Is there any special differences between Windows
and Linux that I should be aware of? I have been running Ant quite
successfully on NT for a while now. I have a requirement to set up a
Linux build environment and hence the problem.

Thanks in advance,

Dan MacKay