Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

class not found in Eclipse-built external jar, but found in Netbeans-built one

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Android development and fairly new to Java altogether. I am trying to develop an Android app that uses some classes from an external JAR. I've run into a strange problem. I managed to reduce the amount of code to "toy" sizes and so now the external JAR is extremely simple: it contains a class that computes a square of a number and returns the result as a String:



The code of the app is basically "Hellow world++" based on the 1st app in the Android dev tutorial:



Now, here's the problem. I am developing for Android in Eclipse. However, if I also create the JAR in Eclipse by creating a regular Java project with the class, then exporting it into a jar file, and then add this JAR to the build path of the Android project, I get a run time exception that this class cannot be found.

If, on the other hand, I create the JAR in Netbeans and add that JAR to the build path (in Eclipse), all works well.

I actually unzipped both jars to compare contents. It appears that the difference is in .class files but they are not human readable so I can't get any further.

So my q is this: what can I change in the Eclipse export to make the external jar "good"? What is NB doing right that Eclipse is doing wrong? Or do I simply resort to building all my external JARs in NB? Is this a symptom of a badly installed Eclipse? If so, what components should I try to reinstall/fix?

Thanks much!!!
 
"To do good, you actually have to do something." -- Yvon Chouinard
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic