Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem in Configure JAVA in Linux

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Java peoples,
I am new person for linux.
I install java1.4 in RedHat Linux8.0 and set the path in profile file of /etc directory of linux.
PATH=/usr/java/j2sdk1.4.0_01/bin:$PATH
JAVA_HOME=/usr/java/j2sdk1.4.0_01
export PATH JAVA_HOME ...
When I compile one java file it will gives the error
bash: javac: command not found
Please give the suggustion to configure the java in linux
Thanks in advance,
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you try other shells, e.g. Bourne shell, Ksh
or csh.
To verify if PATH is set properly, try
$ echo $PATH
Another possible reason, you might need to modify
/.profile and insert the setting in this file and
restart you machine. The PATH will then be set permanently.

I am seeing the light ...

 
Nitin Kalra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your information
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.go to your login home directory.
->cd ~
2.use editor for example vi to edit the bash user profile.
->vi .bash_profile
3.add the jdk PATH and JAVA_HOME parameter
->PATH="/usr/jdk1.xx.x/bin":$PATH:$HOME/bin
JAVA_HOME="/usr/jdk1.xx.x"
EXPORT PATH JAVA_HOME
4.relogin the bash shell
5.test and verify the environment
->echo $JAVA_HOME
echo $PATH
enjoy!
 
Saloon Keeper
Posts: 25466
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note: Linux is CASE sensitive, so it's not EXPORT, it's export.
I prefer the following as being slightly easier to maintain:
JAVA_HOME=/usr/java/jdknnnn
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME
"jdknnnn" represents the name of the JDK directory you want to use. Whether you prepend or postpend the java path to the other paths is up to you. It's actually a bit better to say "$JAVA_HOME/bin:$PATH", since no older JDKs are going to sneak in ahead of you.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nitin Kalra:
Hi Java peoples,
I am new person for linux.
I install java1.4 in RedHat Linux8.0 and set the path in profile file of /etc directory of linux.
PATH=/usr/java/j2sdk1.4.0_01/bin:$PATH
JAVA_HOME=/usr/java/j2sdk1.4.0_01
export PATH JAVA_HOME ...
When I compile one java file it will gives the error
bash: javac: command not found
Please give the suggustion to configure the java in linux
Thanks in advance,


Be sure to log out completely and log back in before you try to run javac.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic