• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

linux gurus

khlee

Senior member
i installed java SDK and whenever i want to use the java executables such as java, javac i have to type in the whole directory /blah/j2k../bin/java

how do i configure it so that I dont have to type in the whole directory? do i have to install to usr/local?

also sometimes when i try to delete a directory or something it says permission denied and i have to login as root. this is a pain in the ass.. is there any way i can get around this?

TIA
 
You can add the directory containing the java binary to your $PATH variable:

export PATH=/blah/j2k../bin:$PATH

you can make an alias:

alias java=/blah/j2k../bin/java

you can make a link:

ln -s /blah/j2k../bin/java /usr/local/bin/java

I would say adding the directory to your path would be the preferred way. Do this in your shell init files (probably ~/.bash_profile)
 
<<Do this in your shell init files (probably ~/.bash_profile) >>

umm could you explain that in layman terms. i am new to most of this.
 
Originally posted by: khlee
<<Do this in your shell init files (probably ~/.bash_profile) >>

umm could you explain that in layman terms. i am new to most of this.

Open your ~/.bash_profile in a text editor. Look for the PATH variable. If it is there you will have to modify it, if it is not there you will have to add it.

If it is there it should look something like:
PATH=/bin:/usr/bin:/usr/local/bin
Add :/path/to/java at the end (PATH=/bin:/usr/bin:/usr/local/bin:/path/to/java).

If it is not there, I typically go with a PATH looking something like:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/path/to/java
export PATH


The export is very important. If you want to modify it runtime, use something like:
PATH="$PATH:/path/to/java" && export PATH

As far as permissions go, you shouldn't modify them. But you can look at installing and setting up sudo to help make things easier.

HTH
 
To add to n0c's post, when I add something to the PATH in my own profile file, I usually set it as follows to make sure I don't forget to add something that's already been set systemwide:
PATH=$PATH:/path/to/something
export PATH

That will just add whatever to the end of the PATH you already have.
 
Originally posted by: Sunner
To add to n0c's post, when I add something to the PATH in my own profile file, I usually set it as follows to make sure I don't forget to add something that's already been set systemwide:
PATH=$PATH:/path/to/something
export PATH

That will just add whatever to the end of the PATH you already have.

That's probably better than what I posted.
 
Back
Top