Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-23-2014, 07:25 AM   #1
LQ Newbie
Registered: Nov 2014
Posts: 2

Rep: Reputation: Disabled
cannot access /usr/bin/java

I hope you can help me with the following java problem that I have. I am running Linux MInt 17. I remove defualt openjdk installed and I put manually in /opt/java/jdk1.7.0_71 the oracle jdk1.7.

I run the following commands:
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_71/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_71/bin/java

after that I run also for jdk1.6 to have these two options.

If I am runnig:
sudo update-alternatives --config java
I can see correclty installed alternatives above.

The problem apears after I want to run: java -version
I get the results as this command cannot be found. If I run: sudo java -version it runs correctly.
In the $PATH variable I can see the path: /usr/bin where the java symlink is.

All the above problem is also for javac. Could you please to clarify me what I am missing to understand the issue?
Old 11-23-2014, 02:30 PM   #2
LQ Newbie
Registered: Nov 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
I fix the problem. The issue was on /opt/java folder who has the "700" permission. I change it to "755" and now the "java -version" is working with regular user without "sudo". I found the problem running "namei -lo /opt/java/jdk1.7.0_71/bin/java" command. Thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or director irlogo Red Hat 5 03-12-2012 04:38 AM
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
Failed to chck remot comnd executin using shells /usr/bin/ssh and /usr/bin/rsh farnaw4u Linux - Software 2 04-06-2009 12:08 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration