• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linux installation help

 
R Harvey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people!
I'm going to start doing lots of Java on my Linux machine! I've downloaded the linux JDK, JRE and J2EE, and installed them fine on my system, but there's still a couple of issues:
1) I can't execute the programs directly, ie. to run 'javac' i have to type './javac' instead of plain old 'javac'. Is there some way of rectifying this?
2) I don't know which system file to declare my java vars in (ie. JAVA_HOME etc..) (I'm on Redhat 7.1)
Maybe (1) will be sorted as soon as we rectify (2) - i just don't know...
One last thing, i installed all of the above packages as root, is this a good idea, or should i create a new user for all of the Java things to run under?
Thanks for your help
Robin
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Linux Forum.
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I'm not sure. I can just type java or javac by default.
2. put them in /etc/profile
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on redhat 7.1 you can put your java variables in ~/.bash_profile
you need to add . to your classpath so you can execute programs in the current working directory. so, your classpath in the ~/.bash_profile file should have something like this:
CLASSPATH=$CLASSPATH:.:/path/to/java/programs:
[ January 16, 2003: Message edited by: Greg Harris ]
 
Ravee Bhat
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
let your PATH variable in /etc/profile point to bin directory of your jdk installation. say /usr/local/jdk/bin.
setting CLASSPATH will solve your class file lookup problem.
for the last thing. Even I am not sure about how good the idea is to set it as root. can anyone throw some light on this part?
 
R Harvey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks people, i'm going to try this over the weekend, let's hope i dont wreck my machine in the process!
Have a good one....
Robin
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
From ~/.bash_profile:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic