Libreoffice on Ubuntu: how to fix error: failed to read path from javaldx


If we are using libreoffice in headless, with a non root user, trying to convert files with libreoffice, we will get error:

root@amd:~# sudo -u www-data php -r "exec(\"/usr/bin/libreoffice --headless --convert-to pdf '/home/app.tutorialspots.com/public_html/admin/data/downloads/reservation-64.docx' --outdir '/home/app.tutorialspots.com/public_html/admin/data/downloads/'\");"
javaldx failed!
Warning: failed to read path from javaldx
LibreOffice 7.3 - Fatal Error: The application cannot be started.
User installation could not be completed.

Check in HOME directory of the user, example we use user www-data, HOME directory is /var/www
Find folder .config, if this folder isn’t exists, we must create it
In folder .config, we find folder libreoffice, if this folder isn’t exists, we must create it

Now run this command:
chown -R www-data:www-data /var/www

Leave a Reply