Solved

Which java

Posted on 2004-07-30
4
208 Views
Last Modified: 2013-12-06
Hi All,
            I am stuck to problem in Red hat(Linux 9), I installed Red Hat (Linux 9) server,  now the problem is  when i run 'javac' command it gives me error message
 gcj: no input files
and when I run command 'which java', it gives me the following path

/usr/bin/java

wheras I had installed j2sdk1.4.2_03 at /usr/local/ and edited /etc/profile file as follows
export JAVA_HOME=/usr/local/j2sdk1.4.2_03
export PATH=$PATH:$JAVA_HOME/bin

and when i run command 'source /etc/profile' nothing happens, it still takes /usr/bin/java path. I want to use the java which i installed at /usr/local/j2sdk1.4.2_03 , how can i do this?can anyone help me out? I will be thankful to you.

wishes
saharey
0
Comment
Question by:saharey
4 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 63 total points
ID: 11676244
/usr/bin is in PATH before /usr/local/j2sdk1.4.2_03/bin, so the copy of java there will be the one found. Change your PATH set up to be:

export PATH=$JAVA_HOME/bin:$PATH

and then executing java will find the new copy.
0
 
LVL 3

Assisted Solution

by:255x4
255x4 earned 62 total points
ID: 11680015
Or, you can delete the java at /usr/bin and then make a symlink to the new one.

su root
{login as root}
cd /usr/bin
rm java
ln -s /usr/local/j2sdk1.4.2_03/bin/java /usr/bin/java

This will link the /usr/bin/java to the correct location for java.  The only reason you would really want to do this is because some programs may want to point to /usr/bin/java instead of just finding out where java is on the machine.

Also, you will need to symlink your java plugin for netscape or whichever browser you are using.  Just do the same:

ln -s /usr/local/j2sdk1.4.2_03/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so {path to mozilla or other browsers plugin directory}/libjavaplugin_oji.so

This will allow your browser to use the plugin.  Note, the ns610-gcc32 will work for most netscape and mozilla browsers, but if you have a problem with one, use the ns610 directory instead.

255x4
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS ELB 5 95
Why  my code (program) build with old compiler? 11 79
linux SFTP 8 62
Upgrade BIOS / EUFI at Scale 4 55
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question