-2

I am getting problem in bashrc file.After update in JAVA_HOME, I ran source bashrc but still it is pointing java-1.8.0 version.Please help me out. new changes in bashrc

export JAVA_HOME=/home/satyajit/project/packages/jdk1.7.0_80 
export JRE_HOME=/home/satyajit/project/packages/jdk1.7.0_80/jre 
export PATH=$JAVA_HOME/bin:$PATH

When I ran source bashrc o/p:

bash: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-3.b16.el6_9.x86_64: is a directory
jww
  • 97,681
  • 90
  • 411
  • 885
Satyajit Das
  • 111
  • 2
  • 4
  • 1
    If you're accessing a login shell, try editing `.bash_profile` instead. – Mena Nov 06 '17 at 11:13
  • echo your `$PATH` here. – CS_noob Nov 06 '17 at 11:26
  • Hi mena ... I edit .bash_profile but still I am facing same issue – Satyajit Das Nov 06 '17 at 11:26
  • 1
    Man, you made no effort at all. [$JAVA_HOME resets after every terminal login](https://askubuntu.com/q/725697), [$JAVA_HOME path not sourced correctly in ~/bash_profile at login](https://stackoverflow.com/q/46679363/608639), [How to set JAVA_HOME in Linux for all users](https://stackoverflow.com/q/24641536/608639), [How to set environment variable JAVA_HOME that will be saved on exit?](https://unix.stackexchange.com/q/42032/56041), [bash or bash_profile JAVA_HOME permanent export](https://superuser.com/q/611606/173513), etc. – jww Nov 06 '17 at 13:24
  • 2
    Possible duplicate of [How to set JAVA\_HOME in Linux for all users](https://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users) – jww Nov 06 '17 at 13:25

2 Answers2

0

remove ":$PATH" from the path example: export PATH=$JAVA_HOME/bin

After updated class path in .bashrc execute the command "source .bashrc" from terminal or restart the system

Suri
  • 16
  • 1
0

Just try this!It worked for me

export PATH=${JAVA_HOME}/bin:${PATH}

export JAVA_HOME=<path to java file>
export JAVA_HOME=/home/janakan/Applications/jdk1.8.0_241
Sarangan
  • 868
  • 1
  • 8
  • 24
  • What's the difference? You just `$PATH` in the front? – Robert Feb 12 '20 at 05:24
  • I guess it is the syntax that we need to use in bashrc file . Check this link https://unix.stackexchange.com/questions/129143/what-is-the-purpose-of-bashrc-and-how-does-it-work . – Sarangan Feb 16 '20 at 04:29