Jump to content

Globally Configure Java


Recommended Posts

I have java installed, but I dont have it configure. I would like to configure it globally for all applications. In the past,that has involved setting some $PATH in .rcbash or .profile. Recently I saw something on the internet about java.sh. Its confusing. Is there some quick and easy way to do this?

 

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

No need to change $PATH. Just make a symbolic link to the java executable in /usr/bin (which is already in $PATH). As the root user, execute the following command in a terminal:

 

ln -s /usr/java/jre1.5.0_04/bin/java /usr/bin/java

 

Note that the jre1.5.0_04 in the command above may be different for you - the latest version is 06, I believe. Use the correct directory reference based on your install.

Link to comment
Share on other sites

Firefox uses a plugin ( namely libjavaplugin.oji.so ) and not a java binary. But you are right - the above method isn't 'global", some things like Java web start won't work, unless of course you softlink all java binaries to a system path, which does not make much sense.

The best method is indeed setting the java binaries path, either to say ~.bash_profile (for single user system), or for global application to some other startup script ( /etc/rc.sysinit or /etc/rc.local or...).

Link to comment
Share on other sites

single user mode would be good, actually that is the method to which I was referring. I remember the file .profile was one to edit. These days I cant find .profile or .bashrc. Even if I could, the way to set the path is probably diferent too. If there is a way to set it for single user I would be interested in knowing.

Link to comment
Share on other sites

Not sure why you have no ~/.bash_profile or ~/.bashrc, but I don't know of any reason you couldn't create them. On my much-modified 10.1 box my ~/.bash_profile is like this:

 

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
       . ~/.bashrc
fi

export BASH_ENV=$HOME/.bashrc

...which as you can see aims to ~/.bashrc, which looks like this:

 

# .bashrc

PATH=/bin:/usr/bin:/usr/X11R6/bin:/usr/ucb:/usr/games:/usr/local/bin:

# Source global definitions
if [ -r /etc/bashrc ]; then
       . /etc/bashrc
fi

export NNTPSERVER=news-server.kc.rr.com

Does that help you out a little?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...