Fedora :: Setting Environment Variable Using Export JAVA_HOME=/usr/java/jdk1?
Jul 28, 2010
I am a newbie to Linux. I tried setting environment variable using export JAVA_HOME=/usr/java/jdk1.6 but that was not permanent (i.e is was there for that terminal session). I want to know how can i set environment variable permanently in Fedora 13 just like we do in windows.After google search, some user suggested to edit bashrc and profile file for setting environment variables but above file contains some shell programs.
I have problems with setting my JAVA_HOME variable. I am using Slackware 12.0, bash shell. This is a question for the 'Linux Newbie' forum (not slackware-specific).
I have set JAVA_HOME in my /etc/profile, like this:
But when I login in with my user name and type env on the command line, I get for JAVA_HOME the following:
Also, in my /etc/profile I have put the path to my java in the PATH variable, like this:
And when I type env when I login, then the PATH variable contains correctly the path to the jdk (as I have put it into /etc/profile).
I expect that after I have set everything as I want in /etc/profile, and restart the computer then what I have set will be relevant and when I login and type env, I will get values to the variables equal to those I have set in /etc/profile. Why it does not happen?
I have particularly a problem with a Java application, which I want to run. When I type ant, I get: error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/java/bin/java.
i have added a tomcat startup service using chkconfig. I have set up JAVA_HOME and JRE_HOME as well ass alternatives to point to the correct location.I have an init script in /etc/init.d. When i start the tomcat service using [ /etc/init.d/<x> start ] everything works fine and the environment variables for JAVA_HOME and JRE_HOME are used correctly.Now i added the service <x> using chkconfig --add so that it can start on boot up. But now the service does not use the system environment variable for JAVA and JRE setup by me.Also after complete bootup if i try to start the service using [ service <x> start] the environment variable in the shell are not used. don't want to exclusively declare variables for JAVA_HOME and JRE_HOME in the init script.
I have been trying to change my PATH environment variable to no avail. I am using Jessie i386 with MATE. Using my .bashrc file works but not well because with subshells the modifications get repeated. I want the change to occur on login.
I tried modifying ~/.profile ~/.bash_profile /etc/profile and /etc/environment and one or two others but in no case did my change get picked up even after logging out and in again and even after rebooting. I searched the Internet and found each of the above places to make the change but they don't seem to work with Jessie.
1. check JAVA version, 2. set up the JAVA_HOME and 3. CLASSPATH variables
I had installed
1. NetbeansIDE 6.7.1 from Software Center 2. MySQL from command sudo apt-get install mysql-server 3. libmysql-java from synaptic package manager
OS Information
1. Partition 1, 3.0 GB Swap Space, /dev/sda1 2. Partition 2, 6.0 GB Filesystem, /dev/sda2 mount at /, Bootable 3. Partition 3, Ext4, /dev/sda3 mount at /home 4. Partition 4, /dev/sda4, Extended (Drive A, Drive B and Drive C)
I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)
I have some Flex and Java files which can be compiled with JDK1.5. My server was already loaded with 1.4 (at path /usr/bin/java) and our sys admin(I dont know why) copied another JDK, JDK 1.5 at path /usr/java/jdk1.5.0_16/. It seems very easy to use this java. Just set the path in .bash_profile. I did it and now if I run which java I still see the path for java 1.4 not java 1.5. Am I doing something wrong? Following is actual entry from bash_profile
I installed "jdk1.6.0.bin" and "jre1.6.0.bin" successfully. But I don't know where they are installed. I can't find anywhere. What is the default path they are installed.I want to set JAVA_HOME.
I installed new jre in linux. but i when i checked env variable $JAVA, it is showing old version. how to set the default java env variable to new installed location
Is there any way to use "export" inside a bash script that will affect the variable in the parent process (i.e. the terminal where the script was run)?
I need to be able to set a variable that is used by my build environment. I need to be able to change this variable "on the fly" as I work with multiple build environments. A portion of the variable is arbitrary, so I need to treat the arbitrary portion of the variable as an argument.
I would normally just create an alias, but BASH doesn't support arguments to aliases. So the workaround for the no-alias-arguments bug is to use a script. No problem. Except the variable I set in the script does not exist when I exit the script.Now, if I run the script by using "$ . myscript" it works in that the variable is set after it exits. The problem is the argument checking I have in the script doesn't work anymore. BASH aliases don't support arguments and I can't export a variable from a script unless I source the script (is it even a script at that point?) Maybe I am simply taking the wrong approach.
installing the software BluePad, which allows a user to control their desktop environment with a Java-enabled mobile phone. I am still adjusting to Fedora (and some other Linux distros) from Windows and I am unfamiliar with installing and executing software programs. Also, if you could also include any pre-requirements involved in the installation..
I'm trying to add 2 new environment variables (Debian . I have created a "/etc/profile.d/java.sh" file and in it I have added these lines (and just for the record, I've also tried adding those line to the profile file with the same results as explained below).
The first variable "XAPPLRESDIR" is added just fine (I check by doing echo $XAPPLRESDIR). The second variable is not added. Here's what I discovered though, if I change the variable name to LD_LIBRARY_PATK (I change the word "path" into something else) then it works just fine... So how am I supposed to add this variable? I need it to be named just that...
Well on a Rsps forum it says that the reason i keep crashing in the client is cause my Envieronment Variable isnt set for Java. i was wondering how to do this.please make it deatailed since i am new to ubuntu and i dont know most of the things like usr/java
how to set environment variable as i am getting following message during ./configure.
checking for GtkGLExt - version >= 1.0.0... *** pkg-config cannot find gtkglext-1.0 >= 1.0.0 *** Set the environment variable PKG_CONFIG_PATH to point to the correct
I'm setting my CLASSPATH in /etc/profile.d/jre.sh. In a login shelleverything is fine. In an xterm window, the CLASSPATH consists of two of every intended entry.In jre.sh I am doing aCode:export CLASSPATH=$CLASSPATH:/many/paths/to/jarsSo I'm guessing this is getting run twice in the xterm case. Can someone explain what's going on here and what I should do to remedy this?
I'm trying to configure subclipse with JAVAHL for ganymede. I have everything installed and the right version of the JAVAHL.
I have seen that a lot of people uses java.library.path in the eclipse.ini file to set it up or just write a script for launching eclipse.
I have read about the .gnomerc file but i couldn't find it or create one and make it work. I'm using a 9.04 ubuntu.. is there anyway to configure an environment variable for gnome? What i want is just click on the shotcut and have it working, not having to run a script or all that stuff.
I just upgraded to 10.10, I use Tilda (terminal client) on my desktop but now when I type "clear" it says "TERM environment variable not set." instead of clearing the screen. Also commands like "tree" does not show folders and iles in color like they did before upgrading.
I have just installed Ubuntu onto my machine and my question is if it automatically comes with the PATH environment variable?If so, how do I add something such as python.exe to the PATH environment variable?
I am trying to create a launcher which runs virtual box from a custom config directory. For this I have to set an environment variable first then call VirtualBox command. From terminal it looks like:
i have to set environment variables , after the installation of intel(R)MKL for linux OS given in intel mkl user guide, which are INCLUDE, LD_LIBRARY_PATH, MANPATH,LIBRARY_PATH, CPATH, FPATH, NLSPATH using the script file which, in my case,is "mklvarsem64t.sh"How can i set these environment variables?Do i need to set all these variables?
In C, there's a global variable 'environ'. With the help of linux manual, I know it's defined in <unistd.h>. But the fowllowing program is also right without <unistd.h>: