06-12-2009 04:30 PM
I am using Eclipse 3.4.2 with JDE 4.3.
I have a project called TEST. I also have a Library project called KS2, which is a library to encapsulate KSoap2. I have followed all the instructions how to build the library. I have also set TEST to reference KS2. So far so good... All I need to do now is to include the KS2.jar in the Library list in Configure Build Path in TEST.
Here is where my problems start. When I build KS2 I see the JAD, COD, CSO, DEBUG, JPD, and RAPC files, but no JAR. Eclipse used to generate it, but yesterday I made some changes to TEST (I added an icon resource) and since then the JAR file disappeared. I tried building KS2 again, refreshing it, but no success. On the other hand, in TEST I see the JAR file, but no COD file.
Is Eclipse supposed to generate those files automatically or I have to do it manually? Yesterday those files were there. I do not understand why they suddenly disappeared.
I appreciate any suggestions. Is there a way to manually generate JAR and COD files?
06-12-2009 05:09 PM
If you have two projects and source code of KSOAP included to the library project you do not need to add jar file to the main project.
Set the dependencies properly, compile both projects and install both cod files (app and library) on the device.
06-12-2009 08:37 PM
If I do not add the JAR file to the main project I cannot reference the KSoap2 library in code, which prevents me from building the main project. I am getting a build error, because the imports are not found. I am importing the following:
import org.ksoap2.*; import org.ksoap2.serialization.*; import org.ksoap2.transport.*;
06-12-2009 09:24 PM
So, to simplify the question: in a library project, why is Eclipse not generating a JAR file when the project is built? All other files are generated.
Is there a way to generate JAR files manually?
06-12-2009 09:51 PM
Have you tried right clicking on your project and then on build path and then use the link source options to link the folders external to the project to the source in the other?
I'm getting to do this exact same thing - pull classes out of my current RIM app to make a generic set of classes to be referenced by a bunch of apps.
This is one aspect of NetBeans where things are a bit easier because it supports cross-project dependencies. In Eclipse it is not as smooth.
06-13-2009 07:41 AM
Here is the procedure I followed to include KSoap2:
1. I created a new library project in the same workspace as the main project.
2. I added the preverified version of the core library in the lib folder.
3. Right click on the project I selected Configure Build Path from the Build Path menu.
4. In the Libraries tab I added the preverified library I have in the lib folder.
At this point I should be able to build the project and then I should be able to include the generated JAR file into my main project's list of libraries.
This worked for a while until 2 days ago when I made some changes in my main project. Since then I have not been able to build the library project. I do not get any errors and I see the COD file, but no JAR file.
I do not know if I am doing anything wrong, or this is a bug in the system. I saw that other peopl have similiar problems.
Do you have any ideas how to solve this issue?
06-13-2009 07:52 AM
I do not use Eclipse.
In JDE this procedure is pretty simple.
I just need to add compiled jar file into the main project properties, or make a dependant library with source files.
Check this link for ant script sample: