Java Question apache commons net

William Hunter

Active Member
Licensed User
Longtime User
I am working on my first library. The Eclipse setup includes the apache commons net library. I am getting a number of errors specific to this library. I think I am missing a dependency, but can’t find any reference at the apache commons net website.

This is the error message: “package BA does not exist”. Can anyone help me to sort this out? Any help would be greatly appreciated.

Cheers :)
 

stefanobusetto

Active Member
Licensed User
Longtime User
Try:
Add a reference to the following jars: android.jar, B4AShared.jar and optionally to Core.jar. This is done by right clicking on the project name - Build Path - Add External Jars.
 

William Hunter

Active Member
Licensed User
Longtime User
Try:
Add a reference to the following jars: android.jar, B4AShared.jar and optionally to Core.jar. This is done by right clicking on the project name - Build Path - Add External Jars.
Thank you for your reply. In setting up Eclipse I followed the B4A tutorial and these jars have been added. My problem started when I added the apache commons net.This problem has me stumped. :BangHead: Do you have any other suggestions?

Regards
 

William Hunter

Active Member
Licensed User
Longtime User
Adding the Apache Commons Net library to Eclipse

I probably shouldn’t admit to my comedy of errors on an open forum. But, we noobies need all the help we can get, so I will. I used advice I had gleaned from another Internet site to set up the apache commons net. That advice was completely wrong, and I had nothing but errors. Lesson learned; not all advice is expert advice. Stick to this forum for help.

Fellow forum member Wl was good enough to let me see his completed project that correctly used the apache commons net library. This is how it should be set up.

Download the attached org zip file. Unzip it and copy the org folder to the clipboard. Then create a libs folder in the root of your project. Copy the org folder into this libs folder. Refresh your project, and then open the .classpath file in your project. Look for a line that looks like this:

<classpathentry kind="lib" path="libs"/>

If you do not see this line in .classpath, copy and paste it in. Refresh your project and the apache commons net should now be correctly added.

One other piece of information: If you are using another authors project for guidance, and have errors opening it in Eclipse, have a look at their .classpath file. You may find that their pointers to various jar files are not a match to your own setup. I hope this will be of help to others.

Cheers
 

Attachments

  • org.zip
    58.5 KB · Views: 250
Last edited:
Top