?
Solved

can't run -java version

Posted on 2014-04-06
6
Medium Priority
?
431 Views
Last Modified: 2014-04-06
I'm having home folder PATH issues with my Java install.  I installed the jdk to \jdk.  I tried to run a script and got an error pertaining to JAVA home folder not being found.  I defined the JAVA home folder via  nano ~/.bash_profile.  Whenever I run the config.sh file I get the error below.  I also get the same error when running -java version .  Any ideas?

./config.sh: line 36: /jdk/bin/java: Permission denied
0
Comment
Question by:gopher_49
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:xeroxzerox
ID: 39982238
hi,

First check the permission of /jdk/bin/java via #ll
and after set the user as root and group try it again.
If you got any error message then post it...
0
 

Author Comment

by:gopher_49
ID: 39982248
Please specify in detail... I'm new to Linux.  JDK is installed into /jdk.  The java executable is installed into /jdk/bin.  What command do I run to check the permissions?
0
 
LVL 6

Expert Comment

by:xeroxzerox
ID: 39982264
# ll /jdk/bin/java                  (Note: here ll stand for long listing for check permission)

Output like this
#-rwxrwxr-x  2 root   xerox  4096 2014-04-217 10:06 java

and for set permission (chmod) and owner(chown) of file
#chown -R root.xerox path     (-R stand for recursive permission) (here xerox is a group)

for permission
# chmod 775 filepath

For give only execute permission use
# chmod +x file path
and check permission

4-read
2-write
1-Execute
full permission =7

For more help you can use # man chmod
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:gopher_49
ID: 39982280
I'm able to run 'java -version' now.. But I still get the below error when running ./config.sh.  I also included the results of the command you asked me to run.

-rw-r--r--. 1 root root 7718 Dec 18 21:13 /jdk/bin/java

[root@PIPSAtlassian1 bin]# ./config.sh
./config.sh: line 36: /jdk/bin/java: Permission denied
0
 
LVL 6

Accepted Solution

by:
xeroxzerox earned 2000 total points
ID: 39982290
This time permission on this file is 644.

Now set the permission.
#chmod 775 /jdk/bin/java
and again try to run ./config
0
 

Author Comment

by:gopher_49
ID: 39982294
That worked!  thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question