How to start a program from basic macro

Hello everybody,
My name is Andrea Adami i start using libreoffice some years ago and i start using libreoffice base and macro programming in this last weeks with great happinest
I’m usign libreoffice community version 7.1.1.2 on ubuntu version 20.04 with full updated.
I need to start a program (a java program to print a report)
I saw many way to start a program from a macro (shell basic command, com.sun.star.system.SystemShellExecuteservice)
But they didn’t work.
simply they did not nothing.
I tried:

  Dim oSvc as object
  Dim rc 
  
  rc = shell("gedit")                REM file not found
  rc = shell("bash -c 'gedit'")  REM does nothing
  rc = shell("/usr/bin/gedit")   REM file not found
   
  oSvc = createUnoService("com.sun.star.system.SystemShellExecute")

  oSvc.execute("gedit", "", 0)               REM does nothing
  oSvc.execute("bash -c 'gedit'", "", 0) REM does nothing
  oSvc.execute("/usr/bin/gedit", "", 0)  REM does nothing

From terminal either the comand:

gedit

or

/usr/bin/gedit

start the text editor

This is driving me crazy …

Thanks in advance if someone can help me

Andrea Adami

rc = shell("/usr/bin/gedit") works for me on openSUSE 15.2 / LibreOffice 7.1.1 (though I’d just use shell("/usr/bin/gedit", since return code from that is of almost no value)

In my box doesn’t (plese check the image enclosed)image description

the text:

“errore di runtim BASIC.
file nontrovato”

the translation in english is:

“BASIC runtime error
file not found”

I Fixed it
The problem was that i installed libreoffice via flatpak |
I can image that the shell was inside the image of flatpak where there is not another program like gedit.
I uninstall libreoffice via flatpak and install it via apt and now it works !