Solved

can't run -java version

Posted on 2014-04-06
6
401 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 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