473,416 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

New to Linux

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
4 2791
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric Raymond | last post by:
When installing the rpms (or the tar file) onto Red Hat Enteprise Linux AS Beta 1 (Taroon), we get the follwing error: Installing all prepared tables /usr/bin/mysql_install_db: line 1: 7690...
6
by: gnu | last post by:
Rationale to use Linux ======================= - I can't afford paying for $199 for the license of an OS that's arguably better thank Linux for each of 10 computers I have. - I want to be...
21
by: Travis 'Bailo' Bickel | last post by:
Lately, I have been having a bear of a time trying to acquire a Linux driver for my S3/ProSavage chipset -- but that quest is now almost at an end as I have located a noble band of people who are...
1
by: srihari | last post by:
Hai, I am trying to install IBM DB2 8.1 on Red Hat linux 8.0. My machine is Intel XEON 64bit. The installation went well except for the creation of tools catalog. When I tried to install the tools...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
5
by: cranium.2003 | last post by:
hi, Here is my code #include <iostream.h> int main() { cout <<"HI"; return 0; } and using following command to compile a C++ program g++ ex1.cpp -o ex1
1
by: rada.lambretha | last post by:
Configuring Linux as a Firewall * Making installation choices * Introducing iptables * Using iptables commands * Simplifying things with firewall GUIs * Adding proxy functionality As...
1
Nepomuk
by: Nepomuk | last post by:
You might have heard about Linux, but you don't know what it is? Or you know a few things about it, but they terrify you? Well, then this article is for you. Don't be afraid - Everyone can use Linux!...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.