LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trying to start openoffice in linux (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-start-openoffice-in-linux-916191/)

fachhoch@gmail.com 11-29-2011 09:35 AM

trying to start openoffice in linux
 
I am trying to start openoffice3 in linux ,failing with this error

Code:


[root@ACFAS11 ~]# /usr/lib64/openoffice.org3/program/soffice
/usr/lib64/openoffice.org3/program/soffice.bin X11 error: Can't open display:
  Set DISPLAY environment variable, use -display option
  or check permissions of your X-Server
  (See "man X" resp. "man xhost" for details)

please advice me what is causing this and how to resolve this.

bathory 11-29-2011 11:00 AM

Hi,

Why are you trying to run soffice as root? You should run it as a normal user.
In any case, if you have logged in X as a normal user and then su to root to run soffice you need to do the following:
In an xterm as normal user run:
Code:

xhost +localhost
su -
export DISPLAY=:0.0
/usr/lib64/openoffice.org3/program/soffice

Regards

fachhoch@gmail.com 11-29-2011 02:13 PM

I want to run openoffice as a service not as s GUI ,I am using jodconverter http://artofsolving.com/node/12

jodconverter has java java api which allows file conversion in various formats this jodconverter internally uses openoffice.The api connects to openoffice running as a service.
the link aboove talks about running openoffice as a service in linux . I am trying to run openoffice as service.

fachhoch@gmail.com 11-29-2011 02:21 PM

I tried this still failing

Code:

[root@ACFAS11 webapps]# export DISPLAY=:0.0
[root@ACFAS11 webapps]# echo $DISPLAY
:0.0
[root@ACFAS11 webapps]#  /usr/lib64/openoffice.org3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

/usr/lib64/openoffice.org3/program/soffice.bin X11 error: Can't open display:
  Set DISPLAY environment variable, use -display option
  or check permissions of your X-Server
  (See "man X" resp. "man xhost" for details)
[root@ACFAS11 webapps]#


bathory 11-29-2011 03:33 PM

Hi,

According to the link you've posted, you don't need to set a DISPLAY. Instead you need to unset it, if it's already set (i.e. if you're going to run the soffice command from inside an X terminal)
Quote:

$ unset DISPLAY
$ soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
BTW, I've tested the command above from CLI and it works as expected. It only complained that using a simple dash "-" is deprecated (I'm running libreoffice), so I had to use double dashes:
Code:

soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard
Regards

fachhoch@gmail.com 11-30-2011 09:35 AM

Initially I tried
Code:

$ unset DISPLAY
as it is not working I tried your suggestions. I am loggin to this linux server using ssh , you said about X Terminal, I dont know about X terminal do I need one ? canT I do this using ssh ?

bathory 11-30-2011 01:53 PM

Quote:

I am loggin to this linux server using ssh , you said about X Terminal, I dont know about X terminal do I need one ? canT I do this using ssh ?
If you use ssh to connect to the remote box, there is no DISPLAY set, so you don't have to unset it, even it doesn't hurt to.
To verify you can run:
Code:

echo $DISPLAY
Just run the soffice command and see what happens

Regards

fachhoch@gmail.com 12-01-2011 09:29 AM

Quote:

Originally Posted by bathory (Post 4538470)
If you use ssh to connect to the remote box, there is no DISPLAY set, so you don't have to unset it, even it doesn't hurt to.
To verify you can run:
Code:

echo $DISPLAY
Just run the soffice command and see what happens

Regards



I did as you said.
Code:

[root@ACFAS11 ~]# echo $DISPLAY

[root@ACFAS11 ~]# /usr/lib64/openoffice.org3/program/soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard
/usr/lib64/openoffice.org3/program/soffice.bin X11 error: Can't open display:
  Set DISPLAY environment variable, use -display option
  or check permissions of your X-Server
  (See "man X" resp. "man xhost" for details)
[root@ACFAS11 ~]#

its the same error.

bathory 12-01-2011 12:30 PM

Huh, it works here (Slackware and LibreOffice 3.4.4) and I don't think that Openoffice is different on this.
Anyway try to run Xvfb before soffice to get a dummy DISPLAY and see what you have
Code:

Xvfb :0 -screen 0 1024x768x8 &
soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --display 0:0


fachhoch@gmail.com 12-01-2011 01:57 PM

Quote:

Originally Posted by bathory (Post 4539350)
Huh, it works here (Slackware and LibreOffice 3.4.4) and I don't think that Openoffice is different on this.
Anyway try to run Xvfb before soffice to get a dummy DISPLAY and see what you have
Code:

Xvfb :0 -screen 0 1024x768x8 &
so/usffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --display 0:0


still not working

Code:

[root@ACFAS11 ~]# Xvfb :0 -screen 0 1024x768x8 &
[1] 16600
[root@ACFAS11 ~]# -bash: Xvfb: command not found

[root@ACFAS11 ~]# /usr/lib64/openoffice.org3/program/soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --display 0:0
/usr/lib64/openoffice.org3/program/soffice.bin X11 error: Can't open display: 0:0
  Set DISPLAY environment variable, use -display option
  or check permissions of your X-Server
  (See "man X" resp. "man xhost" for details)
[1]+  Exit 127                Xvfb :0 -screen 0 1024x768x8
[root@ACFAS11 ~]#


bathory 12-01-2011 02:27 PM

You don't have Xvfb installed. You can use your package manager to install it.
What is your distro btw?
There is an openoffice-headless package for various distros (e.g for centos it's openoffice.org-headless), so you might install that, instead of going into that trouble.

Regards

fachhoch@gmail.com 12-02-2011 10:03 AM

Quote:

Originally Posted by bathory (Post 4539431)
You don't have Xvfb installed. You can use your package manager to install it.
What is your distro btw?
There is an openoffice-headless package for various distros (e.g for centos it's openoffice.org-headless), so you might install that, instead of going into that trouble.

Regards



Thanks a lot for all your help,

I tried this

Code:

[root@ACFAS11 tmp]# yum install openoffice.org-headless
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.lga7.us.voxel.net
 * updates: mirror.ash.fastserv.com
 * extras: mirror.ash.fastserv.com
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package openoffice.org-headless.x86_64 1:3.1.1-19.5.el5_5.6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================================

 Package                                                  Arch                                    Version                                                  Repository                            Size
=======================================================================================================================================================================================================

Installing:
 openoffice.org-headless                                  x86_64                                  1:3.1.1-19.5.el5_5.6                                    base                                  672 k

Transaction Summary
=======================================================================================================================================================================================================

Install      1 Package(s)       
Update      0 Package(s)       
Remove      0 Package(s)       

Total download size: 672 k
Is this ok [y/N]: y
Downloading Packages:
openoffice.org-headless-3.1.1-19.5.el5_5.6.x86_64.rpm                                                                                                                          | 672 kB    00:00   

Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing    : openoffice.org-headless                          [1/1]

Installed: openoffice.org-headless.x86_64 1:3.1.1-19.5.el5_5.6
Complete!

I dont know where it installed
I tried find

Code:


[root@ACFAS11 tmp]# find /  -name 'soffice'
/usr/lib64/openoffice.org3/program/soffice
/usr/bin/soffice

it still showing the two old installations ,Help me further.

bathory 12-02-2011 10:40 AM

Hi,

I can only guess that /usr/bin/soffice is a symlink for /usr/lib64/openoffice.org3/program/soffice.
Did you try to see if it works now?

fachhoch@gmail.com 12-02-2011 12:26 PM

Quote:

Originally Posted by bathory (Post 4540316)
Hi,

I can only guess that /usr/bin/soffice is a symlink for /usr/lib64/openoffice.org3/program/soffice.
Did you try to see if it works now?

Yes it worked. Thanks


All times are GMT -5. The time now is 06:45 PM.