LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-12-2020, 07:30 PM   #1
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Rep: Reputation: 0
Post Ant does not work on LibreOffice installation


HI
i have this error when i try to compile LibreOffice 7 from slackbuilds.
i use oracle jdk14 on slackware current.

Code:
checking for ant... /usr/bin/ant
checking if /usr/share/ant/bin/ant works... configure: error: Ant does not work - Some Java projects will not build!
when i run ant
Code:
> $ ant -verbose                                                                     
Apache Ant(TM) version 1.9.14 compiled on March 12 2019
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed
what am i doing wrong?

Last edited by slacknedo; 09-12-2020 at 07:31 PM.
 
Old 09-15-2020, 04:13 AM   #2
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 724

Rep: Reputation: 92
I've successfully compiled LibreOffice 7.0 from SlackBuild.org on current with JDK11.

In the compile log I see

Quote:
checking for ant... /usr/bin/ant
checking if /usr/share/ant/bin/ant works... Ant works
checking Ant lib directory... Ant lib directory found.
checking whether Ant is >= 1.6.0... yes, 1.9.14

On the command line I see

Quote:
ant -verbose
Apache Ant(TM) version 1.9.14 compiled on March 12 2019
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed


It would appear what onfigure uses to determine whether ant works is this

Code:
ant -buildfile conftest.xml
where the contents of conftest.xml is

Quote:
<project name="conftest" default="conftest">
<target name="conftest">
<javac srcdir="." includes="conftest.java">
</javac>
</target>
</project>
give that a try.
 
Old 09-15-2020, 06:38 PM   #3
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Original Poster
Rep: Reputation: 0
ok, i use

Code:
ant -buildfile conftest.xml
with the contests you gave me
Code:
<project name="conftest" default="conftest">
<target name="conftest">
<javac srcdir="." includes="conftest.java">
</javac>
</target>
</project>
the result ant seems work fine
Code:
$ ant -buildfile conftest.xml                                                      
Buildfile: /home/nedosl/conftest.xml

conftest:
    [javac] /home/nedosl/conftest.xml:3: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

BUILD SUCCESSFUL
Total time: 0 seconds
Quote:
java --version

java 14.0.2 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
LibreOffice still gave error for ant

Last edited by slacknedo; 09-15-2020 at 06:40 PM.
 
Old 09-16-2020, 02:26 AM   #4
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 724

Rep: Reputation: 92
Quote:
LibreOffice still gave error for ant
What was the error?


In the xml file you're see reference to conftest.java

create conftest.java with


Code:
        
        public class conftest {
            int testmethod(int a, int b) {
                    return a + b;
            }
        }
Then try this again

Code:
ant -buildfile conftest.xml
 
Old 09-16-2020, 06:58 AM   #5
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
What was the error?
the error is this
Code:
checking for ant... /usr/bin/ant
checking if /usr/share/ant/bin/ant works... configure: error: Ant does not work - Some Java projects will not build!
i create the conftest.java and run ant
Code:
$ ant -buildfile conftest.xml                                                      
Buildfile: /home/nedosl/conftest.xml

conftest:
    [javac] /home/nedosl/conftest.xml:3: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file

BUILD SUCCESSFUL
Total time: 1 second
create conftest.class correctly
 
Old 09-16-2020, 07:53 AM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,129

Rep: Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991
Quote:
Originally Posted by slacknedo View Post
the error is this
Code:
checking for ant... /usr/bin/ant
checking if /usr/share/ant/bin/ant works... configure: error: Ant does not work - Some Java projects will not build!
Check the "config.log" file in the build directory to see if that gives more detail about what is actually going on. The above message is a symptom, not the cause.
 
Old 09-16-2020, 08:05 AM   #7
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 724

Rep: Reputation: 92
Find where your SlackBuild is building LibreOffice for me it is /tmp/SBo/libreoffice-7.0.0.3

Code:
cd /tmp/SBo/libreoffice-7.0.0.3
sh -x configure >/tmp/LibreOffice.log  2>&1

Search in the file /tmp/LibreOffice.log for the text export ANT_HOME. There should be a clue asto what's going wrong in the next 100 lines.
 
Old 09-16-2020, 10:34 AM   #8
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Original Poster
Rep: Reputation: 0
Code:
ANT='/usr/share/ant/bin/ant'
ANT_HOME=''
and
Code:
configure:39645: found /usr/bin/ant
configure:39657: result: /usr/bin/ant
configure:39739: checking if /usr/share/ant/bin/ant works
configure:39762: /usr/share/ant/bin/ant -buildfile conftest.xml 1>&2
Error: JAVA_HOME is not defined correctly.
  We cannot execute ../lib64/jdk14-14.0.2/bin/java
configure:39765: $? = 1
configure: Ant test failed
        public class conftest {
            int testmethod(int a, int b) {
                    return a + b;
            }
        }
        <project name="conftest" default="conftest">
        <target name="conftest">
            <javac srcdir="." includes="conftest.java">
            </javac>
        </target>
        </project>
configure:39782: error: Ant does not work - Some Java projects will not build!
my JAVA_HOME='../lib64/jdk14-14.0.2'

why is not correct ?
 
Old 09-16-2020, 11:29 AM   #9
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 787

Rep: Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513
Have you tried with Ant 1.10.8 and JDK 8u261?
 
Old 09-16-2020, 11:51 AM   #10
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,129

Rep: Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991
Quote:
Originally Posted by slacknedo View Post
Code:
ANT='/usr/share/ant/bin/ant'
ANT_HOME=''
and
Code:
configure:39645: found /usr/bin/ant
configure:39657: result: /usr/bin/ant
configure:39739: checking if /usr/share/ant/bin/ant works
configure:39762: /usr/share/ant/bin/ant -buildfile conftest.xml 1>&2
Error: JAVA_HOME is not defined correctly.
  We cannot execute ../lib64/jdk14-14.0.2/bin/java
configure:39765: $? = 1
configure: Ant test failed
        public class conftest {
            int testmethod(int a, int b) {
                    return a + b;
            }
        }
        <project name="conftest" default="conftest">
        <target name="conftest">
            <javac srcdir="." includes="conftest.java">
            </javac>
        </target>
        </project>
configure:39782: error: Ant does not work - Some Java projects will not build!
my JAVA_HOME='../lib64/jdk14-14.0.2'

why is not correct ?
JAVA_HOME should be an absolute path
 
Old 09-16-2020, 05:47 PM   #11
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
JAVA_HOME should be an absolute path
it is, i run
Code:
$echo $JAVA_HOME                            
/usr/lib64/jdk14-14.0.2
i don't know why replace with "../" in the config.log,
in the LibreOffice.slackbuild script run /etc/profile.d/jdk14.sh who execute "export JAVA_HOME=/usr/lib64/jdk14-14.0.2/"
before the compilation but the problem still remain.

Quote:
Have you tried with Ant 1.10.8 and JDK 8u261?
i only have this version of ant(1.9.14) in the repo of slackbuilds for sbopkg.
 
Old 09-17-2020, 12:45 AM   #12
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,129

Rep: Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991Reputation: 6991
Well this is the error you need to fix:
Code:
Error: JAVA_HOME is not defined correctly.
  We cannot execute ../lib64/jdk14-14.0.2/bin/java
 
1 members found this post helpful.
Old 09-17-2020, 01:06 AM   #13
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 724

Rep: Reputation: 92
For what it's worth these are the changes I've made to the LibreOffice.SlackBuild found in slackbuilds.org

Quote:
29c29
< VERSION=${VERSION:-6.4.1.2}
---
> VERSION=${VERSION:-7.0.0.3}
31c31
< BUILD=${BUILD:-2}
---
> BUILD=${BUILD:-0}
95c95,102
< if [ "$JAVA" = "openjdk7" ]; then
---
> if [ "$JAVA" = "jdk14" ]; then
> . /etc/profile.d/jdk14.sh
> ## use_java="--with-java=java"
> use_java="--with-jdk-home=/usr/lib64/jdk14-14.0.1"
> elif [ "$JAVA" = "jdk11" ]; then
> . /etc/profile.d/jdk11.sh
> use_java="--with-jdk-home=/usr/lib64/jdk11-11.0.7"
> elif [ "$JAVA" = "openjdk7" ]; then

I'm using JDK11 and made changes to the JDK11.Slackbuild script found in slackbuilds.org
 
1 members found this post helpful.
Old 09-17-2020, 07:57 AM   #14
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 640

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
Quote:
Originally Posted by slacknedo View Post
HI
i have this error when i try to compile LibreOffice 7 from slackbuilds.
i use oracle jdk14 on slackware current.
I suggest you use ponce's repo of SBo packages for -current. The LO version there is 7.0.0.3 and has the necessary changes to suit -current.

chris

Last edited by chris.willing; 09-17-2020 at 08:01 AM.
 
1 members found this post helpful.
Old 09-17-2020, 05:37 PM   #15
slacknedo
LQ Newbie
 
Registered: Apr 2019
Distribution: slackware
Posts: 18

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
I suggest you use ponce's repo of SBo packages for -current. The LO version there is 7.0.0.3 and has the necessary changes to suit -current.
i'm using it, sorry for not having said it.

Quote:
Originally Posted by aikempshall View Post
For what it's worth these are the changes I've made to the LibreOffice.SlackBuild found in slackbuilds.org
Thank you, i changed my LibreOffice.slackbuild in
Code:
 
if [ "$JAVA" = "jdk14" ]; then
. /etc/profile.d/jdk14.sh
##use_java="--with-java=java"
use_java="--with-jdk-home=/usr/lib64/jdk14-14.0.2"
and the configure works fine.
I don't know why take $JAVA_HOME not absolute path

thanks to all.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache-ant for LibreOffice on 8.3SYSTEMD VERSION rabidlinux Linux From Scratch 1 11-28-2018 04:16 PM
[SOLVED] LibreOffice Writer can't start on Debian 9 but other LibreOffice apps work fine IsaacKuo Linux - Software 4 08-20-2017 12:45 AM
modprobe usbserial for ANT stick does not work jamesarbrown Linux - Hardware 1 01-26-2012 02:29 AM
[SOLVED] installing apache ANT, can't create /usr/local/ant folder per ANT's manual jclark978 Linux - Newbie 1 12-11-2011 02:00 AM
How to use "ant" from J2EE SDK instead of installed ant in Fedora ? pcuongx Linux - Server 2 02-27-2007 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration