How to run java from shell

Hi All,

I am trying to run a grep command which creates an output file.

Then I will run a java file which take that file and process that. My java file uses other java files and library jars.
I have tried below code but I am getting compilation error,it can not find other java files in same directory. Please suggest?

grep -e keyword1 test.txt -e keyword2| cut -f 2,5,14 | sort| uniq |awk '{$1=$1;print}' OFS=,> /Users/kmajumder/Documents/Shell/java/com/test/opcomma.xls

export CLASSPATH=$CLASSPATH:/Users/kmajumder/Documents/Shell/java/lib/*.jar:/Users/kmajumder/Documents/Shell/java/com/test/*.java

javac /Users/kmajumder/Documents/Shell/java/com/test/Test.java
java /Users/kmajumder/Documents/Shell/java/com/test/Test.class

Thanks in advance.

I am not all that knowledgeable about Java, but AFAIK "CLASSPATH" is a PATH, as the name suggests. Remove the superfluous (and probably dangerous) shell globs ("/.jar", "/.java") from your definition and try again.

I hope this helps.

bakunin