aibu icon indicating copy to clipboard operation
aibu copied to clipboard

How to add coffeeshop library to classpath?

Open freak2 opened this issue 7 years ago • 8 comments

Hello, I am able to build the coffeeshop library, but when I add it to my classpath and do an ant command from my aibu folder (to create deploy/aibu.jar ), it gives me an error saying:

ivy: BUILD FAILED /home/freak/aibu/build.xml:13: /home/freak/.ant does not exist.

I think the problem is with CLASSPATH because I am able to build coffeeshop easily but not aibu. For your reference, I am adding CLASSPATH like this:

export CLASSPATH=$CLASSPATH:/home/freak/deploy/coffeeshop.animation.jar:/home/freak/deploy/coffeeshop.application.jar:/home/freak/deploy/coffeeshop.core.jar:/home/freak/deploy/coffeeshop.figure.jar:/home/freak/deploy/coffeeshop.gui.jar:/home/freak/deploy/coffeeshop.net.jar

Please help. Thank You.

freak2 avatar Jul 03 '17 09:07 freak2

There was a pending pull request regarding this, I have merged it, can you try to build it now?

lukacu avatar Jul 03 '17 09:07 lukacu

Tried it again. No longer the same error but a new one:

`Buildfile: /home/freak/aibu/build.xml

ivy: [taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

init: [mkdir] Created dir: /home/freak/aibu/bin [mkdir] Created dir: /home/freak/aibu/deploy

resolve:

BUILD FAILED /home/freak/aibu/build.xml:47: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any / declarations have taken place. No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. Action: Check that the implementing library exists in one of: -/usr/share/ant/lib -/home/freak/.ant/lib -a directory added on the command line with the -lib argument`

This might be a simple error to fix but I don't have much experience with JAVA in general. That's why it's not apparent to me. Any help will be highly appreciated. Thanks.

freak2 avatar Jul 03 '17 09:07 freak2

Yeah, I am not that familiar with ant either, usually I had both projects in Eclipse workspace and built a monolithic jar when needed a standalone version.

lukacu avatar Jul 03 '17 10:07 lukacu

Okay, no problem. Will try figuring it out. If I find something, will post it here. Thanks for the help.

freak2 avatar Jul 03 '17 10:07 freak2

Hi, I met the same problem and solved it by downgrading the Java version to 1.16, and then re-build the coffeeshoplib.

xiaozai avatar Sep 21 '20 07:09 xiaozai

Ok, so the problem is Java version, we have to upgrade the code for more recent Java.

For the other problem please open a separate ticket.

lukacu avatar Sep 21 '20 07:09 lukacu

Same problem

Buildfile: /home/space/Public/vot-aibu/aibu/build.xml

ivy:
  [taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

init:

resolve:

BUILD FAILED
/home/space/Public/vot-aibu/aibu/build.xml:47: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/home/space/.ant/lib
        -a directory added on the command line with the -lib argument


Total time: 0 seconds

space@z390:~/Public/vot-aibu/aibu$ java -version
openjdk version "11.0.14" 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Which java version should be used?

lawpdas avatar Mar 15 '22 03:03 lawpdas

I have solved it by downloading ivy-2.5.0.jar and copying it to /usr/share/ant/lib

lawpdas avatar Mar 15 '22 03:03 lawpdas