• 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

Linux installation help

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Linux Forum.
 
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27752
196
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

Originally posted by Tim Holloway:
From ~/.bash_profile:

 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic