0

We have a software based on the eclipse platform, that logs many important messages. To get these messages, we have a tool, that collects these logs, saves them in a zip-file and deletes the old logs.

Now we want, that our tool is executed when the user starts our software (by clicking on the executable), but before anything is already logged. However, we can't find a solution.

What we have tried so far:
We thought of packing it in an OSGI-bundle and force it to start early. That's not possible (or not wanted), because before the bundles are loaded, there are already messages in the logs.

Another try was to use the -startup parameter for the executable to start our tool (it works automatically) and then execute the launcher. However, there were two problems:

  1. We can't start the tool, we get a NoSuchMethodError: run-exception. There's neither a method in the code, nor is such a method ever called by us.

  2. We don't know how to start the equinox-launcher.

Is there a way to start our tool prior to loading the osgi-platform?

looper
  • 1,929
  • 23
  • 42

2 Answers2

2

Why not write your own launcher?

Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
0

What about a good old shell script?

Peter Kriens
  • 15,196
  • 1
  • 37
  • 55
  • `when the user starts our software (by clicking on the executable)` That's vital to us. – looper Apr 02 '13 at 13:12
  • I have a tool (jpm4j) that allows you to do this, it reuses the bnd launcher. bnd can create an executable jar. Its launcher has embedded activators that could be reused I guess to give code the go before anything has happened. jpm can then turn this into an exe for windows, or a (clickable) script on macos or linux. However, this is still experimental. Contact me on Peter.Kriens@aQute.biz when you want to play with it. – Peter Kriens Apr 02 '13 at 15:27