14

I saw an article about including additional javax.* packages in your Android App http://code.google.com/p/dalvik/wiki/JavaxPackages.

I wanted to do the same thing, but using Eclipse. Could anyone help me figure out how to do this?

Flame
  • 2,166
  • 2
  • 20
  • 40
mohamed sakr
  • 141
  • 1
  • 1
  • 3
  • Have you followed the steps listed? If so, then you should be able to see them in your Android application. If you can't what happened after going through these steps? – James Black Oct 11 '10 at 01:14
  • yes i followed the steps but i want do these steps but with eclipse – mohamed sakr Oct 11 '10 at 15:31

2 Answers2

2

Step 1: Properties -> Java Build Path -> Libraries -> add external jar

Step 2: Properties -> Java Build Path -> Order and Export -> check the new lib

Abhinava
  • 1,030
  • 9
  • 19
0

Adding an External Library (.jar) using Eclipse

You can use a third party JAR in your application by adding it to your Eclipse project as follows:

  1. In the Package Explorer panel, right-click on your project and select Properties.

  2. Select Java Build Path, then the tab Libraries.

  3. Press the Add External JARs... button and select the JAR file.

Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead. It is not necessary to put external JARs in the assets folder.

jacknad
  • 13,483
  • 40
  • 124
  • 194
  • thank you for your answer but i know what you say but it is not what i want i want to add jars like javax but the delvak give an error as javax is not included in it the link i posted show how to add javax to the project and set the system properities but not with eclipse with ant – mohamed sakr Oct 11 '10 at 07:07
  • Those instruction are exactly what I used to add several .jar files to my eclipse project. The link I posted is http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary – jacknad Oct 11 '10 at 11:28
  • the link you post is for adding jars to eclipse projects (normal jars) but if you try to add javax.* jar it will give you error as the android vm (delvak) don't have javax package included in ..the link i post enable you to add javax pachage in your application with no error the problem is that it tell you how to do that with ant and i want to do that with eclipse – mohamed sakr Oct 11 '10 at 15:35
  • Again, those instruction are exactly what I used to add several .jar files to my eclipse project, including javax. I don't use ant (directly), only eclipse. – jacknad Oct 11 '10 at 23:04
  • Did you download the javax jar files you need to a local folder? You may need to be specific about which javax jar files you are using rather than javax.*. What is text of your error message? – jacknad Oct 12 '10 at 09:57
  • thank you for your reply ...... stax-api-1.0.1.jar is the jar i mean it include javax.xml.namespace,javax.xml.stream the error is "Conversion to Dalvik format failed with error 1" – mohamed sakr Oct 12 '10 at 21:27
  • Now use http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary to add stax-api-1.0.1.jar to your eclipse project after copying stax-api-1.0.1.jar to a folder in your project. – jacknad Oct 12 '10 at 23:05
  • when i try to test the example in http://code.google.com/p/dalvik/wiki/JavaxPackages ... in eclipse with the link you send me it give me an error but not compile error as befor as i include the jars as library – mohamed sakr Oct 14 '10 at 13:43
  • @mohamedsakr Please edit your question to include the steps you took and the error that you received. – Code-Apprentice Sep 29 '12 at 22:39
  • @mohamedsakr And please use proper punctuation and capitalization. Your comments are very difficult to read without them. I am aware that English is probably not your native language. I'm just asking you to make an effort in this regard. Thanks ;-) – Code-Apprentice Sep 29 '12 at 22:41