1

I was trying to include referenced library when this error showed up on a line that apparently made use of the Rectangle2D class. For some reason it seems I'm missing that class.

The type java.awt.geom.Rectangle2D cannot be resolved. It is indirectly referenced from required .class files

After some Google searches I figured out I had to simply add Rectangle2D to as a reference, but I can't find it anywhere.

Can anyone point me in the right direction? Do I need to download it separately? Or am I no searching good enough? Where is that file located?

Pieter888
  • 4,882
  • 13
  • 53
  • 74
  • possible duplicate of [java.lang.NoClassDefFoundError: java.awt.geom.Rectangle2D$Double while trying to parse a pdf page to image using pdfrenderer](http://stackoverflow.com/questions/9816991/java-lang-noclassdeffounderror-java-awt-geom-rectangle2ddouble-while-trying-to) – CommonsWare May 24 '12 at 11:37
  • Try [this](http://www.doc.ic.ac.uk/~awl03/cgi-bin/trac.cgi/miro/browser/trunk/gcc/libjava/classpath/java/awt/geom/Rectangle2D.java?rev=36) one. – Praveenkumar May 24 '12 at 11:40

2 Answers2

3

java.awt refers to Java's Abstract Window Toolkit which is not included in the Android framework. Try referencing this library

eladr
  • 268
  • 7
  • 18
  • Thanks, but the problem is that I am not referencing that library. But the library I'm using is. And I can't get to the source. – Pieter888 May 24 '12 at 11:46
  • So if I where to add that library, it would still reference sun.awt.geom.Rectangle2D – Pieter888 May 24 '12 at 11:47
  • You can find Rectangle2D.java under svn/branches/alpha-demo/src/and/awt/geom/Rectangle2D.java Its package name is `and.awt.geom` but you can try and change it to satisfy that library you're using – eladr May 24 '12 at 12:03
0

try import java.awt.geom.RectangularShape

Joe Ho
  • 918
  • 3
  • 13
  • 28