jEdit Community - Resources for users of the jEdit Text Editor
need help setting up Jane and CodeAid for Java code completion
Submitted by Martin Honnen on Monday, 5 April, 2004 - 17:56
I have JEdit 4.1 here on Windows XP and would like to use CodeAid for code completion when editing Java source files. I am not sure how to set up a libary with Jane so that the SUN SDK/JRE API is known to CodeAid.
I have set up one library named jsdk14 with Jane with the following paths:
Source Path: C:\Program Files\Java\j2sdk1.4.1_01\src.zip
Class Path: C:\Program Files\Java\j2sdk1.4.1_01\jre\lib\rt.jar
Doc Path: D:\docs\Java\j2sdk1.4.1\docs\api

Unfornunately the documentation is not very detailed about what for instance is the right thing (directory or index.html or ?) to point the doc path to.

When I now try a simple Java program like

public class Test20040405 {
public static void main (String[] args) {
String s = "Kibology for all.";
System.out.println(s.

and select Plugins->CodeAid->Complete I get a dialog window with a BeanShell error:

java.lang.NullPointerException

at codeaid.popup.ContextPopup.updateY(ContextPopup.java:231)

at codeaid.popup.ContextPopup.refresh(ContextPopup.java:164)

at codeaid.popup.ContextPopup.removeCompletionContext(ContextPopup.java:131)

at codeaid.popup.ContextPopup.addCompletionContext(ContextPopup.java:100)

at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at bsh.Reflect.invokeMethod(Unknown Source)

at bsh.Reflect.invokeObjectMethod(Unknown Source)

at bsh.BSHPrimarySuffix.doName(Unknown Source)

at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)

at bsh.BSHPrimaryExpression.eval(Unknown Source)

at bsh.BSHBlock.eval(Unknown Source)

at bsh.BshMethod.invokeDeclaredMethod(Unknown Source)

at bsh.BshMethod.invoke(Unknown Source)

at org.gjt.sp.jedit.BeanShell.runCachedBlock(Unknown Source)

at org.gjt.sp.jedit.BeanShellAction.invoke(Unknown Source)

at org.gjt.sp.jedit.gui.InputHandler.invokeAction(Unknown Source)

at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(Unknown Source)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.AbstractButton.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)

at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)


Any hints on what could be wrong and how to properly set up Jane with a library so that the SUN JDK/JRE classes are known to CodeAid for code completion are appreciated.


Martin
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
some tips on getting CodeAid and Jane to work
by edweirdo on Fri, 21/05/2004 - 20:04
I started using jEdit yesterday, and I was frustrated trying to get CodeAid to work.

For CodeAid to work, here are some things I've learned:
- for the core Java API to be loaded, you only need to add rt.jar as a library in Jane. E.g. add a new library in Jane with a Name of "java" and Class Path of the path to the rt.jar file in the lib dir of your JRE installation (e.g.: "C:\Program Files\Java\j2re1.4.2_04\lib\rt.jar")
- you have to have the appropriate import statement(s) (or use the fully-qualified class name, e.g. java.util.ArrayList)
- after declaring a variable of a specific class type (e.g. "ArrayList foo"), immediately save the file. From that point on, if you call a constructor or a method on the variable, the list of matches will come up

E.g. if you want to use an ArrayList, do the following in your source code:
1. add "import java.util.ArrayList"
2. declare a variable of that type "ArrayList foo"
3. SAVE the file
4. complete the rest of the declaration: "ArrayList foo = new ArrayList(". You should see list of matching contructors show up.
5. whenever you type "foo." the list of matching methods shows up.

It's as if by saving the file, CodeAid gets a chance to load whatever classes it needs through Jane for the variables in your file.

Hope this helps.
User login
Browse archives
« September 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   96033
Context Free Art (*.cfdg)   0.31   46061
BBEdit scheme   1.0   18600
JBuilder scheme   .001   18501
ColdFusion scheme   1.0   18030
R Edit Mode - extensive version   0.1   17480
Advanced HTML edit mode   1.0   16212
Matlab Edit Mode   1.0   16074
jEdit XP icons   1.0   15235
XP icons for jEdit   1.1   14299