Re: New to Linux

From: FISH (joeking_at_merseymail.com)
Date: 01/27/04


Date: 27 Jan 2004 02:59:30 -0800

Jhuola Hoptire <JH@nothere.com> wrote in message news:<YkmRb.80105$dP1.203357@newsc.telia.net>...
> hiwa wrote:
>
> > Jhuola Hoptire <JH@nothere.com> wrote in message news:<p3eRb.46425$mU6.175355@newsb.telia.net>...
[snipped...]
> > Install J2SE, not J2RE which is a runtime for exising Java
> > applications.
> >
> I'm going to install both. The jre should be
> redundant but I am experimenting with the different
> downloads and installation processes (rpm vs zipped tar).
> Right now, it's more about learning my way around Linux.

You should only need to install the SDK. The SDK is the JRE with
extra compiler/debug tools etc.

[snipped...]
> That's what I was looking for, thanks. In fact I had used
> /etc/profile for this. The comments in that script seem to
> imply it sets the system wide environment, which is probably
> best for my current purposes.
> > export JAVA_HOME=your-installed-directory
> > export PATH=$PATH:$JAVA_HOME/bin
> > export CLASSPATH=$CLASSPATH:.
> > # .(dot) is current directory
> >
> Why add the '.'? Unless there is some compelling reason
> (like the Linux installation requires it), IMHO, there is
> no other valid argument for users (probably as developers,
> in this case) expecting their "present working directory"
> (pwd) to be on the CLASSPATH.

If you don't put the PWD in your classpath, then you'll have to
explicitly set the classpath before running any non-Jar'd code.
This can become quite tedious.

You may, however, wish to defer this to a user's .profile (or
similar) script, so it can be tailored to suit individual taste
(although I think you'll find that almost all Java coders will
add it, because it makes like that bit easier.)

> At best it could cause confusion, especially for beginners
> who quite often put all their source code in one folder
> (their pwd) and don't always make proper use of
> "package"ing.

On the contrary, beginners are often confused by the inability to
type "java MyClass" and have it run, when they see MyClass.class
in the current directory. Or indeed "java mypackage.MyClass"
when they see a file ./mypackage/MyClass.class off of their
current directory.

[snipped...]
> An example of the conventions for "correct" usage of Linux
> directories; after I installed java, I read that /usr/ is
> only supposed to be for apps added during the Linux
> installation. However, Sun have decided to stick
> the java installation there too.

Probably because originally it wasn't installed as standard with
the OS - so historically this is where it has always lived (?)

-FISH- ><>



Relevant Pages

  • Re: [opensuse] Editting PATH variable
    ... The first thing is that Java is a bit special about it handles these ... The jre that I installed was indeed installed through YaST from an rpm package: ... Firstly with the SuSE Java installation I would have expected a symbolic ...
    (SuSE)
  • Re: cant find a class...
    ... classpath is where Java looks for classes. ... Call this script as you would call the java compiler (with the ... The system API is silently included in the classpath by the JRE/SDK. ... (assuming noone moved it after installation), adds it to the classpath, ...
    (comp.lang.java.help)
  • Re: Sun JRE 1.5.0_09 update always fails
    ... Is there any version of Sun's java showing in Add/Remove Programs? ... Download the Windows Offline installation package and SAVE it, ... there may be a newer version of the JRE when it comes back up with no explanation as to why. ...
    (microsoft.public.windowsupdate)
  • Re: [opensuse] Editting PATH variable
    ... The first thing is that Java is a bit special about it handles these ... The jre that I installed was indeed installed through YaST from an rpm package: ... Firstly with the SuSE Java installation I would have expected a symbolic ...
    (SuSE)
  • Re: Tuesday 3rd April update wont work
    ... Uninstall the IBM java package from Add/Remove Programs. ... One must uncheck it in order to prevent it's installation. ... Wuweb is for Windows Update, ...
    (microsoft.public.windowsupdate)