Discussion:
Set an environment variable for an app.
Karen Thompson
2012-05-21 19:40:54 UTC
Permalink
Hi,
I need to set an environemt variable for a program running via
vncviewer. It requires a env. variable JAVA_HOME=/usr/java/jre1.6.0_31. I
have tried looking up on the web for hours and have had no luck. I am sure
this is something very easy, if I just knew how.

Thanks,

Karen
Philip Herlihy
2012-05-22 10:21:46 UTC
Permalink
I'm extremely rusty with all things Unix, and I've never played with Linux,
but this might help.

https://www.ccs.uky.edu/docs/cluster/env.html

Philip Herlihy
Email: ***@Herlihy.eu.com

-----Original Message-----
From: vnc-list-***@realvnc.com [mailto:vnc-list-***@realvnc.com] On
Behalf Of Karen Thompson
Sent: 21 May 2012 20:41
To: vnc-***@realvnc.com
Subject: Set an environment variable for an app.

Hi,
I need to set an environemt variable for a program running via
vncviewer. It requires a env. variable JAVA_HOME=/usr/java/jre1.6.0_31. I
have tried looking up on the web for hours and have had no luck. I am sure
this is something very easy, if I just knew how.

Thanks,

Karen
Mike Miller
2012-05-22 10:36:50 UTC
Permalink
Post by Karen Thompson
I need to set an environemt variable for a program running via
vncviewer. It requires a env. variable JAVA_HOME=/usr/java/jre1.6.0_31.
I have tried looking up on the web for hours and have had no luck. I am
sure this is something very easy, if I just knew how.
I would think that you could just add it to the ~/.vnc/xstartup file just
after the first line (the first line is typically "#!/bin/sh" without the
quotes):

export JAVA_HOME=/usr/java/jre1.6.0_31

(I removed a period from the end of that line assuming it wasn't meant to
be part of the line.)

Mike
Adrian Phillips
2012-05-22 10:41:49 UTC
Permalink
Karen> Hi, I need to set an environemt variable for a program
Karen> running via vncviewer. It requires a env. variable
Karen> JAVA_HOME=/usr/java/jre1.6.0_31. I have tried looking up
Karen> on the web for hours and have had no luck. I am sure this
Karen> is something very easy, if I just knew how.

man vncserver :-

$HOME/.vnc/xstartup A shell script specifying X applications to
be run when a VNC desktop is started. If it doesn't
exist, vncserver will create a new one which runs a
couple of basic applications.

Specify whatever you want in there (its just a shell script).

Sincerely,

Adrian Phillips
--
Perl hacker | Ubuntu user
Skype: adrianp-mobile | Fring: 4790594804
Continue reading on narkive:
Loading...