• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting up enviro parameters?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey all, i have a question (a simple one i hope )
so i have installed java (sdk 1.4.2) on my redhat (9) box. i used the rpm and it is unpackaged and everything into /usr/java (that's where the rmp put it) now i know i have to edit something, somewhere before java will work. i think it has something to do with /ect/profile.d but i have never changed/done this before and i'm not sure what file to change, where the file is, or what to add. any help would be greatly apreicated! thanks in advance - b
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Welcome to Java Ranch!
Generally, you shouldn't edit the systemwide /etc/profile file, unless you're administering a mchine for multiple users and want all of them to have your changes available to them. You can make the same kind of changes in .bashrc in your home directory (assuming your .bash_profile contains a line like
". ~/.bashrc", as is common.
All you need to do to run the JDK itself is to have the JDK binaries on your PATH; adding 2 lines like

and then logging out and back in will get you going.
If you want to, you can add these lines to the end of /etc/profile instead.
 
beff bell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to first thank you for your reply, and then bug you for more help if at all possible
so i executed those 2 comands:
[root@localhost root]# export JAVA_HOME=/usr/java/j2sdk.1.4.2
[root@localhost root]# PATH=$JAVA_HOME/bin:$PATH
making sure that the path to java was correct.
then i tried to run java:
[root@localhost WEB-INF]# java -jar Start_TestPilot.jar& **start_testPilot is the program that i am trying to run. i did not write it
and this is the responce i got:
[1] 2540
bash: java: command not found
so the questions would be, did i execute those 2 commands correctly? you mentioned something about logging out. do you mean that i have to log out of linux totally for those commands to work? is there a way i can test java myself (san the software) to eliminate an avenue of error and make sure that just java is running correctly. (a test program?) thank you again! i really appreciate the help - b
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


export JAVA_HOME=/usr/java/j2sdk.1.4.2


Computers in general are really picky about spelling and punctuation; the standard install dir doesn't have that period between 'k' and '1'. Otherwise, this should work.
The log out/log in stuff was to get changes to the .bashrc file to take effect; all that it does, effectively, is give you a new copy of bash that has read in and executed those files, and lets you make sure that your changes will persist between sessions. One you get the lines to work here at the prompt, you'll want to put them into .bashrc so you won't have to type them again.
 
beff bell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well that was a stupid mistake thanks for all of your help! java is up and running. i really appreciate all your time. thanks agian! - b
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic