Solved

can't run -java version

Posted on 2014-04-06
6
399 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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 …
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…
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.

930 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

13 Experts available now in Live!

Get 1:1 Help Now