CDT Installation / Use [message #201378] |
Tue, 11 September 2007 13:27  |
Eclipse User |
|
|
|
Originally posted by: dtrumbo.sandia.gov
Hi All, this may seem like a simple question, and I hope that it is, and I
have a feeling this is more a "general" question but hope I can find some
good Eclipse expertise here, didn't really know where to ask it, and had a
horrible time searching online / both Google and eclipse.org.
I'm trying to write some tools based on the CDT, plug-ins to be exact.
For example, I want to right-click on a .h or .cpp file in the Package
Explorer, and have a context menu item that programmatically adds some
methods to the source file. But that's not my problem, that's just my
goal.
I need both the PDE and CDT so I downloaded the Eclipse 3.3 RCP/PDE
version, then the "CDT master update archive" separately from
http://download.eclipse.org/tools/cdt/releases/europa/ and installed the
CDT via the "Add Extension Location..." & ".eclipseextension" file in
"eclipse" folder method through the "Manage Configuration" dialog. (I had
network errors with update manager, I think its my corporate firewall,
and I never have luck with manual "drag and drop" plug-in installation
method). But at the end of the day, all the features & plug-ins show up
in my "Feature/Plug-in Details" buttons in Help->About. I can create new
C/C++ projects, and I have all the appropriate "views" and syntax
highlighting etc., so its installed.
However, in my Java plug-in code, my imports dont resolve until I update
my build path with those same JARs that I just installed (is that
normal?). For example these would not resolve:
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.CDOM;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
etc.
So I "Configure Build Path...", and under "Libraries" tab, I "Add External
JARs..." and add all the JARs from the CDT "plugins" directory. This
resolves all my imports and "class not found" type errors. I can build
and run. Now the problem is when I click on my menu during run-time and
the code execution actually gets to a method with certain CDT constructs,
it errors with a NoClassDefFoundError. For example:
java.lang.NoClassDefFoundError: org/eclipse/cdt/core/model/CModelException
or
java.lang.NoClassDefFoundError: org/eclipse/cdt/core/dom/ast/ASTVisitor
In my run-time instance of eclipse, I see that the CDT is also installed,
but am guessing that the plug-in doesnt automatically have access to the
JARs, just like it didnt in the development instance?
In a form of thrashing I experimented with bundling the entire CDT with my
plug-in (like you would have to do with 3rd party JARs you want to go
along with your plug-in). So I added them all to a folder under my
project, and in "plugin.xml" / "Build" tab, I added that entire directory
under "Binary Build", added them to the "Extra Classpath Entires", and
made sure my projects build path was pointing to them. Same problem.
Imports resolve, run-time error remains (and I checked to make sure I was
bundling correctly... "Export, Deployable plug-ins and fragments" gave me
a 58 MB plug-in so I think it worked...).
What am I doing wrong? Sorry for the long post, thanks in advance for any
help you can offer, much appreciated!! :)
~ Derek
|
|
|
Re: CDT Installation / Use [message #201398 is a reply to message #201378] |
Tue, 11 September 2007 18:53  |
Eclipse User |
|
|
|
Originally posted by: dtrumbo.sandia.gov
Hey All, I did get it solved finally. I was just pulling my hair out so I
didn't know what else to do! :)
I got around my corporate firewall with a corporate proxy and downloaded
the CDT like "normal" - so nothing manual about that installation.
I then removed *all* the CDT jar files from the "Configure Build Path..."
"Libraries" tab so just "JRE System Library" and "Plug-in Dependencies"
remained.
And then the key part I was missing was that I added all the
org.eclipse.cdt.* plug-ins to the "Required Plug-ins" list on the
"Dependencies" tab of the "plugin.xml" file. All my imports resolved and
the runtime execution finds the classes just fine (in the CDT already
loaded into the Eclipse instance!). Note to self, dependency tab is a
good thing!
So it was a learning experience. Sorry to pollute the group with
non-news. :P
|
|
|
Powered by
FUDForum. Page generated in 0.03157 seconds