Home Forums General XMetaL Discussion Custom Menu to run Java App Reply To: Custom Menu to run Java App


Reply to: Custom Menu to run Java App

In case anyone finds this, I thought I'd post my solution. As far as I can tell, its the only way to achieve what we're trying to do.

You don't actually need XMetal Developer or MS Visual Studio to develop against the XMetal API. You do, however, need two jar files that are only available via XMetal Developer: SQJavaAPI.jar and dom2.jar . Once I added these .jars to my project I was able to code and build my project in Eclipse. When testing in eclipse, I go the error message “No SQJNILib in java.library.path”, so I had to run the application from the commandline instead of the IDE.

I added menu items by creating a javascript macro file(.mcr ) in the XMetaL ‘Startup’ folder [C:Program Files (x86)XMetaL 6.0AuthorStartUp  for me]. Such files uses the Windows Scripting Host, so I was able to call my java app using the RUN command as follows;

var cmd = [command line text goes here]
WshShell = new ActiveXObject(“WScript.Shell”);
WshShell.Run (cmd,1,false);