Я не знаю о Lua конкретно, но можно обычно выполнять команду как:
comd >comd.txt 2>&1
для получения вывода и ошибки в файл comd.txt затем используйте функции файлового ввода-вывода языков для чтения его в.
Это - то, как я сделал бы это, если бы сам язык не предусмотрел получение stanard вывод и ошибка.
The short answer (certainly for OSGi 4.1, not sure of 4.2) is you can't get a bundle's classloader. However the Bundle
interface exposes a loadClass()
method and this would allow you to write a classloader that wraps the bundle API and delegates to that loadClass()
method. Or you can save some time and use Spring DM's BundleDelegatingClassLoader
class instead.
В обычном Java-коде вы можете получить загрузчик классов, который загрузил данный объект, с помощью
object.getClass().getClassLoader();
Или даже просто
SomeType.class.getClassLoader();
То же самое относится к Equinox ,