jEdit Community - Resources for users of the jEdit Text Editor
Eclipse + Plugin dev
Submitted by WarrickF on Thursday, 4 September, 2008 - 02:47
Hi Guys,

I've inherited a plug-in that was developed for internal use. According to the documentation the process for building \ debugging is as follows:

1. Open project in Eclipse
2. File > Export > JAR File
3. Export to C:\Program Files\jEdit\jars\Plugin.jar
4. Launch JEdit
5. Go to plugin manager and enable the plugin.

This seems to be a rather tedious and takes a long time to test even the simplest change.

Can someone suggest a better way please? Ideally I'd like to be able to add break points that are triggered while using the plugin through JEdit.

I apologize if this is a newbie type question.

Thanks
Warrick
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Hi WarrickF, here's my set
by SpringEquinox on Sat, 22/11/2008 - 13:23
Hi WarrickF,

here's my setup for jEdit plugin development (although I'm a newbie too). I have a jEdit project in the workspace. This project basically contains the jEdit distribution folder. It should be java project and it doesn't have to contain any sourcefolders. It has jedit.jar on its buildpath. I have a java run configuration for this project with main class org.gjt.sp.jedit.jEdit. Since the project root folder is on top of the runtime classpath, jedit core will detect and load all plugins inside the jars directory (and of course plugins in .jedit/jars folder in your home).

Now, I have a separate project for my plugin. I'm using maven and my local maven repository to supply needed dependecies (through the m2eclipse plugin), but you can also just add all the required jars to buildpath. Sadly, I haven't found a way to make jEdit use the classes from the plugin project - it seems you have to package it into jar and deploy it into the jars directory inside the jEdit project. I'm using maven again to do the work - it shouldn't be hard to make ant do that too.

So, you end up with 2 run configurations: one build (maven / ant) that packages your plugin and deploys it and one jEdit launch configuration that bootstraps the editor and let you test the changes you've made. It takes me about 20 - 30 seconds (including automatic tests running during the plugin build) to propagate the changes into jEdit.

You should quit jEdit each time you build a new version of your plugin. BUT: you can use debuging! Both steping through your code and hot-replace of java classes works the same as in normal java project, as the debugger has hooks directly into the JRE - no need to changing the deployed jar file.

However, if you want to debug the jEdit core code, you have to compile it from sources yourself, as the distribution jar is compiled without debuging information.

Hope it helps,
Martin
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293