Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

can't run -java version

Posted on 2014-04-06
6
404 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

790 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