James,
If you're using 'bash' as your login shell (the thingie that gives you a
prompt - in DOS it's 'command.com'), you can set your path like so:
export PATH=$PATH:/usr/share/jdk1.2/bin
then try running 'java' again. To test that it's working on some level,
try running 'java -version' and see if you get output.
I've heard reports from a number of folks that permissions aren't
getting set properly on the Blackdown JDK at install time. An
explanation follows.
If you still get messages about 'java not found', then check the
permissions on the directories and files in the JDK. Unix/Linux have a
nifty little annoyance for new users called 'permissions'. Basically,
this allows you to change the access different users have to different
stuff. Permissions which can be changed include read, write, and execute
(that's right - just because a file is a compiled binary "executable"
doesn't mean it can actually be executed unless the permission flags on
it say it can). In my install of Java 2, the permissions look like this:
[jgalyan@talisman Jeff]$ ls -l /usr/local/jdk1.2
total 4706
-r--r--r-- 1 jgalyan jgalyan 915 Dec 1 1998 COPYRIGHT
-r--r--r-- 1 jgalyan jgalyan 8605 Dec 1 1998 LICENSE
-rw-r--r-- 1 jgalyan jgalyan 6650 May 12 1999 LICENSE.Java3D
-r--r--r-- 1 jgalyan jgalyan 5864 Dec 1 1998 README
-rw-r--r-- 1 jgalyan jgalyan 9949 May 12 1999 README.Java3D-jdk
-rw-r--r-- 1 jgalyan jgalyan 585 May 12 1999
README.Java3D.linux
-rw-r--r-- 1 jgalyan jgalyan 608 Aug 13 02:14
README.PRE-RELEASE
-r--r--r-- 1 jgalyan jgalyan 19431 Dec 1 1998 README.html
-rw-r--r-- 1 jgalyan jgalyan 11688 Aug 13 02:14 README.linux
-rw-r--r-- 1 jgalyan jgalyan 6422 Aug 13 02:14 README.linux.src
drwxr-xr-x 3 jgalyan jgalyan 1024 Aug 13 02:12 bin
drwxr-xr-x 3 jgalyan jgalyan 1024 May 12 1999 demo
drwxr-xr-x 3 jgalyan jgalyan 1024 Aug 13 02:13 include
drwxr-xr-x 3 jgalyan jgalyan 1024 Aug 13 02:13 include-old
-rw-r--r-- 1 jgalyan jgalyan 287226 May 12 1999
java3d-utils-src.jar
drwxr-xr-x 4 jgalyan jgalyan 1024 May 12 1999 jre
drwxr-xr-x 2 jgalyan jgalyan 1024 Aug 13 02:15 lib
-rw-r--r-- 1 jgalyan jgalyan 4427336 Aug 13 02:14 src.jar
(ignore the java3d stuff - that's a separate add-on package, not part of
what you should have already).
I realize this all looks a bit confusing to a new user. Here's an
explanation. The first column shows what flags are set: d = directory, r
= readable, w = writable, x = executable. The order of the flags is
owner (the user whose name appears in the third column), group (the name
in the fourth column), others. The important thing to have set up on
everything in your Java installation is that all of the files are
readable by everyone. Directories are a special case - directories must
be readable and executable if you want to even see what's inside them.
So, directories permissions should look like drwxr-xr-x (dir,
read/write/execute by owner, read/execute by group, read/execute by
others). Confused yet?
Here's what you want to do:
1. log in as root
2. use the chmod command to change the "mode" (permissions) on the files
and directories: 'chmod 755 /usr/share/jdk1.2' OR 'chmod a+rx
/usr/share/jdk1.2'. Either way works fine. To speed things up a little,
run 'chmod -R a+r /usr/share/jdk1.2' then cd into /usr/share/jdk1.2.
Inside that directory, you need to chmod a+rx everything that is a
directory - don't worry about regular files, you've already made
everything in the whole hierarchy readable by all. If you see anything
that has permissions of 'rws' in there when you run 'ls -l', do 'chmod
a-s <file>'. Java doesn't need to run as a specific user (this is
actually a problem with the current build process that we at Sun are
using - it works fine on Solaris, but sets permissions incorrectly on
Linux). Keep going through all the directories until all the directories
are read/execute by all, and all regular files (i.e., READMEs and such
like that) are readable by all. All the jar files should be readable by
all.
3. Once that's finished, you should be able to run java fine.
I know this sounds like alot of work to go through to get Java working
on your Linux system, but at least you only have to do this once. If
this is the problem you're experiencing, then hopefully we'll figure out
soon where the permissions are getting set incorrectly at and fix it.
I've had to go through this process of chmodding everything in sight
myself (and I do my own builds of Java, so I'm pretty sure it's
somewhere in the actual build process that the problem is occurring).
Anyway, I'm betting this will solve your problem. Let me know if it
doesn't.
--Jeff
Nathan Meyers wrote:
>
> On Sat, Nov 27, 1999 at 12:14:21AM -0000, James Butler wrote:
> > Sorry but I'm getting nowhere here.
> >
> > I run 'java' and './java' from /usr/share/jdk1.2/bin and the system says
> > file 'java' not found.
> >
> > Do I have to fiddle around with .java_wrapper, in some way?
> >
> > Blackdown's documentation seems quite inadequate especially to a beginner
> > like me who is more used to the plug and play nature of Windows.
> >
> > I just want to get on and program but want to do it on a Unix like system.
>
> Then you have plenty of support from this crowd... but you'll have
> to be a bit patient. There's a learning curve with Linux/Unix that's
> independent of Java, but once you've climbed that curve you'll find
> yourself knowledgeably using a system that's much less plug-and-play
> but much more robust than Windows.
>
> If you've got the JDK1.2 glibc2.1 installation on RedHat 6.x, you should
> be able to run java by invoking the script (that's Unix-ese for what they
> call batch files in Windows) in the bin subdirectory. There's one catch:
> you mustn't be in that directory when you run it. So... from some *other*
> directory, run:
>
> /usr/share/jdk1.2/bin/java
>
> (I'm assuming, per your previous postings, that your tree is installed
> at /usr/share/jdk1.2).
>
> I'm a little bothered by the "java not found" error. If you make the
> mistake of running from that directory, you should see a failure to find
> "libjava.so". Assuming you've got the Blackdown installation and haven't
> messed with any of the files, the invocation I described above should work.
>
> Nathan Meyers
> [EMAIL PROTECTED]
>
--
Jeff Galyan
http://www.anamorphic.com
http://www.sun.com
jeffrey dot galyan at sun dot com
talisman at anamorphic dot com
Sun Certified Java(TM) Programmer
======================================================================
Linus Torvalds on Microsoft and software development:
"... if it's a hobby for me and a job for you, why are you doing such a
shoddy job of it?"
The views expressed herein do not necessarily reflect those of my
employer.
Sun Microsystems, Inc., has no connection to my involvement with the
Mozilla Organization.
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]