LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-12-2005, 05:17 PM   #1
tisam
LQ Newbie
 
Registered: Nov 2004
Distribution: Debian unstable,2.6.10
Posts: 15

Rep: Reputation: 0
How to make javac (java compiler) available on whole system?


Hi !

What I'd like to do is to enable user to compile java source or run java virtual machine anywhere, just by typing javac <the rest>. I've added this lines to /etc/profile :

# Java SDK Path
export JAVA_HOME=/usr/local/lib/jdk1.5.0_01/
export PATH=$PATH:$JAVA_HOME/bin/
These lines are in the end of the file.

My task is nearly done bacause without logging into X i have java & javac available. But when I start KDE i can't run this.In terminal I get :

bash: java: command not found

Any tips on how to enable the above in KDE ? Thanks in advance !
 
Old 02-12-2005, 07:01 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Perhaps KDE is not starting your terminal as a "login shell"? I haven't a clue what would control this as I avoid KDE like the plague, but it sounds like that's the problem.
 
Old 02-12-2005, 11:59 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Just add the same lines to your ~/.bashrc or add this to ~/.bashrc
source /etc/profile
 
Old 02-13-2005, 07:08 AM   #4
tisam
LQ Newbie
 
Registered: Nov 2004
Distribution: Debian unstable,2.6.10
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by 95se
Just add the same lines to your ~/.bashrc or add this to ~/.bashrc
source /etc/profile
Thanks very much ! This did the job !
 
Old 02-13-2005, 08:35 AM   #5
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Rep: Reputation: 15
Hi there! I want to do the same with mozilla firefox, I've installed it in a subfolder inside my Desktop, quite odd setting, but that was my first programme to install on linux so I wanted it working fast . My problem is that aMSN, for example, can't execute the browser by typing 'mozilla $url'. I've tried to solve the problem by adding a soft link in /usr/bin but that didn't work, in fact, it tells me: 'Can't find mozilla native folder' (or something like that). I think that the solution is by knowing which variable to export in my .bashrc file.

Thanks in advance!
 
Old 02-13-2005, 09:34 AM   #6
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
pujolasdf:

put this is your users .profile (or .bash_profile or whatever)

export PATH=$PATH:$HOME/Desktop/firefox folder
 
Old 02-13-2005, 09:36 AM   #7
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Quote:
Originally posted by tisam
Thanks very much ! This did the job !
Just don't forget what you did to fix it. If you want to add another user account, it will have to have the same thing done to it (which is why I suggested fixing the problem in KDE to work like it is supposed to )
 
Old 02-13-2005, 02:00 PM   #8
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Quote:
Originally posted by tisam
Thanks very much ! This did the job !
No problem

Quote:
Originally posted by sigsegv
Just don't forget what you did to fix it. If you want to add another user account, it will have to have the same thing done to it (which is why I suggested fixing the problem in KDE to work like it is supposed to )
Check out your /etc/skel directory. Each time you create a new user, it uses this directory as the skeleton. It will put all the files and stuff in this directory into the new users directory. So just add the same .bashrc to /etc/skel, and everytime you create a user, it'll have it! You need this because bash only runs /etc/profile on with a login shell (i.e. bash --login), but it runs ~/.bashrc each time you start a new shell regardless.
 
Old 02-13-2005, 02:31 PM   #9
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Quote:
Originally posted by 95se
Check out your /etc/skel directory. Each time you create a new user, it uses this directory as the skeleton. It will put all the files and stuff in this directory into the new users directory. So just add the same .bashrc to /etc/skel, and everytime you create a user, it'll have it! You need this because bash only runs /etc/profile on with a login shell (i.e. bash --login), but it runs ~/.bashrc each time you start a new shell regardless.
Yeah, I know.

Call me a purist, but when I start a shell, I want it to be a login shell. Kinda like how 'su' is aliased to 'su -' on all my accounts
 
Old 02-13-2005, 02:43 PM   #10
tisam
LQ Newbie
 
Registered: Nov 2004
Distribution: Debian unstable,2.6.10
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by 95se
Check out your /etc/skel directory. Each time you create a new user, it uses this directory as the skeleton. It will put all the files and stuff in this directory into the new users directory. So just add the same .bashrc to /etc/skel, and everytime you create a user, it'll have it! You need this because bash only runs /etc/profile on with a login shell (i.e. bash --login), but it runs ~/.bashrc each time you start a new shell regardless.
Thanks for this great tip! I've just done it! No more troubles with that !
 
Old 02-13-2005, 05:40 PM   #11
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Rep: Reputation: 15
Hey, thank you very much! By the way, do you know any place where I can learn more about those variables and 'export'-like (uh...) commands? Maybe in an UNIX scripting book?
 
Old 02-14-2005, 10:11 AM   #12
OneManArmy
Member
 
Registered: Apr 2004
Location: Motherboard
Distribution: Debian GNU/Linux
Posts: 156

Rep: Reputation: 30
here, here and here
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I configure 'javac' and Using Java on Linux akosombo Linux - General 7 03-13-2005 09:26 AM
use gcc or javac for java compile? jordanGSU Programming 22 10-15-2004 10:12 AM
Help php compile javac or java system environment variable antony_csf Programming 1 06-16-2004 02:12 PM
Help php exec, system function for compile javac or java antony_csf Programming 0 06-15-2004 02:45 AM
Can't compile Java Swing Applet with javac chansky Programming 4 09-23-2002 05:50 PM


All times are GMT -5. The time now is 04:50 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration