• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set java env in linux???

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using RedHat linux 8.0, i installed j2sdk follow the install instruction, how to set the environment so that i can compile/run java code/application in any directory???
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Linux/UNIX forum.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add $JAVA_HOME/bin to your PATH?
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make it available to all non-root users:

-Add /etc/sysconfig/java

It looks like:



-Add /etc/profile/java.sh

It looks like:



The root user still has to fend for him/her self.

Regards, Guy
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is /etc/sysconfig/java a file or a directory?

there is only /etc/profile.d directory, should i create java.sh inside it or create both profile directory and java.sh???
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/etc/sysconfig/java

is a file. Add it with the correct exports.

The rest should have said:

/etc/profile.d/java.sh

not /etc/profile/java.sh, sorry.

Guy
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also want to visit this site:

Java for Linux HOWTO

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much, but i still have a question: how to set the env so that applet and web-start work well?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18281
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets are run under control of your web browser. In order for your browser to run applets, it must have a java applet plugin installed, musch as it must have a Shockwave plugin installed to play Shockwave. The browser's preferences are stored with the other browser settings, usually in a hidden file or directory in the user's home directory.

There's also often a set of system-wide default settings, which in *n*x is generally in the /etc directory. These, too, are installed by the browser, though in some cases there may be an agreement among vendors for a common settings repository.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic