Skip to main content



      Home
Home » Newcomers » Newcomers » Trouble Exporting Plug-in
Trouble Exporting Plug-in [message #262695] Thu, 07 August 2008 15:23 Go to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

Hi,
I finally finished making a plug-in, and I wanted to export it and place
it into my main eclipse directory so every instance of Eclipse I open will
have it available.

I right-clicked on the project and tried: ->export...->Plug-in
Development->Deployable Plug-ins and fragments.

From there, I tried both the directory and archive file option but both
gave me only a jar file.

Well, I tried simply putting that jar file into my eclipse/plugins
directory, and sure enough, nothing happened.

Simply copying and pasting my project there gave me to the option to open
my view up and all (I'm guessing due to the presence of the plugin.xml),
but had errors doing anything and everything (creating view, submenu
actions, properties, etc.).

So, what is the proper way to export a plug-in so that someone else can
just plop it into their eclipse directory and have at it?

Thanks!
Re: Trouble Exporting Plug-in [message #262697 is a reply to message #262695] Thu, 07 August 2008 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.code9.com

Dan Xu wrote:
> Hi,
> I finally finished making a plug-in, and I wanted to export it and place
> it into my main eclipse directory so every instance of Eclipse I open
> will have it available.
>
> I right-clicked on the project and tried: ->export...->Plug-in
> Development->Deployable Plug-ins and fragments.
>
> From there, I tried both the directory and archive file option but both
> gave me only a jar file.
>
> Well, I tried simply putting that jar file into my eclipse/plugins
> directory, and sure enough, nothing happened.
>
> Simply copying and pasting my project there gave me to the option to
> open my view up and all (I'm guessing due to the presence of the
> plugin.xml), but had errors doing anything and everything (creating
> view, submenu actions, properties, etc.).
>
> So, what is the proper way to export a plug-in so that someone else can
> just plop it into their eclipse directory and have at it?
>
> Thanks!
>

There could be a few issues. Here are some thoughts:

1) check your build.properties file to ensure everything that you want
is included in the Binary Build section (people sometimes forget to
include images or other resources)

2) drop the plug-in into the 'dropins' directory if you're using 3.4 and
into the 'plugins' directory if you're using <=3.3

I would have to see the specific stack trace to get an idea of what is
going on.

Cheers,

~ Chris
Re: Trouble Exporting Plug-in [message #262701 is a reply to message #262697] Thu, 07 August 2008 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

Chris Aniszczyk wrote:

> Dan Xu wrote:
>> Hi,
>> I finally finished making a plug-in, and I wanted to export it and place
>> it into my main eclipse directory so every instance of Eclipse I open
>> will have it available.
>>
>> I right-clicked on the project and tried: ->export...->Plug-in
>> Development->Deployable Plug-ins and fragments.
>>
>> From there, I tried both the directory and archive file option but both
>> gave me only a jar file.
>>
>> Well, I tried simply putting that jar file into my eclipse/plugins
>> directory, and sure enough, nothing happened.
>>
>> Simply copying and pasting my project there gave me to the option to
>> open my view up and all (I'm guessing due to the presence of the
>> plugin.xml), but had errors doing anything and everything (creating
>> view, submenu actions, properties, etc.).
>>
>> So, what is the proper way to export a plug-in so that someone else can
>> just plop it into their eclipse directory and have at it?
>>
>> Thanks!
>>

> There could be a few issues. Here are some thoughts:

> 1) check your build.properties file to ensure everything that you want
> is included in the Binary Build section (people sometimes forget to
> include images or other resources)

> 2) drop the plug-in into the 'dropins' directory if you're using 3.4 and
> into the 'plugins' directory if you're using <=3.3

> I would have to see the specific stack trace to get an idea of what is
> going on.

> Cheers,

> ~ Chris

Thanks for the quick response. I am using the latest release, 3.4

As I have it right now, for Binary Build, I have the META-INF, bin, icons,
and src folders checked along with contexts.xml and plugin.xml.

Using ->export...->Plug-in Development->Deployable Plug-ins and fragments,
I have it as an archive file-and going to the directory, I find that it
contains only a single .jar file.

Well, naturally, I copy this (234kb) jar file into my eclipse plug-ins
directory and reboot eclipse.

The result should be that I have a new submenu under views which I select
my view and thereupon do all the neat stuff I coded, but when I look under
views, I find nothing at all-no evidence that my new plug-in was ever
incorporated (usually this means plugin.xml is not found).

So, unfortunately, I cannot give you a stack trace since it's like nothing
happened-I do not need to copy my actual project there as well do I?

Thanks again.
Re: Trouble Exporting Plug-in [message #262703 is a reply to message #262695] Thu, 07 August 2008 16:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dan Xu wrote:
> Hi,
> I finally finished making a plug-in, and I wanted to export it and place
> it into my main eclipse directory so every instance of Eclipse I open
> will have it available.
>
> I right-clicked on the project and tried: ->export...->Plug-in
> Development->Deployable Plug-ins and fragments.
>
> From there, I tried both the directory and archive file option but both
> gave me only a jar file.
>
> Well, I tried simply putting that jar file into my eclipse/plugins
> directory, and sure enough, nothing happened.
>
> Simply copying and pasting my project there gave me to the option to
> open my view up and all (I'm guessing due to the presence of the
> plugin.xml), but had errors doing anything and everything (creating
> view, submenu actions, properties, etc.).
>
> So, what is the proper way to export a plug-in so that someone else can
> just plop it into their eclipse directory and have at it?

You seem to have followed the correct procedure, but let's suggest some
more things to try:
After you copy the plugin JAR to an Eclipse instance, re-start that
Eclipse using the -clean command-line argument (or in eclipse.ini) to
force it to flush its internal configuration cache.
If that still does not work, open the About Eclipse dialog and use the
Plug-in Details button to see if your plugin is listed there. Also, open
the Error Log view to see if there is anything logged about failing to
load your plugin.

Report back your findings and hopefully we'll have more information to
work with from there.

Eric
Re: Trouble Exporting Plug-in [message #262729 is a reply to message #262703] Fri, 08 August 2008 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

> You seem to have followed the correct procedure, but let's suggest some
> more things to try:
> After you copy the plugin JAR to an Eclipse instance, re-start that
> Eclipse using the -clean command-line argument (or in eclipse.ini) to
> force it to flush its internal configuration cache.
> If that still does not work, open the About Eclipse dialog and use the
> Plug-in Details button to see if your plugin is listed there. Also, open
> the Error Log view to see if there is anything logged about failing to
> load your plugin.

> Report back your findings and hopefully we'll have more information to
> work with from there.

> Eric

> After you copy the plugin JAR to an Eclipse instance, re-start that
> Eclipse using the -clean command-line argument (or in eclipse.ini) to
> force it to flush its internal configuration cache.

The eclipse.ini command opened notepad with the following printed:

-startup
plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800. jar
--launcher.library
plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.100 .v20080509-1800
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m

After clearing the error log and restarting eclipse in a different
workspace, I still don't see the view. The error log was clear, and under
the plugins listed whose provider was NOT eclipse.org, I see:

org.ginko.gcov (A code coverage tool I downloaded and am not using)
com.ibm.icu (not sure what it is but assume it's important
com.jcraft.jsh
org.eclipse.ant.optional.junit
myview
org.eclipse.cdt.util
org.sat4j.core
org.sat4j.pb

None of the above are my plugin...

Should there be something in addition to a jar file generated and stored
in the zipped folder like a plugin.xml? If not, is there any way I can
look at the contents of the Jar file?

When I create a new project and go to import->from Archive file and select
the jar file, get everything I had before, except with folders instead of
packages. So, I figure the contexts.xml and plugin.xml should at least
make eclipse pick up something...

Anyway, let me know if you have any suggestions. Usually my problems stem
from some small, hard-to=catch error.
Re: Trouble Exporting Plug-in [message #262742 is a reply to message #262703] Fri, 08 August 2008 12:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

By the way, when I test my plugin and look at THAT instance of Eclipse's
About plugins list, I find my plugin listed there (unsigned, cUnitTesting).

So yeah, I still have no clue why my plugin isn't even registering a blip
when it's in the form of a .jar file
Re: Trouble Exporting Plug-in [message #262745 is a reply to message #262697] Fri, 08 August 2008 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

Oh yeah, I'm using 3.4 and put the .jar file in both the drop-ins AND
plug-ins, but it still doesn't show up as a view when put in either place.
Re: Trouble Exporting Plug-in [message #262863 is a reply to message #262745] Mon, 11 August 2008 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dan Xu wrote:
> Oh yeah, I'm using 3.4 and put the .jar file in both the drop-ins AND
> plug-ins, but it still doesn't show up as a view when put in either place.
>

For 3.4, the dropins folder would be the correct place, not plugins/.
See http://wiki.eclipse.org/Equinox_p2_Getting_Started

Eric
Re: Trouble Exporting Plug-in [message #262866 is a reply to message #262729] Mon, 11 August 2008 09:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dan Xu wrote:
> The eclipse.ini command opened notepad with the following printed:
>
> -startup
> plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800. jar
> --launcher.library
> plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.100 .v20080509-1800
> -showsplash
> org.eclipse.platform
> --launcher.XXMaxPermSize
> 256m
> -vmargs
> -Xms40m
> -Xmx256m

You can try adding -clean at the top of that file to see if it forces
Eclipse to load the new plugin. In 3.3 that was usually helpful but I'm
not sure if it is the same in 3.4

>
> After clearing the error log and restarting eclipse in a different
> workspace, I still don't see the view. The error log was clear, and
> under the plugins listed whose provider was NOT eclipse.org, I see:
>
> org.ginko.gcov (A code coverage tool I downloaded and am not using)
> com.ibm.icu (not sure what it is but assume it's important
> com.jcraft.jsh
> org.eclipse.ant.optional.junit
> myview
> org.eclipse.cdt.util
> org.sat4j.core
> org.sat4j.pb
>
> None of the above are my plugin...

So your plugin is not being recognized for some reason. If it were
failing to load, you'd see something in the .metadata/.log file about it.

> Should there be something in addition to a jar file generated and stored
> in the zipped folder like a plugin.xml? If not, is there any way I can
> look at the contents of the Jar file?

A JAR is just a ZIP file, so you can use any ZIP utility such as 7-zip
or WinZip or whatever to view it. You can also use the jar.exe command.
In the JAR, there should be at least a META-INF directory with a
manifest.mf file, and possibly a plugin.xml at the root.

Can you post the exported plugin somewhere for us to see?

Hope this helps,
Eric
Re: Trouble Exporting Plug-in [message #262870 is a reply to message #262866] Mon, 11 August 2008 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

Alright, I'll keep looking into it. Thanks again for the tips.

By the way though, does the below no longer work? When I tried this
method, I DID log the error message, "Plugin does not have a valid
identifier: plugins/cUnitTesting_1.0.0/" but the plugin did not show up on
the list from about Eclipse. Granted, the article was from 2002, but I'm
hopeful there's some backwards compatibility? Anyway, I'll keep at it.

(From http://www.ibm.com/developerworks/library/os-ecplug/)


"Eclipse determines what plug-ins to load by looking in its plugins
directory at startup. To install a plug-in, we need to create a
subdirectory in the plugins directory and copy our program files and
manifest files there. It's not necessary, but it is recommended that the
directory name indicate the plug-in's ID, followed by an underscore and
the version number. Suppose that Eclipse is installed in C:\eclipse; we
might make a directory:

C:\eclipse\plugins\com.example.hello_1.0.0.

As is standard with Java applications, our program files need to be
archived into a .jar file -- our plug-in manifest file, you may remember
contained this entry:

<runtime>
<library name="hello.jar"/>
</runtime>


To create the hello.jar file, we can export our plug-in files by
highlighting the project name, and selecting File=>Export from the Eclipse
menu. Select JAR file as the destination, press Next, and then browse to
the directory we created for it. Next, we need to copy the plugin.xml file
to this directory too. You can use the File=>Export menu selection as well
(but remember to choose File System as the destination).

This is all that is required to install the plug-in, but you will need to
stop and restart Eclipse for the new plug-in to be recognized. You can
find information about the installed plug-ins, including version number,
by selecting "About Eclipse Platform" from the help menu. One of the
buttons on the screen that appears will be Plug-in Details; scroll down
the list to find the Hello plug-in and its version number."
Re: Trouble Exporting Plug-in [message #262878 is a reply to message #262866] Mon, 11 August 2008 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

> Can you post the exported plugin somewhere for us to see?

> Hope this helps,
> Eric
Where could I post it, and could I maybe e-mail it to you? (234kb)

I opened the jar with another instance of eclipse and it looks like
everything is there.

The Manifest file contains:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CUnitTesting Plug-in
Bundle-SymbolicName: cUnitTesting; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: cunittesting.Activator
Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.co
re.resources,org.eclipse.cdt.core;bundle-version="5.0.0",org.eclipse.
jdt.ui;bundle-version="3.4.0",org.eclipse.ui.views.properties.tabbed;
bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5

and the plugin.xml has:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.cdt.core.model.IFunction"
id="cUnitTesting.contribution1">

<action
label="Add Function"
class="cunittesting.popup.actions.AddFunctionAction"
icon="icons/butterfly.JPG"
enablesFor="1"
id="cUnitTesting.AddFunctionAction">
</action>
</objectContribution>
</extension>
<extension
point="org.eclipse.ui.propertyPages">
<page
objectClass="org.eclipse.core.resources.IFile"
name="Sample Page"
nameFilter="*.*"
class="cunittesting.properties.SamplePropertyPage"
id="cunittesting.properties.samplePropertyPage">
</page>
</extension>
<extension
point="org.eclipse.ui.views">
<category
id="cunittesting.views.cUnitTesting"
name="cUnitTesting">
</category>
<view
category="cunittesting.views.cUnitTesting"
class="cunittesting.views.MainView"
icon="icons/sample.gif"
id="cunittesting.views.MainView"
name="C-Unit Test View">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
ratio="0.5"
relative="org.eclipse.ui.views.TaskList"
relationship="right"
id="cunittesting.views.MainView">
</view>
</perspectiveExtension>
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
id="cunittesting.views.MainView"
ratio="0.5"
relationship="right"
relative="org.eclipse.ui.views.TaskList">
</view>
</perspectiveExtension>
</extension>
<extension
point="org.eclipse.help.contexts">
<contexts
file="contexts.xml">
</contexts>
<contexts
file="contexts.xml">
</contexts>
</extension>

</plugin>


The only thing different is that there is no build or build.properties
tab-which I expected since it is a completed plug-in right?

Finally, I'm not sure if this is relavent, but the contents.xml speaks of
a "Sample View" rather than the name of my view ("cUnitTesting")

<contexts>
<context id="viewer" title="Sample View">
<description>This is the context help for the sample view with a table
viewer. It was generated by a PDE template.</description>
<topic
href=" /PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_con text.htm "
label="Context-sensitive help">
<enablement>
<with variable="platform">
<test property="org.eclipse.core.runtime.isBundleInstalled"
args="org.eclipse.platform.doc.isv"/>
</with>
</enablement>
</topic>
</context>
</contexts>
Re: Trouble Exporting Plug-in [message #262883 is a reply to message #262866] Mon, 11 August 2008 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gang.xu.delphi.com

Hey Eric,
Thanks! I opened eclipse using eclipse.exe -clean and it worked after
putting my .jar file in both the plugin and drop-in directory

Now I just need to find which one is necessary (or either). Thanks again!
Re: Trouble Exporting Plug-in [message #263028 is a reply to message #262883] Tue, 12 August 2008 13:20 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dan Xu wrote:
> Hey Eric,
> Thanks! I opened eclipse using eclipse.exe -clean and it worked after
> putting my .jar file in both the plugin and drop-in directory
>
> Now I just need to find which one is necessary (or either). Thanks again!
>

I'm glad it works now. Please read what I said about dropins/ vs. plugins/

"For 3.4, the dropins folder would be the correct place, not plugins/.
See http://wiki.eclipse.org/Equinox_p2_Getting_Started"

Eric
Previous Topic:Debugging Workflow
Next Topic:Eclipse TextEditor HowTo
Goto Forum:
  


Current Time: Sun Jul 20 08:09:00 EDT 2025

Powered by FUDForum. Page generated in 0.12739 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top