jEdit Community - Resources for users of the jEdit Text Editor
[FAQ Candidate]: Can I modify the classpath of a macro?
Submitted by Anonymous on Tuesday, 12 October, 2004 - 10:53
Hi all,

Can I modify the classpath of a macro?
It seems that my question have to be inserted in jEdit FAQ.

------------- References from previous discussions Smiling

[1] Using external java libraries in macros 1 05/01/2004 - 6:38am
by AndreJRenard 05/03/2004 - 8:30am
by Brad Mace

[2] How do I modify the classpath of a macro? 0 04/09/2004 - 4:09am
by Anonymous

-------------

The only solution suggested in previous discussions by Brad
was to put my jars into jEdit folder.
That's good, but not too handy. BeanShell's addClassPath() command was
much better.

Currently I have my classes compiled in Eclipse workbench and can play
with them from BeanShell script as much as I like. I run my BeanShell scripts
from command-line currently and I hoped that jEdit's BeanShell Console can be
a better tool.

Changing class in Eclipse is enough for script. But if I had to create jar,
put it into jEdit folder and restart jEdit to catch the changes, it makes it
useless.

My suggestion is to reflect this behaviour in jEdit FAQ.

Best regards,
Egor Abramovich
egor_abramovich@mail.ru
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Change classpath dynamically in jEdit's BeanShell
by vdichev on Fri, 23/09/2005 - 05:00
Well, it does seem that the loadJarClasses.bsh mentioned in the manual is nowhere to be found. However, I found that a quick and dirty workaround for jar files is using the jEdit.addPluginJAR(String) method, although it was not intended to be used that way. Thus you can load jars not only from the jEdit jar directory and you don't need a restart.

For single classes or directories not in a jar, you might find the Load_Classes2Instantiate.bsh script useful (it's still in the files section of community.jedit.jar :: Macros :: Beanshell Macros :: Java), although it's a bit rough around the edges.

Have fun,
Vassil Dichev
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