By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

New to Linux

P: n/a
Just installed J2RE 1.4.2 on a Linux server. I am very
knew to the POSIX world.

I couldn't dig-up much in the docs or via google about
the following:

1 - Is there a standard way to make sure users (all, or
some) can "reach" java? eg one could presumably create
a java.sh or aliases ... Where is the standard Linux
directory to put such a script (and why)?
In Win32 this is not an issue as a copy of java.exe is put
in a system folder and that folder is in everybody's path
(via the global system path) - not an elegant solution,
but it works.
2 - When developing, where should the project resources,
(ie java source code, design docs etc...) go on Linux
machines? This is not really a java specific question
(ie NOT about how to arrange source code in package
structure etc... which IMHO is the right way to do it),
but more about how to use the Linux file systems,
directory structure and file organisation for single
user and/or shared development projects.

3 - Does anyone have links for any resources aimed at
experienced java folk who are new to developing/running
java on Linux and Unix (coming from Win32 or other)?

4 - What's the best way to download the latest Linux
java distros from Sun if there is no GUI running (and
no browser) on your plain Linux server? Sun has stopped
offering ftp downloads.

BTW, does anybody have any experience of, or know how
the 1.4.2 VM performs on identical Win32 vs Linux PCs?

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jhuola Hoptire <JH@nothere.com> wrote in message news:<p3********************@newsb.telia.net>...
Just installed J2RE 1.4.2 on a Linux server. I am very
knew to the POSIX world. Install J2SE, not J2RE which is a runtime for exising Java
applications.

I couldn't dig-up much in the docs or via google about
the following:

1 - Is there a standard way to make sure users (all, or
some) can "reach" java? eg one could presumably create
a java.sh or aliases ... Where is the standard Linux
directory to put such a script (and why)?
In Win32 this is not an issue as a copy of java.exe is put
in a system folder and that folder is in everybody's path
(via the global system path) - not an elegant solution,
but it works. Put java.sh on any directory. Then do cd to the directory and
run command:

../java.sh

After the install is finished, set PATH and CLASSPATH in the
..bash_profile file appropriately:

export JAVA_HOME=your-installed-directory
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:.
# .(dot) is current directory


2 - When developing, where should the project resources,
(ie java source code, design docs etc...) go on Linux
machines? This is not really a java specific question
(ie NOT about how to arrange source code in package
structure etc... which IMHO is the right way to do it),
but more about how to use the Linux file systems,
directory structure and file organisation for single
user and/or shared development projects. You decide them all. For example, make learning_java directory
under your $HOME and do everything in it.

3 - Does anyone have links for any resources aimed at
experienced java folk who are new to developing/running
java on Linux and Unix (coming from Win32 or other)? No difference Java per se betw Win and Lin. For the system
environment, amass your own experience. There are many good
docs and books for Linux out there.

4 - What's the best way to download the latest Linux
java distros from Sun if there is no GUI running (and
no browser) on your plain Linux server? Sun has stopped
offering ftp downloads. Use GNU wget command, or w3m program. There are many such programs
on Linux. Do

wget --help
or,
man wget

BTW, does anybody have any experience of, or know how
the 1.4.2 VM performs on identical Win32 vs Linux PCs?

Linux is faster and stable, less problematic as a server environment
than Windows. Java GUI implementaion is slightly
better on Windows than on Linux.
Jul 17 '05 #2

P: n/a
hiwa wrote:
Jhuola Hoptire <JH@nothere.com> wrote in message news:<p3********************@newsb.telia.net>...
Just installed J2RE 1.4.2 on a Linux server. I am very
knew to the POSIX world.
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.
I couldn't dig-up much in the docs or via google about
the following:

1 - Is there a standard way to make sure users (all, or
some) can "reach" java? eg one could presumably create
a java.sh or aliases ... Where is the standard Linux
directory to put such a script (and why)?
In Win32 this is not an issue as a copy of java.exe is put
in a system folder and that folder is in everybody's path
(via the global system path) - not an elegant solution,
but it works.
Put java.sh on any directory. Then do cd to the directory and
run command:

./java.sh

After the install is finished, set PATH and CLASSPATH in the
.bash_profile file appropriately:

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.
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.

2 - When developing, where should the project resources,
(ie java source code, design docs etc...) go on Linux
machines? This is not really a java specific question
(ie NOT about how to arrange source code in package
structure etc... which IMHO is the right way to do it),
but more about how to use the Linux file systems,
directory structure and file organisation for single
user and/or shared development projects.
You decide them all. For example, make learning_java directory
under your $HOME and do everything in it.

Yes, you are absolutely right that java shouldn't mind.
I was looking more for some advice on how the Linux
directories are *conventionally* used, especially in
this type of context.
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.
I was wondering how development files should be organised
relative to Linux core directories to be in the spirit of
"the Linux way".
3 - Does anyone have links for any resources aimed at
experienced java folk who are new to developing/running
java on Linux and Unix (coming from Win32 or other)?
No difference Java per se betw Win and Lin. For the system
environment, amass your own experience. There are many good
docs and books for Linux out there.

Yes, I agree the java should be close to identical. I was
thinking in terms of quirks (or advantages) with the
Linux JVM in terms of performance, synchronisation, memory,
cpu, I/O usage etc ...
4 - What's the best way to download the latest Linux
java distros from Sun if there is no GUI running (and
no browser) on your plain Linux server? Sun has stopped
offering ftp downloads.


Use GNU wget command, or w3m program. There are many such programs
on Linux. Do

wget --help
or,
man wget

Have you tried this lately? I looked at lynx, but the problem is
that I couldn't navigate to the right download link.
Cutting and pasting the url at the final step from a graphical
web browser, for example, and using it with wget probably won't
work either due to inconsistencies in session data (I'll try when
I can access my terminal).
Sun seem to be determined to force users through their new, fixed
steps (probably for legal and security reasons), but this makes it
somewhat inconvenient for command-line only users.
Or, am I missing something? I hope so, because I'd like there to
be a satisfactory, well defined way to achieve this.
BTW, does anybody have any experience of, or know how
the 1.4.2 VM performs on identical Win32 vs Linux PCs?


Linux is faster and stable, less problematic as a server environment
than Windows. Java GUI implementaion is slightly
better on Windows than on Linux.

I'm looking forward to finding out.
Jul 17 '05 #3

P: n/a
Jhuola Hoptire <JH@nothere.com> wrote in message news:<Yk********************@newsc.telia.net>...
hiwa wrote:
Jhuola Hoptire <JH@nothere.com> wrote in message news:<p3********************@newsb.telia.net>...
Just installed J2RE 1.4.2 on a Linux server. I am very
knew to the POSIX world.
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.
I couldn't dig-up much in the docs or via google about
the following:

1 - Is there a standard way to make sure users (all, or
some) can "reach" java? eg one could presumably create
a java.sh or aliases ... Where is the standard Linux
directory to put such a script (and why)?
In Win32 this is not an issue as a copy of java.exe is put
in a system folder and that folder is in everybody's path
(via the global system path) - not an elegant solution,
but it works.


Put java.sh on any directory. Then do cd to the directory and
run command:

./java.sh

After the install is finished, set PATH and CLASSPATH in the
.bash_profile file appropriately:

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

'.' is convenient for quick and dirty work. :)
(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.
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.

2 - When developing, where should the project resources,
(ie java source code, design docs etc...) go on Linux
machines? This is not really a java specific question
(ie NOT about how to arrange source code in package
structure etc... which IMHO is the right way to do it),
but more about how to use the Linux file systems,
directory structure and file organisation for single
user and/or shared development projects.
You decide them all. For example, make learning_java directory
under your $HOME and do everything in it.

Yes, you are absolutely right that java shouldn't mind.
I was looking more for some advice on how the Linux
directories are *conventionally* used, especially in
this type of context.
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.

Never mind. You don't have to care.
I was wondering how development files should be organised
relative to Linux core directories to be in the spirit of
"the Linux way". /usr/local and/or server spcific dir might be the nearest to
"the Linux way".
3 - Does anyone have links for any resources aimed at
experienced java folk who are new to developing/running
java on Linux and Unix (coming from Win32 or other)?


No difference Java per se betw Win and Lin. For the system
environment, amass your own experience. There are many good
docs and books for Linux out there.

Yes, I agree the java should be close to identical. I was
thinking in terms of quirks (or advantages) with the

There are a few but all of them should be minor.
Linux JVM in terms of performance, synchronisation, memory,
cpu, I/O usage etc ...
4 - What's the best way to download the latest Linux
java distros from Sun if there is no GUI running (and
no browser) on your plain Linux server? Sun has stopped
offering ftp downloads.
Use GNU wget command, or w3m program. There are many such programs
on Linux. Do

wget --help
or,
man wget

Have you tried this lately? I looked at lynx, but the problem is
that I couldn't navigate to the right download link.
Cutting and pasting the url at the final step from a graphical
web browser, for example, and using it with wget probably won't
work either due to inconsistencies in session data (I'll try when
I can access my terminal).
Sun seem to be determined to force users through their new, fixed
steps (probably for legal and security reasons), but this makes it

Sorry. I had forgotten the legal page. Use someone's desktop machine
:) --- You could write an original HTTP program though.
somewhat inconvenient for command-line only users.
Or, am I missing something? I hope so, because I'd like there to
be a satisfactory, well defined way to achieve this.
BTW, does anybody have any experience of, or know how
the 1.4.2 VM performs on identical Win32 vs Linux PCs?


Linux is faster and stable, less problematic as a server environment
than Windows. Java GUI implementaion is slightly
better on Windows than on Linux.

I'm looking forward to finding out.

Jul 17 '05 #4

P: n/a
Jhuola Hoptire <JH@nothere.com> wrote in message news:<Yk********************@newsc.telia.net>...
hiwa wrote:
Jhuola Hoptire <JH@nothere.com> wrote in message news:<p3********************@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- ><>
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.