Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Problem building a project

Hello,

 

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?

 

Thank you,

 

Daniel D.

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Problem building a project

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.

 

that's it.

Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Re: Problem building a project

Hi Tbilisoft,

 

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.*;

 

Thank you.

 

Daniel D.

Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Re: Problem building a project

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?

 

Thank you,

 

Daniel D.

Highlighted
Developer
Posts: 34
Registered: ‎10-02-2008
My Device: Bold 9000

Re: Problem building a project

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.

beren erchamion
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Problem building a project

How are your working with KSOAP ?

 

Have you added all kSOAP source files to a library project or you are working with kSoap.jar file and you do not have source codes ?

Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Re: Problem building a project

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?

 

Thanks,

 

Daniel D.

Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Re: Problem building a project

Beren,

 

I tried NetBeans, but I am having trouble configuring it. Do you have a example of a build.xml file I can use? I am using JDE 4.3.

 

Thank you,

 

Daniel

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Problem building a project

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: 

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=13907

 

 

Developer
Posts: 39
Registered: ‎04-30-2009
My Device: Not Specified

Re: Problem building a project

Thank you Tbilisoft,

 

I will try that.

 

Daniel D.