how add environment variable in ubuntu

Status
Not open for further replies.

mak1012

Journeyman
hey fols i just installed J2ee sdk in my ubuntu but i'm not able to add the environment variable in.. i referenced the sun's site it says
Setting Environment Variables

This section shows how to set environment variables on different operating systems and shells. Each example sets the variable MYVAR to the value widget. The term "local" means that the setting is in effect only for that terminal window. "Global" means that the variable is set for all terminal windows that are subsequently launched.

Unix Bourne and Korn Shells (sh, ksh)

Local:

$ MYVAR=widget
$ export MYVAR

Global:

Edit the $HOME/.profile script so that it includes the preceding assignment and export commands. You need to logout and login again for these changes to take effect.
but in ubuntu there is no $HOME/.profile... please tell me if there is ne other way to do this..
 

praka123

left this forum longback
install from ubuntu's synaptic or apt.dont go for external max possible.
Code:
sudo apt-get install sun-java6-plugin sun-java6-jdk
^^ that's all.this will keep care of those env variables.
btwn ~/.profile is ~/.bash_profile or for the whole system /etc/profile will do.
in my debian root home dir i found a .profile file as below:
Code:
sid:~# cat .profile 
# ~/.profile: executed by Bourne-compatible login shells.

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi
^^ so avoid the hassles always search and install from synaptic or from terminal apt-get.always update package db by pressing "reload" button in synaptic or via terminal "sudo apt-get update"
get ur /etc/apt/sources.list correct if some repos are commented by a "#".
refer more @ *ubuntuguide.org
 
OP
mak1012

mak1012

Journeyman
praka123 said:
install from ubuntu's synaptic or apt.dont go for external max possible.
[/url]

i was trying to install but it gives me this problem i once i was installing second life but i saw it was taking 50MB...i ended the programe in between. now how can i remove clear the uninstalled data from the catch memory?
Code:
 mukesh@mak:~$ sudo apt-get install sun-java6-plugin sun-java6-jdk
Password:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package secondlife-install needs to be reinstalled, but I can't find an archive for it.
mukesh@mak:~$
 

vish786

"The Gentleman"
mak1012 said:
i was trying to install but it gives me this problem i once i was installing second life but i saw it was taking 50MB...i ended the programe in between. now how can i remove clear the uninstalled data from the catch memory?
Code:
 mukesh@mak:~$ sudo apt-get install sun-java6-plugin sun-java6-jdk
Password:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package secondlife-install needs to be reinstalled, but I can't find an archive for it.
mukesh@mak:~$

u want to remove the package from cache folder. ??
if yes, search the package in /var/apt/cache
 
OP
mak1012

mak1012

Journeyman
QwertyManiac said:
Remove Second Life and install JDK, and then install Second Life again.

i'm not able to uninstall secondlife when i open syanptic it gives me dis error
Code:
E: The package secondlife-install needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.

can i delete manually.
 
OP
mak1012

mak1012

Journeyman
praka123 said:
"sudo dpkg --purge secondlife-install"
^ does it helps?

i think i'm in a bad situation.... when i used "sudo dpkg --purge secondlife-install"

it says
Code:
mukesh@mak:~$ sudo dpkg --purge secondlife-install
Password:
dpkg: error processing secondlife-install (--purge):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 secondlife-install
mukesh@mak:~$

and when i tryed to install it i'gating an error this error is coming after installing secondlife.

" The package might be currupted or you are not allowed to open the file. Check the permission of the file"

but i'm the owner of the file..
 

praka123

left this forum longback
Code:
sudo dpkg --force-remove-reinstreq  secondlife-install
^^try
also afterwards "sudo apt-get install -f" while internet is ON.


after trying all above commands just open System>admin>synaptic~status>to verify everything is OK.
 
OP
mak1012

mak1012

Journeyman
praka123 said:
Code:
sudo dpkg --force-remove-reinstreq  secondlife-install

when i use above code i get this error
Code:
mukesh@mak:~$ sudo dpkg --force-remove-reinstreq  secondlife-install
dpkg: need an action option

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --license for copyright license and lack of warranty (GNU GPL) [*].

Options marked [*] produce a lot of output - pipe it through `less' or `more' !
 

praka123

left this forum longback
forgot to tell one line:
Code:
sudo dpkg --force-remove-reinstreq -P secondlife-install
^post if this works.else post the o/p from terminal for below command.
Code:
sudo apt-get install -f

do u have the file secondlife-install_1.xxxgetdeb1_i386.deb already with u?
 
OP
mak1012

mak1012

Journeyman
praka123 said:
forgot to tell one line:
Code:
sudo dpkg --force-remove-reinstreq -P secondlife-install

do u have the file secondlife-install_1.xxxgetdeb1_i386.deb already with u?

thnx budy now i'll never try to install second life:)
yes i have.
 

praka123

left this forum longback
dont forget to do a "sudo apt-get update" or press "reload" in synaptic manager,before try install something.
 
OP
mak1012

mak1012

Journeyman
QwertyManiac said:
So did the Java finally get installed via APT? :)

yeah i succesfully installed the jdk i sun the one simple programe but i want to run servlets and jsp for that i downloaded j2ee sdk but i'm not able to start it in doc. it says to start enter this command in terminal

Code:
Add the install-dir/bin/ directory to the PATH environment variable.

Start the server by entering this command: asadmin start-domain domain1.

i added the directory path in bash.bashrc like this
Code:
export JAVA_HOME=/usr/java/jdk1.6.0_02
export JDK_HOME=$JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$/home/mukesh/SDK/bin
when i enter this command in terminal 'asadmin start-domain domain1' it give me a error
Code:
bash: asadmin: command not found

i'm not able to run servlet coz server is not running. please guide me...
 

praka123

left this forum longback
/home/mukesh/SDK/bin/asadmin start-domain domain1
^try?
make sure PATH is shown.also export works for current session only.
see the o/p of "echo $PATH" for ur set env variables appended.
else u have to edit ~/.bashrc or some similar file to have path set for each session.
if u had installed via synaptic,shud hav been much easier.
 
OP
mak1012

mak1012

Journeyman
i tryd those not working now i dont want to waste my time in configuring ne thing.... i'll do it after my exams....till then XP.
 
Status
Not open for further replies.
Top Bottom