Intellij: writing/debugging extensions in Java
Full disclosure: I have never programmed in Java before, although I have a couple of decades experience writing in C# and JavaScript.
I'm playing around with trying to write MD extensions in Java using JetBrains Intellij. Well, actually, I'm starting with the example myextension code that comes with the MD development kit :).
I think I've got my project configured correctly. At least, I've made all the syntactical errors disappear :). But I can't run or debug the code.
That's not surprising given that an MD extension is intended to run within the context of MD.
But I've seen references here in old discussions about being able to run and debug extension code (including specifically within Intellij).
Is there a link to an online guide or tutorial somewhere?
- Mark
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
1 Posted by Stuart Beesley ... on 12 Apr, 2025 06:27 PM
The short version is that you need to launch MD from within IJ by creating a debug/run config that launches the moneydance.jar (use the live jar file from your installation, not the dev kit) file (also with the -d) parameter. You will also need to tell the run config to load the supplementary jars too.
@mikebray might jump in here as I believe he does this…
2 Posted by Mike Bray (Quot... on 13 Apr, 2025 12:15 PM
Hi mark, have a look at the enclosed, have a look at the Modify classpath parameter. You need to add in the moneydance.jar of the version of MD you are using.
3 Posted by mark on 15 Apr, 2025 08:43 PM
Thanx for the quick feedback (and I hope I've finally convinced Outlook to stop putting messages from this forum in the junk folder, which I don't tend to check regularly :().
I'll try out the suggestions...and I'm sure I'll be back :)
4 Posted by mark on 24 Apr, 2025 02:33 AM
Follow-up question: after modifying the classpath so that the "real" moneydance.jar file is referenced, how do I launch the extension from within Intellij?
That may be more of an Intellij question rather than a MD question, but I'm not seeing what I need to do.
FWIW, almost all experience is C# and Visual Studio, where one includes packages and projects but debugging is done either through an executable you write or a test project (e.g., xunit).
5 Posted by Mike Bray (Quot... on 24 Apr, 2025 03:21 AM
In your run configuration include the moneydance.jar of your installed
version.
See
https://github.com/mrbray99/moneydanceproduction/wiki/Debugging.
6 Posted by mark on 24 Apr, 2025 10:42 PM
Thanx, Mike. I followed the instructions on the link you provided but am running into a problem selecting the main class in the configuration settings. I tried to specify Moneydance as the main class, but it was not one of the allowed values.
Is it possible I've got a conflict involving the ant build file, build.xml? I included it when I set up the project because I was thinking of using IDEA to run ant, to create the extension jar file. But debugging by running Moneydance within IDEA feels like a totally different goal.
I've attached some screenshots and the build.xml file in case that might be of use in advising me about what I'm doing wrong.
System closed this discussion on 24 Jul, 2025 10:50 PM.