Solved

can't run -java version

Posted on 2014-04-06
6
396 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now