IgniTech Logo

IgniTech Logo
Vinoth

Monday, March 23, 2009

What is a WiFi Network-How to Setup

An Introduction to the Wi-Fi (Wireless Fidelity)

Here you will learn how to setup wifi network, how wireless fidelity works, hotspot security, vpn servers. Wi-Fi or wireless fidelity is meant for to be used when referring any type of 802.11 network, whether 802.11, 802.11a and dual band. Any products tested and approved as Wi-Fi certified by the Wi-Fi alliance are interoperable with each other.  

Typically, any Wi-Fi product using the same radio frequency will work with each other even if not Wi-Fi certified. Formerly the term Wi-Fi was used only in the place of the 2.4 GHz 802.11b standard in the same way Ethernet was used. 
Wi-fi short for wireless fidelity refers to a set of wireless networking technologies and more specifically referred to as any type of 802.11 network, 802.11b and 802.11a and dual band. The word Wi-Fi was built by an organization named as Wi-Fi alliance. A product that undergoes the Wi-Fi alliance analyses is given the name Wi-Fi certified.
Wi-Fi rapidly gained the fame in the United States with the access point. These devices tested by the “Wi-Fi alliance” are used around the world and allow users to have Wi-Fi capable device like a PDA or Laptop to connect anywhere there is availability of Wi-Fi access point. There are currently three standards that are used to signify the speed of the connection. Both the 802.11a and 802.11b are the capable of 54 Mbps with 802.11a additional features. The most common standard is 802.11b/second because it can transmit the data at 11 Mbps.  


All these Wi-Fi connections are fast enough to allow the broadband internet connection. Wireless Fidelity is a fastest growing wireless technology that will probably be as common as phone lines and electric devices. Wi-Fi adds great levels of convenience and high level of production.

Wireless fidelity is planned to be used with the wireless devices but it is most commonly used for internet access. With Wi-Fi you can connect computers in your home, office or anywhere without the need of wires. The computers can just connect to the network that uses radio waves. 

How does W-Fi work?

Wi-Fi is the wireless technology to handle the networking/communication. Wi-Fi allocates internet connection globally and to be transmitted by the radio waves. Radio waves are the main cause of Wi-Fi. Radio waves are transmitted from antenna and Wi-Fi receivers pick them up. When a user receives the Wi-Fi signals, a wireless internet connection is produced and a user is prompted to provide the user name and password if required to establish a wireless connection.

What is Wi-Fi Security?

Wi-Fi maintains certain security issues. WEP or Wired Equivalent Privacy is used in the physical and data link layers. It was planned to provide the wireless security by protecting the data, while it transmits from one point to another. Wi-Fi networking usually maintained inside a building premises. The data transmission in the Wi-Fi is protected by Wireless LANs but due to the fact that data travels over the radio waves so there are chance that data can be exposed and capture. 

How to secure your WiFi network?

When you buy a wireless router you might find an Installation CD by vendor that CD with guide you through a wizard on setting up router. Here are some suggestions that how can you setup security on the router without using the application software.
1. Open a new browser.
2. You may now type IP address of the router in your browser. The step here is where you can get the management system of the router. Due to different vendors, you need to lookup on your router’s manual for the IP address usually it may be 10.10.10.01, 196.168.1.1 or 192.168.0.1, 100.100.100.1 or something similar to those matches and the default password of the router. Every router management console is different from each other. Try exploring around and find the appropriate section to manage. 
3. You should never forget this step to setup an administrative password. The step to set here is often not located in Security section; you will need to take a look at the utilities, user management or system settings. Find it and change the password immediately for any user account. 
4. Enable Wireless security. To turn on your encryption look under the wireless security tab. The step over here will need you to either use WPA or WPA-PSK and this will only appropriate if the devices on your network supported it. Otherwise you will need 128-bit WEP. For WPA or WPA-PSK, you would have to type pass phrase/password into a piece of paper and transfer to thumb drive so that you can set the password in the client’s machines. 
5. Change your SSID. You should not make your SSID this will be probably a default SSID, normally those who do not configure their SSID will have their router name such as “linksys”, “belkin”, “dlink” etc. Try changing it with someone menacing, which will be threat for them to connect. Like virus geek, virus spreader. Remember that you will need this SSID when you browse through the network from your client machines. You can find these settings in the section of Channel or SSID.
6. Save your configurations and settings by pressing the save changes or save settings button. You will need to save every change that you will make to the router in order to it can take effect and probably you will have to reboot your router multiple times. 
Congratulations, finally you have covered the basic settings for your Wi-Fi network

Wi-Fi Hotspot Security: Using VPNs

There are numerous security issues regarding the use of the public wireless networks but all of which can be overcome. One of the solutions for users, as brought up in Wi-Fi Hotspot security, is to use the VPN (Virtual Private Network) to secure the real time traffic of the Wi-Fi hot spot users. Many small to large businesses provide their employees with the VPN access. 

Although this access is typically put in place for employees to have the remote access to the corporate network in order to access the files and documents remotely. If you don’t have access to any VPN servers, create your own. By doing this you can remotely access the files from your office as well as other devices such as Wi-Fi video camera to keep an eye on the things while away.

When using the software-based VPN server features in Windows XP Pro, the PC running the server has to be powered-on to access the home network from the Wi-Fi hotspot. VPN routers can cost as low as $70 to $130 and the popular models are Linksys, WRV200 and WRV5G

Networking HOW-TO

In this section you will learn about computer network how to, troubleshooting tips, configurations, IT help, basic configurations help, wireless access point, hardware components and cables. Data commmunication is an important thing to share the data and resources and if you want to share the one internet connection with the other PCs, share your server's hard drive with the client computers, share printer, fax, scanner, DVD writer then this information will help you make the right choice. Before starting the installation and configurations you should be aware of all the hardware, software, cables, drivers and all the necessary other things.

Basic Introduction

STEP 1: Router: A router relays the data between your computers and your internet connection. 

• STEP 2: Network Adapter: A Network Adapter or NIC card is connected to each computer and it is used to send the data to each every computer and the router. 

STEP 3: IP Address (Internet Protocol) is your computer’s unique identification on the computer network and over the internet. In your home network and a small network of a company all the computers share the same IP address over the internet.

  
• STEP 4: Print Server A print server is a specialized network adapter that is used to connect the printer machine to a network and with the print server several computers in a network share the same printer or print device.

How to Choose a Right Network Type

• STEP 1: Connecting your computer wirelessly over the radio waves is carried out by a specialized router called an access point. One access point is enough for networking an averaged sized home. The trade name of this technology is Wi-Fi or 802.11b. One important thing is that all the Wi-Fi products should be compatible with each other. Wireless communication is important for the people who go from room to room with their wireless laptops or they want to use their laptops in airports, hotels, cafes and other places where wireless service is available.  


• STEP 2: Next you use your home’s wiring to connect the router to each computer with a powerline network. HomePlug is the trade name of this technology. It is seen that HomePlug networks are more secure than the Wi-Fi. But as compared to the Wi-Fi it is a new technology and is more expensive than Wi-Fi technology.

• STEP 3: Hook up with the Ethernet 10-Base-T or 100-Base-7. Ethernet is the best choice if your router, broadband internet connection and all the computers all in one room. Due to the cabling, involved in the Ethernet, it’s less flexible than the others. 

Buying Equipment Instructions 

• STEP 1: First of all get one router and if you want to go wireless this router will called an access point. 

• STEP 2: Next get compatible NIC cards for each computer and plug them into the computer’s universal serial bus (USB 

• STEP 3: If you are using a wired network the purchased extra long CAT 5 Ethernet cables.

• STEP 4: Next buy a print server if you want to put a printer in your home.

One important thing to note is that all the hardware should be compatible with each other.


Setup Instructions 

STEP 1: First of all read the manuals of the devices and start experimenting. Many products have good manuals and online support. You can easily get answers of the basic and advance questions. Many manufacturers provide online help and advice so there is no need to worry about any kind of technical support. Good technical support can save your lot of time and efforts. So before starting make a thorough plan to work on it. 

STEP 2: If you are planning to install a wired Ethernet, then run the cables to your home theaters or stereo. Now many new digital home products like digital video recorders and game systems are having the internet capability.

General Tips

In summary you should look for these things for installing a home network such as Router or access point, Ethernet cables, NIC adapter, Print Server and the technical support from the vendor or a useful website or forum on the internet. Hybrid networks have many advantages and so they are very popular. For example, you can have Ethernet going to a desktop computer and printer in your home office and additionally wireless router or access point for a roaming laptop and desktop computer in your bedroom.

Some cordless phones and the microwave ovens can interfere with a wireless communication. If you have any interference problems then move the access point and router and place them at some different positions. 

It is very important that when you setup your router for the first time at your home, change its password because every hacker on the internet can know the default password of a router. Additionally, while making the wireless connectivity you must enalbe the WEP to keep the information private and secure from the hackers.

Additionally, install some anti spyware, good anti virus software on your server and client machines in your computer network and regulary update Windows operating sytem through the Microsoft's website.

How to Configure a Network

In this section you will learn how to configure a network, peer to peer, client server, workstation, server, basic data communication.

Peer to Peer network model

Before configuring a computer network, you have to decide that, which networking model you require. There are two main types of network models. Peer to peer and client-server network model. In the peer to peer network model you simply use the same Workgroup for all the computers and a unique name for each computer. 

Additionally, you will have to give a unique IP address of the same class A, B, or C for all the computers in your network and its related subnet mask e.g if you decide to use class A IP address for your three computers in your Peer to Peer network then your IP address/Subnet mask settings can be as follows.

Computer Name IP Address Subnet Mask Workgroup

PC1 100.100.100.1 255.0.0.0 Officenetwork
PC2 100.100.100.2 255.0.0.0 Officenetwork

PC3 100.100.100.3 255.0.0.0 Officenetwork

Please note that the above example is for only illustration purpose so you can choose any IP address, computer name and workgroup name of your interest. 

For doing this right click on My Computer and then click Properties then go to the Network Identification section and set these. 

In a peer to peer network all computers acts as a client because there is not centralized server. Peer to peer network is used where not security is required in the network.  


If a computer fails to work then all other computers work normally in peer to peer network.

Client/Server Network Model

In the client/server network model a computer plays a centralized role and is known as a server all other computers in the network are known as clients. All client computers access the server simultaneously for files, database, docs, spreadsheets, web pages and resources like hard diver, printer, fax modem, CD/DVD ROM and others. In other words, all the client computes depends on the server and if server fails to respond or crash then networking/communication between the server and the client computes stops.

If you want to configure a client-server network model then first prepare the server. Install Windows 2000 or Windows 2003 Server from the CD on the server computer and make a domain. You can create a domain by this command on the Run “DCPROMO”. You can give this command once you install the server successfully. After you give the DCPROMO command you will be asked for a unique domain name. All the client computers will use the same unique domain name for becoming the part of this domain. This command will install the active directory on the server, DNS and other required things. A step by step wizard will run and will guide you for the rest of the steps. Make sure that a network cable is plugged in the LAN card of the server when you run the DCPROMO.exe command.

When the Active directory is properly installed on the server, restart the server. You can create network users on the server computer and also name/label the network resources like computers/printers etc.

Once you install the server successfully now come to the client computers. Install Windows 2000 professional on your all client computers. Once you install the Windows 2000 professional on the clients the next step is to make this computer (client computer) a part of the network.

Configuration Steps

1. Choose a unique name for each client computer
2. Choose unique IP address for each computer and relevant.
3. Use the same domain name for all client PCs.

Network/System administrators are required to do these administrative tasks on the server and client computers. Any shared resources on the network either on the server or the clients can be access through the My Network Places in the Windows 2000 platform. There is another way to connect to the shared resources by giving this command in the run \\ComputerName\SharedDriveLetter.

Network configurations steps can be implemented by right clicking the My Computer>Properties>

For giving the IP address you will have to right click on the My Network places>properties>Local Area Connection>Properties>Internet Protocols (TCP/IP)>Properties and then give the IP address and subnet mask of the same range and class for all the computers in the network.


  

Network Administrator Interview Questions

What is DNS?

Domain name system/server is used to translate the IP address into the hostname and hostname into the IP address. DNS is mostly used on the internet and the networks.

What is DHCP?

Dynamic host configuration protocol is used to dynamically assign the IP address to the networked computers and devices. DHCP is a network protocol that automatically assigns static and dynamic IP addresses from its own range.

What is a Router?

Router is the most important network device that is used to connect two logically and physically different networks. Router defines the short possible route for the data to reach its destination. A router works with built-in intelligent software known as routing table, which helps to determine the route between the two networks.

What is Gateway?

A gateway is software or a hardware that is used to connect the local area network with the internet. A gateway is a network entrance point and a router usually works as a gateway.

  
What is WLAN?

WLAN or Wireless local area network is simply a type of network that doesn’t use wired Ethernet connections for networking. WLAN uses wireless network devices such as wireless routers etc.

What is Subnet Mask?

A subnet mask is used to determine the number of networks and the number of host computers. Every class of the IP address uses the different range of the subnet mask. Subnet masks allow the IP based networks to be divided into the sub networks for performance and security purposes.  


What is a MAC Address?

MAC address or Media Access control is a unique identifier of a computer device. The MAC address is provided by the manufacturer of the device. MAC addresses are 12 digital hexadecimal numbers.

What is an IP Address?

An IP address is a unique identifier of a computer or network device on the local area network, WAN or on internet. Every host computer on the internet must have a unique IP address. IP addresses on the internet are usually assigned by the local ISPs to which users are connected.

What is Wifi?

Wi Fi or wireless fidelity is a base band network technology that is used for the wireless data communication.

What is WiMax?

Wi Fi is a next form of the Wi fi. Wi max is a very high speed broadband network technology that is designed for the corporate offices, roaming and home users. 

Name the Seven Layers of OSI Model

The seven layers of the OSI are Application, Presentation, Sessions, Transport, Network, Data Link and Physical layer.

What is LDAP?

Lightweight Directory Access Protocol is used to access the directory services from the Active directory in Windows operation systems.

What are the standard port numbers for SMTP, POP3, IMAP4, RPC, LDAP, and FTP?

SMTP – 25, POP3 – 110, IMAP4 – 143, RPC – 135, LDAP, FTP-21, HTTP-80

What is IPv6?

IP V6 is a next generation protocol that is used as an expansion of DNS.

What is UDP?

UDP or user datagram protocol is a connectionless protocol that is used to transfer the data without any error handling.

What is Firewall?

A firewall is usually a software program that is installed on the network server or gateway. The purpose of the firewall is to protect the network resources from the intruders and unauthorized persons.

What is Virtual Private Network (VPN) and how does it work?

VPN or virtual private network is used to connect two networks by means internet. VPN uses PPTP (point to point tunneling protocol) and other security procedures to make a secure tunnel on internet.

Define VOIP.

VOIP or voice over internet protocol is a technology that uses IP based networks such as internet or private networks to transmit the voice communication.

Define Bluetooth Technology.

Bluetooth is a short range wireless technology that uses radio waves for communication. Many mobile phones, laptops, MP3 players have built in features of the Bluetooth.

What is a RAS server?

RAS or remote access server allows you to remote dial in through the desktop computers, laptops and GSM mobile phones.

What’s a Frame Relay?

Frame relay is high speed data communication technology that operates at the physical and data link layers of the OSI model. Frame relay uses frames for data transmission in a network.

 

Thursday, March 19, 2009

Installing Java for Linux HOWTO

This tutorial explains how to uninstall and install the following on the Linux operating system:

  • Java 2 Platform, Standard Edition (J2SE), SDK 1.5.x
  • Java Web Start
  • Java Plug-in for most HTML browsers

If you are struggling with the installation instructions from Sun Microsystems, and your head is filled with more questions than answers concerning the finer points of Java installation on Linux, then this tutorial is for you.

Installing Java on Linux is almost easy, so don't worry that the tutorial is a bit thorough. The text covering the actual J2SE installation is just a few pages long, and you should be up and running Java in no time. Really! Most of the text is there just to keep you out of harms way if you get yourself into trouble.

Note: The tutorial has been tested successfully on the Red Hat Linux 7.2, 7.3, 8.0, and 9 operating system for SDK 1.4.0, SDK 1.4.1, SDK 1.4.2 and SDK 1.5.0.

The tutorial has also been found helpful for users of the Mandrake Linux 8.2 and 9.1 operating system.

Linux commands

If you find yourself stuck on those Linux commands, just take a look at The Linux Cookbook: Tips and Techniques for Everyday Use.

Warning: Do not be surprised if folder and file names, usually based on version numbers, have slightly different names on your installation than in the tutorial. New versions of Linux, J2SE and HTML browsers are released continuously, and I'm only human... Typos based on version numbers are the most reported typo error I get. Keep that in mind if something goes wrong with your installation.

Concept: Use the tab key to complete your typing when you are typing directory or file names, at least when you see the '*' character that the tutorial uses to replace version numbers. You should never copy and paste directly from the examples. The reason for this is that directory names may be different on your Linux version. /usr/java/j + tab may result in Linux writing /usr/java/j2sdk1.8.3/ or whatever.

About the Software

What is jdkgcj?

jdkgcj was created by Ark Linux: Easy Desktop Linux to make the gcj (gcj is a front end to gcc) commands more similar to the usual Java commands. An amazingly awful idea, considering that you don't even need jdkgcj in order to use gcj!! This software tend to create problems, so it is described here.

Why is Java not bundled with Red Hat Linux?

The JVM will not ever be included in Red Hat Linux because the JVM is not open source.
See: Bugzilla.

These days, it may seem strange that Red Hat does not come with Java already included. Actually, Red Hat Linux sort of comes with Java installed. It's called gcjand is part of the GNU Compiler Collection (GCC). gcj cunningly uses another program called jdkgcj in order to confuse everyone. gcj does not include a JVM and also lacks a few Java packages like AWT and Swing, so you basically still have a problem and you still need to install J2SE.

Why is J2SE with NetBeans IDE Cobundle installation not explained?

The tutorial does not describe installation of the NetBeans IDE Cobundle for a number of reasons:

  • Only developers needs NetBeans, and most users should avoid installing the cobundle.
  • J2SE and NetBeans are separate products. You may prefer to install a competing product like eclipse instead of NetBeans.
  • J2SE is installed in the NetBeans folder when installing the cobundle, and the J2SE installation is removed when uninstalling the cobundle.
  • It is much harder to reinstall J2SE or NetBeans independently if you first install the cobundle.
  • It makes the tutorial unnecessarily complicated if yet another installation should be described.

Uninstalling the Software

Before you start the installation, you should always find out if there are any programs that should be uninstalled first. Even if you think that your Linux box is clean, software like jdkgcj could play a trick on you.

jdkgcj uninstallation

Is jdkgcj installed?

To find out if jdkgcj is installed, open a terminal window and type:

[user]$ java -version 

If you read something similar to the following message, then jdkgcj has been installed on your computer, and you will no longer be able to compile and run Java programs normally. You should strongly consider removing it.

java version "1.3.1" jdkgcj 0.2.3 (http://www.arklinux.org/projects/jdkgcj) gcj (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

Uninstalling jdkgcj

Open a terminal window, log in as the super-user and type:

[root]# rpm -e jdkgcj 

The jdkgcj package should now be removed, and if J2SE is installed correctly, all Java commands should now work perfectly.

Java Plug-in uninstallation

Uninstalling Java Plug-in for Mozilla browsers

If you are going to reinstall J2SE, you don't need to uninstall Java Plug-in. Just use the -f option for ln when creating a new symbolic link. In the unlikely case that you want to completely remove Java from your Linux box, the procedure of removing the symbolic link is described below.

Open a terminal window, log in as the super-user and type:

[root]# rm /usr/lib/mozilla/plugins/libjavaplugin_oji.so rm: remove symbolic link `/usr/lib/mozilla/plugins/libjavaplugin_oji.so'? y 

J2SE uninstallation

RPM in self-extracting file uninstallation

Note: If you have RPM on your Linux box, you should first find out if Java is already installed using RPM. If Java is not installed using RPM, you should skip reading.

Opening a terminal window. Try to find the j2sdk package by typing:

[user]$ rpm -q j2sdk 

Optionally, show all RPM packages by typing:

[user]$ rpm -qa 

If RPM reports a package similar to j2sdk-*-fcs, or jdk-* then Java is installed with RPM.

Note: Normally, you do not need to uninstall J2SE with RPM, because RPM is able to uninstall the old J2SE when installing a new version! You may skip reading, unless you want to remove J2SE permanently.

Warning: If you want to uninstall the NetBeans IDE, it must be uninstalled before you uninstall J2SE, because the InstallShield Wizard uninstaller is a Java application!

In order to uninstall J2SE using RPM, open a terminal window, log in as the super-user and type:

[root]# rpm -e j2sdk-*-fcs 

Self-extracting file uninstallation

This part of the tutorial has not been updated for a while...

Find out if Java is installed in some folder. Common catalogues are /usr/java/j2sdk* or /opt/j2sdk_nb/j2sdk*/bin/java. When you have located the folder, you may remove the folder.

Warning: You should be certain that Java is not already installed using RPM before removing the folder!

java.sh file

You may delete the java.sh file in /etc/profile.d/ if you want to remove J2SE permanently.

Installing the Software

J2SE installation

If you need to compile Java source code, and most of us do sooner or later, you should install the SDK. Don't bother installing the JRE, because it's included in the SDK anyway.

Note: If you download JRE instead of SDK, you will only be able to run Java applets and applications. SDK contains JRE and also essential tools to program in Java.

You may need to compile Java applications now and then even if you are not a programmer, because some applications are distributed as source only and must be compiled. If you plan on just using Java applets, you may go ahead and install JRE. Installing JRE is identical to SDK installation, except for slightly different filenames and missing development tools & APIs.

Note: There are two installation files for Linux, and you need only one of them. What file you want to download depends on your prefered installation method:

  • RPM in self-extracting file, using the Red Hat Package Manager (RPM)
  • Self-extracting file, doing everything yourself

Warning: The SDK file names changes frequently! You should always start your search for the latest files at http://java.sun.com/

RPM in self-extracting file installation

Note: RPM in self-extracting file is the recommended installation method in this tutorial. If your Linux has RPM installed and if you want to install and maintain Java in a similar way as other RPM packages, you should follow these instructions. Red Hat Linux and Mandrake Linux usually have RPM. Otherwise follow the instructions for self-extracting file.

To continue the Java installation, download the Linux RPM in self-extracting file called jdk-*-linux-i586-rpm.bin (for example jdk-1_5_0-linux-i586-rpm.bin.)

Open a terminal window and give the file execute permission:

[user]$ chmod +x jdk-*-linux-i586-rpm.bin 

File access permissions should now be:

[user]$ ls -l -rwx--x--x    1 user     user     44566787 oct  5 18:20 jdk-*-linux-i586-rpm. 

You should also check that the download file size is the same as printed on the download page.

Log in as the super-user and execute the file:

[root]# ./jdk-*-linux-i586-rpm.bin 

Read the "Sun Microsystems, Inc. Binary Code License Agreement". (As if... It's about 1 MB of lawyer mumble jumbo basically telling you that you just agreed to sell your soul to Sun Microsystems, Microsoft, SCO, Kodak and who else... Why do I love the BSD and GPL licenses??) Now, just press space repeatedly for quick scrolling, and type yes. You now have two files:

[root]$ ls jdk-*-linux-i586.rpm   jdk-*-linux-i586-rpm.bin 

Check the installation by printing the product version:

[root]$ /usr/java/jdk1.5.0/bin/java -version java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing) 

Self-extracting file installation

This part of the tutorial has not been updated for a while...

Note: If your Linux has not RPM installed, you should follow these instructions.

Download the self-extracting file called j2sdk-*-linux-i586.bin.

Open a terminal window, and type:

[user]$ chmod +x j2sdk-*-linux-i586.bin 

Log in as the super-user:

[root]# mkdir /usr/java [root]# mv j2sdk-*-linux-i586.bin /usr/java/ [root]# cd /usr/java/ [root]# ./j2sdk-*-linux-i586.bin [root]# rm j2sdk-*-linux-i586.bin 

Check the installation by printing the product version:

[root]# /usr/java/j2sdk*/bin/java -version 

java.sh file

This part of the tutorial describes how to put Java in your path. If you need to run Java from a terminal window without entering the complete path to the java andjavac commands each time, you must complete this step.

Note: You may still run NetBeans IDE even without the path.

Create and edit the java.sh file in /etc/profile.d/ with a simple text editor like gedit or Pico so that java and javac commands works for all users:

Warning: Be careful when editing /etc/profile.d/java.sh. You may not be able to run Linux afterwards (for instance, if you forget to type $ in $PATH). In this case, use the Red Hat Linux CD-ROM with boot: linux rescue.

[root]# gedit /etc/profile.d/java.sh 
export PATH=$PATH:/usr/java/jdk*/bin/ 

When you save the file, the file access permissions will look like:

ls -l -rw-r--r--    1 root     root           44 feb  6 22:11 java.sh 

You should now change the file access permission like this:

[root]# chmod +x java.sh [root]# ls -l -rwxr-xr-x    1 root     root           44 feb  6 22:11 java.sh 

Concept: You may wonder how this would ever work after you log out and back in again, without an explicit command to load the java.sh script. It works because the file /etc/profile executes all scripts in the /etc/profile.d folder.

Note: No other environment variables (such as JDK_HOMEJAVA_HOME or CLASSPATH) are required to run the SDK. However, some applicationsmay require their own environment variables. Check the installation instructions for those applications.

Note: Theoretically, you could edit /etc/profile instead of /etc/profile.d/java.sh, but the latter is easier to maintain. The export NPX_PLUGIN_PATHline is only needed for the Netscape browser Java plug-in. You should not change .bash_profile instead of /etc/profile.d/java.sh, because it will only affect one user.

Save the file and then exit from super-user. Update the NPX_PLUGIN_PATH and PATH environment variables by typing:

  [user]$ source /etc/profile.d/java.sh 

Note: This should work because you changed file access permissions earlier. Alternatively you may log out and then in again.

You should check the path and installation from a terminal window:

[user]$ java -version java version "*" Java(TM) 2 Runtime Environment, Standard Edition (build *) Java HotSpot(TM) Client VM (build *, mixed mode, sharing) 

Your path and installation is OK, if java prints the product version. If nothing happens, see what your PATH environment variable is set to:

[user]$ echo $PATH 

File System Preferences

If you try to run a Swing application with Java 1.4.1 or newer, you will get an error similar to this:

[user]$ java MySwingApp 21.feb.2003 20:22:34 java.util.prefs.FileSystemPreferences$3 run WARNING: Could not create system preferences directory. System preferences are unusable. 

Running a trusted Swing application once as root will create the preferences, and you will never see the message again:

[user]$ su Password:  [root]# java MySwingApp 21.feb.2003 20:32:47 java.util.prefs.FileSystemPreferences$3 run INFO: Created system preferences directory in /etc/.java/.systemPrefs 

Java Web Start

The J2SE installation also installs Java Web Start. You may start the Java Web Start from a terminal window:

[user]$ /usr/java/jdk*/jre/javaws/javaws 

Create Java Web Start Launcher

  1. Right click the desktop
  2. Click New Launcher
  3. Type in the Name text field: Java Web Start
  4. Type in the Command text field: "/usr/java/jdk*/jre/javaws/javaws"
  5. Click Icon and select: /usr/java/jdk*/demo/jfc/Metalworks/HelpFiles/javalogo.gif

If you have created the launcher already and just need to edit it, just drag it into your text editor, or open the file: .gnome-desktop/Java Web Start.desktop

Note: Unfortunately, the original Java Web Start Launcher logo has been removed from /usr/java/jdk*/jre/javaws/

Java Plug-in installation

This part explains how to install Java plug-in for most new HTML browsers, including the Netscape 7.1 browser and the Mozilla 1.4 browser. If you have an older browser, you should read "Java Plug-in installation for older browsers".

Note: For new browsers based on gcc 3.2 one should explicitly choose the plug-in version compiled with gcc32 in the ns610-gcc32 folder. The plug-in in the ns610 folder won't function. The symbolic link created is placed in the folder similar to /usr/*/browser_name/plugins/

Warning: Note that you must create the symbolic link! It doesn't work just trying to copy libjavaplugin_oji.so to the right spot.

Installing for the Netscape 7.1 browser

Open a terminal window, login as the super-user, and make a symbolic link:

[root]# ln -sf /usr/java/j2sdk*/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so /usr/local/netscape/plugins/ 

Note: This is a very long one line command! If something looks like return, it should be typed as space.

Installing for the Mozilla 1.4 browser

Open a terminal window, login as the super-user, and make a symbolic link:

[root]# ln -sf  /usr/java/jdk*/jre/plugin/i386/ns7-gcc29/libjavaplugin_oji.so /usr/lib/mozilla-1.4.2/plugins/ 

Note: This is a very long one line command! If something looks like return, it should be typed as space.

Make sure that the Java plug-in is enabled. Click Edit > Preferences... > Advanced > Enable Java.

Check the Mozilla installation by clicking: Help > About Plug-ins. Mozilla should show a message similar to: Java(TM) Plug-in *

Note: Remember to restart Mozilla before checking the Mozilla installation!

What now?

That's it!! Hopefully you now have Java installed on your Linux box, and you may wonder what to do next. Follow the link if you want to compile and run a Java program, or perhaps get started learning Java programming!
See: Sharing Java

Frequently used commands

Open a Terminal Window

To open a terminal window, click Main Menu > System Tools > Terminal.

Note: If you have already opened a terminal window, you don't have to open another one.

Log in as Super-User

To log in as the super-user, type:

[user]$ su Password:  

Note: If you are already logged in as the super-user, you don't have to log in again.

Note: You may log out as super-user by typing Ctrl+D.

Search for Files

Click Main Menu > Search for Files...

Remove Folders

The tutorial does not explain how you should remove folders, because it is very easy to cause a lot of damage.

Warning: The rm -Rf command may delete your entire hard disk if you do anything wrong. You may feel safer by using a graphical file manager. Make backup of important files before you remove any folders.

Troubleshooting

Can't print the product version

Description: Java gives an error message when I type:

[user]$ java --version 

Solution: The option --version contains a typo! You should write -version. Always read the error messages carefully. Usually, it's not too hard to find out what Java complains about:

Unrecognized option: --version Could not create the Java virtual machine. 

Can't unpack files

Description: The file j2sdk-*-linux-i586-rpm.bin does not unpack correctly.

Solution: You may have download problems. Check the file size with ls -l and compare with the file size written on the download page.

Can't run Java applications

Description: Walter 4 told me that a Java application will not run, because there are two or more versions of the package 'j2sdk' installed in your system, and that the application can't decide which version to use.

Solution: The problem could be that you have installed two versions of Java SDK. Try to uninstall the old package with the rpm -e command.

See: www.rpm.org homepage - RPM Package Manager

Can't run new Java version

Description: You may only run an old Java version, and not the new version you just installed.

Solution: The problem could be the jdkgcj package.

See: This tutorial how to deal with the problem.

Description: You may still only run an old Java version, and not the new version you just installed.

Solution: See answer above. If you need both versions, you should probably start Java by specifying the whole part, such as /usr/java/j2sdk*/bin/java. If you find a better solution, please send me an e-mail.

/usr/java/j2sdk*/bin is in the path twice

Description: /usr/java/j2sdk*/bin is in the path twice.

Solution: I've heard that "GNOME" or "X Window" or something runs /etc/profile even if it has been run already. If you have a better explanation or know how to get rid of the problem, please send me an e-mail.

File System Preferences Error

Description: If you try to run a Swing (GUI) application with Java 1.4.1 or newer, you will get an error.

Solution: The first time you run a Swing application, run it from super-user.

FUD Errors

Description: The network is the computer, and because Java is a network language it won't run on Linux because of firewall problems.

Solution: Don't panic! Try to overcome your personal Fear, Uncertainty, and Doubt (FUD), and the problem is going to magically disappear in a puff of smoke!! This works most of the time, because a whole lot of problems simply does not exist at all, or turns out to be much simpler problems when you just relax a little.

The Far Side of Java Installation

This chapter describes things that you would not normally do, but if you really want to do something unusual anyway, this is how to do it...!! Hey, what do I know??

/etc/profile

If you, for some reason, decided to edit /etc/profile instead of /etc/profile.d/java.sh, follow this procedure:

Warning: Be careful when changing /etc/profile. You may not be able to run Linux afterwards (for instance, if you forget to type $ in $PATH). In this case, use the Red Hat Linux CD-ROM with boot: linux rescue.

Edit profile with the gedit editor so that the Netscape browser Java plug-in and java and javac commands works for all users:

[root]# gedit /etc/profile 
PATH="$PATH:/usr/java/j2sdk*/bin/" export NPX_PLUGIN_PATH=/usr/java/j2sdk*/jre/plugin/i386/ns4/ 

Put the above lines in front of:

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC 

The code should now look like:

PATH="$PATH:/usr/java/j2sdk*/bin/" export NPX_PLUGIN_PATH=/usr/java/j2sdk*/jre/plugin/i386/ns4/ export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC 

Red Hat Linux 8.0 Note

Editing the profile under Red Hat 8.0 requires a different approach. If you are forced under torture to use Java with Red Hat Linux 8.0, this is how to do it:

pathmunge /usr/java/j2sdk*/bin after 

Put the above line before:

pathmunge /usr/X11R6/bin after 

The code should now look like:

pathmunge /usr/java/j2sdk*/bin after pathmunge /usr/X11R6/bin after 

Finishing touches:

export NPX_PLUGIN_PATH=/usr/java/j2sdk*/jre/plugin/i386/ns4/ 

Put the above lines in front of:

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC 

The code should now look like:

export NPX_PLUGIN_PATH=/usr/java/j2sdk*/jre/plugin/i386/ns4/ export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC 

Java Plug-in installation for older browsers

This part of the tutorial describes how to install the Java plug-in for older browsers.

Installing for Netscape 4.x browsers

This is how to install the Java plug-in for older Netscape 4.x browsers. Open a terminal window, login as the super-user, and edit the java.sh file in the/etc/profile.d/ folder:

[root]# gedit /etc/profile.d/java.sh 

The file should look similar to the two lines below:

export NPX_PLUGIN_PATH=/usr/java/j2sdk*/jre/plugin/i386/ns4/ export PATH=$PATH:/usr/java/j2sdk*/bin/ 

Warning: Be careful about typos when editing /etc/profile.d/java.sh. You may not be able to run Linux afterwards (for instance, if you forget to type $in $PATH). In this case, use the Red Hat Linux CD-ROM with boot: linux rescue and fix the typo.

Make sure that the Java plug-in is enabled. Click Edit.Preferences... > Enable Java > Enable Java Plugin.

Installing for Mozilla 1.2.x browsers

This is how to install the Java plug-in for older Mozilla 1.2.x browsers. Open a terminal window, login as the super-user, and make a symbolic link:

[root]# ln -sf /usr/java/j2sdk*/jre/plugin/i386/ns610/libjavaplugin_oji.so /usr/lib/mozilla/plugins/ 

Note: This is a very long one line command! If something looks like return, it should be typed as space.

Note: You should explicitly choose the plug-in in the ns610 folder for older browsers, and not the plug-in in the ns610-gcc32 folder.

Note: The Mozilla folder/directory is named "mozilla-1.0.1" under Red Hat 8.0. However, it is called mozilla under Red Hat 7.2 and 9!

Make sure that the Java plug-in is enabled. Click Edit > Preferences... > Advanced > Enable Java.

Check the Mozilla installation by clicking: Help > About Plug-ins. Mozilla should show a message similar to: Java(TM) Plug-in *

Glossary

Alpha Release

An alpha release is an incomplete program that includes most major features. An alpha release is used for fixing bugs and bad features.

API (Application Programming Interface)

The Java API is a library of Java packages each containing related classes.

Beta Release

A beta release is a complete program, but not a stable or finished product.

JavaScript

Scripting language from Netscape, formerly known as LiveScript. JavaScript and Java are different languages. Netscape renamed LiveScript to JavaScript in order to confuse developers.

J2 (Java 2 Platform)

Sun Microsystems cunningly coined the 1.2.2 and later releases as the Java 2 Platform in order to confuse everyone. See: http://java.sun.com/products/archive/

J2SE with NetBeans IDE Cobundle

Also known as J2SE with Sun ONE Studio, Community Edition.

JDK (Java Development Kit)

Also known as SDK. Sun Microsystems cunningly renamed JDK to SDK in order to confuse everyone.

JRE (Java Runtime Environment)

The JRE is included in the SDK.

RC (Release Candidate)

A Release Candidate is very close to the launch version, and is meant to be a complete version in its final form. A Release Candidate is used for widespread testing, just in case there are any remaining bugs.

SDK (Software Development Kit)

Formerly known as JDK. The SDK contains development tools & APIs and the JRE.

SE (Standard Edition)

JRE or SDK