Tag Info

New answers tagged

1

It seems you have included the file name in the path, which is wrong. The PATH must contain the directory that in turn contains the executable you want to run, not the executable itself. Use this: export PATH=$PATH:/usr/local/zettair/bin This will work for the running session and all child processes only, you can make it permanent by adding it to your ...


0

Like the process you define your own environment variable, for example by edit '~/.bashrc', you can define root's environment variable by edit '/root/.bashrc'.


0

Install the JDK with a PPA: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer And after that sudo apt-get install oracle-java8-set-default Check the installation: % java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM ...


2

The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles. Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present: /etc/environment ~/.profile ~/.bashrc Once removing the line from the file, log ...


1

Thanks a lot for your reply AB. However i found a much better solution. I simply added in the CATALINA_OPTS variable of tomcat in the file /usr/share/tomcat7/bin/setenv.sh: export CATALINA_OPTS="-Dhost.name=localhost" This worked exactly as I wanted.


2

I do not understand why that is required for Tomcat. All configuratios are in eg: /etc/tomcat7/server.xml. I have worked for several years with Tomcat, but this kind of configuration I've never needed. Anyway here is your answer. TL;DR env "host.name=localhost" Test with: env "host.name=localhost" perl -le 'print $ENV{"host.name"}' or with Java: ...


2

a= cut -f 1 abc.txt This doesn't work, this will assign the word 'command' cut to the variable a. The correct syntax is a=`cut -f 1 abc.txt` Now you can run the command echo $a and check the result. Works The second command cut -f 1 abc.txt >a This will redirect the output of the command cut -f 1 abc.txt into a newly created file named a ...


0

From man bash: When bash is invoked as an interactive login shell, or as a non-inter‐ active shell with the --login option, it first reads and executes com‐ mands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands ...


2

Normally, .bashrc is only sourced for interactive shells, but many linux distributions decide to build bash with a special option to also source it for non-interactive shells if a SSH_something variable is in the environment. However, it doesn't switch the shell to interactive mode when doing this, so the following case command near the top of the default ...


1

/etc/environment is where the default PATH is set. To remove a directory from that, I suppose the easiest way is to edit it directly. OTOH I think you should think twice before doing so. Otherwise, as has been mentioned in other answers, there are several possible places where you could add a directory. Also, the tutorial EnvironmentVariable provides useful ...


1

/etc/profile : A global configuration script that applies to all users. ~/.bash_profile : A user's personal startup file. Can be used to extend or override settings in the global configuration script. ~/.bash_login : If ~/.bash_profile is not found, bash attempts to read this script. ~/.profile --> If neither ~/.bash_profile nor ~/.bash_login is found, ...


0

if you are able to run java commands like java --version from the terminal, the PATH is correct and in turn, the JAVA_HOME variable is correct.


0

One time for the duration of the session (ie. the compiling of the software): BUILD_OPT=1 USE_64=1 export BUILD_OPT export USE_64 You need to issue this before the make nss_build_all.


0

If you have update-java-alternatives installed, just type $>update-java-alternatives -l From the manual man update-java-alternatives DESCRIPTION update-java-alternatives updates all alternatives belonging to one runtime or development kit for the Java language. A package does provide these information of it's alter‐ natives ...


1

Your $JAVAHOME is pointing to the correct location. But the path should have $JAVAHOME/bin directory and not $JAVAHOME itself. JAVA_HOME="/opt/jdk1.7.75" export JAVA_HOME PATH="$PATH:$JAVA_HOME/bin" You should consider using the Oracle Java PPA instead. It usually does more than what a manual installation would do. You don't have to worry about setting ...


0

You can use php /var/www/html/yourProjctFolder/yourFile.php This will call your php file and output if you have written echo or print statement


0

I finally stumbled across this answer. The way to do this is to load the bash shell and pass the command to it. capture("/bin/sh -c 'echo $ENV_VAR'")


3

I think your problem is due the space in the environment variable's contents. Looking at the examples from the systemd docs, an assignment should be a single string: Example: Environment="ONE=one" 'TWO=two two' ExecStart=/bin/echo $ONE $TWO ${TWO} This will execute /bin/echo with four arguments: one, two, two, and two two. Example: ...



Top 50 recent answers are included