LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2016, 05:01 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 508

Rep: Reputation: 29
javac not working on my centos7 install


hi guys,

installed jdk on my centos7 box

but when i type javac i get:
bash: javac: command not found...
Similar command is: 'java'

and when i go whereis javac i get:
/opt/jdk1.8.0_91/bin/javac

i added the above to my path:
]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/wbrandt/.local/bin:/home/wbrandt/bin:/opt/jdk1.8.0_91/bin/javac

dont think its a path thing
when i:
[wbrandt@localhost bin]$ javac
bash: javac: command not found...
Similar command is: 'java'
[wbrandt@localhost bin]$ ./javac
bash: ./javac: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

the above is when im in the opt directory:
/opt/jdk1.8.0_91/bin/


why cant it work?
also if i need it to run everytime do i need to add it to another config file?

tanks

Last edited by sigint-ninja; 07-10-2016 at 05:17 AM.
 
Old 07-10-2016, 05:33 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
It has to be on your search path to find it - Make sure the path to the command is in the PATH environment variable list.

You might also check to see if there is a module command that will set up your environment for java. I believe RH has the module command that is used to evaluate configuration scripts for various facilities.

There is also google - that shows http://introcs.cs.princeton.edu/java...linux-cmd.html

Last edited by jpollard; 07-10-2016 at 05:37 AM.
 
Old 07-10-2016, 12:14 PM   #3
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 508

Original Poster
Rep: Reputation: 29
thanks jpollard,

turned out i was missing a glibc package of some sort,installed it
changed the path in my .bash_profile
javac is working fine
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb speakers not working on centos7 sigint-ninja Linux - Newbie 2 07-09-2016 10:52 AM
javac don't working yuxelfindik Linux - Software 1 03-13-2007 07:43 AM
Make javac working globally manolakis Linux - Newbie 10 11-14-2006 06:17 PM
javac not working (LauroMoura kindly see) nedian123 Programming 2 12-18-2004 11:18 PM
javac not working nedian123 Programming 1 12-15-2004 10:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration