LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2005, 03:19 PM   #1
Azzath
Member
 
Registered: Jan 2005
Location: Russia
Distribution: Mandrake, CentOS
Posts: 138

Rep: Reputation: 16
Talking Java compilation path


Hello and thanking everyone helping out there!! You guys have no idea how much of appriciation me and my firend's got for everyone's whose helping out in this site!!
Anyway.....
I need to know if anyone could tell me a way to compile my java programs without giving the javac path....like
/usr/java/j2sdk1.4.2_07/bin/javac HelloWorld.java
.....
i have just installed java. And its a bit of time taking by giving the whole path like i had typed above. Could someone give me an idea to straight forwardly make it to understand the "javac" and "java" commands from the command prompt....i.e
azzath@d_hyper java_programs]$ javac
bash: javac: command not found
without getting this error message...
Thanks in advance.

.................................................................................................... ...........................................
anyone who is trying to install java then hopefully this site would help i guess, cuz i got help from this site.
http://home.bredband.no/gaulyk/java...javaredhat.html
 
Old 02-02-2005, 03:22 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
aliasing the command in your rc file should be painless...

edit:
alias javac='/path/to/javac'
 
Old 02-02-2005, 03:38 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
What may be an even better bet is to add it to your path. If you use bash, open up your /etc/profile
then where it says:
PATH=/bunch/of:/different/paths
add on
:/opt/jdk-1.5/bin
or whatever the path is to your java bin directory.
Or in some start up file add
PATH=$PATH:/path/to/java/bin
export PATH
 
Old 02-02-2005, 06:00 PM   #4
Azzath
Member
 
Registered: Jan 2005
Location: Russia
Distribution: Mandrake, CentOS
Posts: 138

Original Poster
Rep: Reputation: 16
Thanx secresh and 95SE

Guys tank you for your replies,
But i prefer what 95SE said, that is editing the path,
I did an emacs to profile script & the i found it as this..
export PATH=$PATH:/usr/games

so how do i fix the "export PATH=$PATH:/usr/java/jdk*/bin/" bit into this?

Thanx mate.
Azzath.
 
Old 02-02-2005, 06:35 PM   #5
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
you can just put the line "export PATH=$PATH:/usr/java/jdk*/bin/" at the end of /etc/profile. $PATH in the command contains all the previous path added in /etc/profile including /usr/games.
 
  


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
help neede with java source file compilation max_rsr Programming 2 05-16-2005 09:35 PM
Path to java mherring Linux - Software 1 05-04-2005 07:11 PM
Python compilation error, "module search path"etc.. mindfestival Linux - Newbie 0 05-31-2004 02:52 AM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 09:55 PM
Java compilation problem JIV Programming 1 06-02-2003 10:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:46 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