Clueless re Java: /opt vs. /usr/local

Login or Register to Reply

Thread Tools Search this Thread
# 1  
Clueless re Java: /opt vs. /usr/local

It seems this is a oft debated item, that's over my head.

So here's what I've got:
Java 7 set up at /opt/ but I really want it at /usr/local...

What have I done?

Have: Debian 7 (whezzy) with gnome, so what do I do to set things back where it should be?

I guess this is a hot topic according to these two who made some good points....I'm having issue getting Hadoop happy bc I followed the /opt path for Java and I think /usr/local is what it's looking for...

---------- Post updated at 02:59 PM ---------- Previous update was at 12:04 PM ----------

Think I got it, just needed to set the PATH

Can now run jpsSmilie
# 2  
The debate about "/opt" versus "/usr/local" boils down to the following:

In Unix the layout of the filesystem is more or less fixed. Every file, executable or not, should have its designated place where it has to go. This only as an afore.

The Linux initiative came up with an attempt to further codify this already long-used "best practice" and published the "Filesystem Hierarchy Standard".

I won't comment on the other parts of the document, just the part dealing with "/usr/local" and "/opt":

"/opt" is where all application should go. For every application there should be a subdirectory with its name (and optionally manufacturer) and in that a directory with its version. The "foo" application of the "bar" company in version 1.23 would go to "/opt/bar/foo/1.23", for instance. The executables for this software should be in "/opt/bar/foo/1.23/bin" with optional links to "/opt/bin" to avoid a convoluted PATH.

"/usr/local" is the place for all the OS extensions the administrator wants to have at this particular system. As "/usr" (short for "Unix Software Resources") is under the sole discretion of the OS provider this is the only place that should be modifyable by the SysAdmin. Still, this should be limited to OS-relevant utilities, not for applications in their own right. You might place a third-party "ssh"-client there or "gzip", but not, for instance, "MySQL".

Having said that: if you put java into "/usr/local" or into "/opt" is a question of if you see it as an application in its own right or merely a system tool. There is no "correct" answer to that, just your sensible decision about what best describes its usage on your system.

I hope this helps.

# 3  
A word of caution regarding the FHS. It is quite an old document. Many distributions, led by Fedora, are moving away from this standard as far as /usr/bin, /bin, /usr/sbin, /sbin and other OS-specifc directories are concerned.

However the intended purpose for /usr/local and /opt has not changed over the years.
# 4  
As an addition to Buknin's post /opt is considered as "static" (vs dynamic ) and so any data variable or dynamic files for the application's configuration etc should be played in /var/opt/<app-name>, it has its importance if you have limited time frame for e.g. backups, you know that what is important to you on a daily basis check is in /var/opt for all your applications which should be save with your data...
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-la
Have no idea on what the below error message is: Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-launcher.jar -buildfile build.xml dist. Any help?... Red Hat
Red Hat
FreeBSD: /usr/bin/ld not looking in /usr/local/lib
I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The script seems to exit without too much trouble: $ ./ checking...... BSD
/usr/local/bin/cvs: Not found
I can able to access /usr/local/bin/cvs in the terminal (AIX 6.1 Box). but i am getting the "/usr/local/bin/cvs: Not found " when i call it from the script. please some one assist me what maybe problem... AIX
Difference between /opt and /usr/local.
rama krishna
Hello Gurus, Can any one explain me the difference between /opt and /usr/local. When should we use them. Can we link with any directory in windows I mean similarity between unix and windows.... UNIX for Dummies Questions & Answers
UNIX for Dummies Questions & Answers
/usr/bin/ld: warning:, needed by /opt/openmpi/lib/, may
hello, i get these warnings on make(ing) /usr/bin/ld: warning:, needed by /opt/openmpi/lib/, may conflict with /usr/bin/ld: warning:, needed by /usr/lib/gcc/x86_64-redhat-linux6E/4.3.2/../../../liblapack.a, may conflict with...... Programming