Is there any open-source Java or JavaScript library available to parse .dwg files and get the objects from it.
I would like to extract data from a table of text for my project.
It seems that the AutoCAD developer community prefers .NET and C/C++ over JAVA.
The only free alternative I found is by converting .dwg to .dxf first and using the Kabeja lib to read from it.
Credits to all who have answered, I've tested all your proposition and here's what I've found , as of 2015:
There is currently no free AND reliable solution to read and manipulate .dwg and .dxf files. This applies especially to latest versions of AutoCAD, ex : Autocad 2010, Autocad 2013 etc, RF 2013, RF 2010.
Reliable (and expensive) solutions would be Teigha by ODA (2000$ a year) and RealDWG in C# by Autocad (5000$ a year)...
Cheaper alternatives are as such :
Open-source libraries such as Kabeja and YCad may be able to deal with older AutoCAD versions but do not expect much from them as these projects are inactive since a few years ago. It's worth to keep an eye out for Apache Tika though, since they started writing parsers for .dwg files but development has been slow.
On a personal note, I think that AutoDesk has a strong and selfish monopoly on the CAD market now and they are making it difficult for others to join in. The format's version of .dwg files changes so often and I guess open-source developers will have to give up at some point and use the official product instead.
Let's hope for more open-source solutions in the coming years