Java under UNIX

Hi

I have some problem executing class file under UNIX.

I have a directory under UNIX,

/home/user1

wherein I have placed a class file say "JavaProg.class"

I execute "java JavaProg" from the above directory

and it generates the desired output.

Now, I have another directory,

/home/user2

wherein I again I have placed the same class file "JavaProg.class"

I execute "java JavaProg" from this second directory

this time and it again generates the desired output.

Problem starts now,

I delete the class file from /home/user2

1. And then I execute the following command trying to

directly execute class file from user1's directory

"java /home/user1/JavaProg" from "/home/user1"

directory.

On this it says "Can't find the class file".

So I try various other options like.

2. First I set the CLASSPATH as

set $CLASSPATH=.:/home/user1:/opt/java/lib:$CLASSPATH

export CLASSPATH

And I try the following command

"java JavaProg" (This time I dont' write the complete

absolute path since its already defined in the CLASSPATH) I get an error. So I still try the following,

3.

"java /home/user1/JavaProg"

ERROR

4. "java -classpath .:home/user1 JavaProg

ERROr

5. "java -classpath .:home/user1 home/user1/JavaProg

ERROr

6. "java -cp .:home/user1 JavaProg

ERROr

7. "java -cp .:home/user1 home/user1/JavaProg

ERROr

What might be the source of the error. Can anyone

help. Thanks in advance for the help.

Thank,s

JAtin

[1767 byte] By [Jatin2000] at [2007-9-26 2:00:45]
# 1
set your CLASSPATH as$CLASSPATH:/home/user1and export it
dritesh at 2007-6-29 8:40:18 > top of Java-index,Developer Tools,Java Compiler...
# 2
What is the first 10 lines of your JavaProg.java source? Did you use package?--lichu
lichudang at 2007-6-29 8:40:18 > top of Java-index,Developer Tools,Java Compiler...
# 3

No its not part of any package. It however, uses std java packages,

the first few lines of the code are as follows,

import java.io.*;

import java.lang.Object;

import java.util.*;

public class Java_Data

{

public static void main(String args[])

{

Any help, any insights.

Thanks,

JAtin

Jatin2000 at 2007-6-29 8:40:18 > top of Java-index,Developer Tools,Java Compiler...
# 4
Any help, anyone
Jatin2000 at 2007-6-29 8:40:18 > top of Java-index,Developer Tools,Java Compiler...
# 5
Well, what kind of error do you get?Syntax error or Command error?Give us the complete error message.--lichu
lichudang at 2007-6-29 8:40:18 > top of Java-index,Developer Tools,Java Compiler...