How to run a Java program from an Unix script?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I try to compile a Java project from a Linux script, run_nmc_engine.sh. The problem is that I get an error when launching it :
Error: Could not find or load main class caos.aaai.CaosNMCEngine
The command I launched in my script was, more or less,
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine blablabla ...
I didn't add it all because I thought the error was in related to the first part of the command. I don't know where JCHEM is but I know it is
An implementation for chemical representation, search, storage, structural and non-structural data management functions. from ChemAxon website
It seems it can't find where the CaosNMCEngine.java file is. Yet, I thought it was well placed in the folder :

You can find the whole project on the webpage of the project on GitHub. Let me know if you need anything more to complete the readme. Maybe you will have more luck comparing the script with the one from the original project.
The full script is :
JCHEM=/Applications/ChemAxon/JChem-5.7.0
MAXMEM="2G"
if [[ `uname -a | grep Linux` ]] ;
then
JCHEM=/gpfs/home/aheifets/opt/jchem-5.7.1
MAXMEM="8G"
fi
TOP=`cd $(dirname $0)/../..; pwd -P`
PATH=$PATH:$JCHEM/bin
# rm ReactorDemo.class
# javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked ReactorDemo.java
# java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar ReactorDemo $1 $2 $3 #| tee /dev/stderr | mview - &
#rm RetroTests.class
#javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked RetroTests.java
#java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar RetroTests $1 $2 $3 #| tee /dev/stderr | mview - &
date
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/cleaned_reaction_library_JChem_5.7.0_DISABLED $TOP/data/SML $TOP/data/33.smiles 8000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/3/RXNs $TOP/data/BENCHMARK/PROBLEMS/3/SML $TOP/data/BENCHMARK/PROBLEMS/3/goal_d3.smarts 1 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#PROBLEM=16
# for PROBLEM in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18.1 19 20
#for PROBLEM in 11 #8 10 11 12 #1 12 14 15 16 #15 #11 12 14 16 18 19 8 9
for PROBLEM in 2
do
OUTDIR=rxndebug #exhaust #
mkdir -p $TOP/out/$OUTDIR/$PROBLEM
LOG=$TOP/out/$OUTDIR/$PROBLEM/log
ERR=$TOP/out/$OUTDIR/$PROBLEM/err
echo "==================================PROBLEM $PROBLEM=================================="
echo "==================================PROBLEM $PROBLEM==================================" > $LOG
echo "==================================PROBLEM $PROBLEM==================================" > $ERR
date
date > $ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar test.ReactorDemo2 $*
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.OperatorLibrary
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 5 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML EXHAUSTIVE >$LOG 2>>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/goal_c.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/solution_B.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
diff -b $LOG $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SOLUTION.txt
date
date >> $ERR
echo $LOG
done
scripting java launcher
add a comment |Â
up vote
0
down vote
favorite
I try to compile a Java project from a Linux script, run_nmc_engine.sh. The problem is that I get an error when launching it :
Error: Could not find or load main class caos.aaai.CaosNMCEngine
The command I launched in my script was, more or less,
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine blablabla ...
I didn't add it all because I thought the error was in related to the first part of the command. I don't know where JCHEM is but I know it is
An implementation for chemical representation, search, storage, structural and non-structural data management functions. from ChemAxon website
It seems it can't find where the CaosNMCEngine.java file is. Yet, I thought it was well placed in the folder :

You can find the whole project on the webpage of the project on GitHub. Let me know if you need anything more to complete the readme. Maybe you will have more luck comparing the script with the one from the original project.
The full script is :
JCHEM=/Applications/ChemAxon/JChem-5.7.0
MAXMEM="2G"
if [[ `uname -a | grep Linux` ]] ;
then
JCHEM=/gpfs/home/aheifets/opt/jchem-5.7.1
MAXMEM="8G"
fi
TOP=`cd $(dirname $0)/../..; pwd -P`
PATH=$PATH:$JCHEM/bin
# rm ReactorDemo.class
# javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked ReactorDemo.java
# java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar ReactorDemo $1 $2 $3 #| tee /dev/stderr | mview - &
#rm RetroTests.class
#javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked RetroTests.java
#java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar RetroTests $1 $2 $3 #| tee /dev/stderr | mview - &
date
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/cleaned_reaction_library_JChem_5.7.0_DISABLED $TOP/data/SML $TOP/data/33.smiles 8000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/3/RXNs $TOP/data/BENCHMARK/PROBLEMS/3/SML $TOP/data/BENCHMARK/PROBLEMS/3/goal_d3.smarts 1 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#PROBLEM=16
# for PROBLEM in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18.1 19 20
#for PROBLEM in 11 #8 10 11 12 #1 12 14 15 16 #15 #11 12 14 16 18 19 8 9
for PROBLEM in 2
do
OUTDIR=rxndebug #exhaust #
mkdir -p $TOP/out/$OUTDIR/$PROBLEM
LOG=$TOP/out/$OUTDIR/$PROBLEM/log
ERR=$TOP/out/$OUTDIR/$PROBLEM/err
echo "==================================PROBLEM $PROBLEM=================================="
echo "==================================PROBLEM $PROBLEM==================================" > $LOG
echo "==================================PROBLEM $PROBLEM==================================" > $ERR
date
date > $ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar test.ReactorDemo2 $*
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.OperatorLibrary
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 5 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML EXHAUSTIVE >$LOG 2>>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/goal_c.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/solution_B.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
diff -b $LOG $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SOLUTION.txt
date
date >> $ERR
echo $LOG
done
scripting java launcher
You may be better off asking on Stack Overflow underJavatag, as this is rather a niche Java question than a Linux specific question.
â ajeh
May 9 at 15:11
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I try to compile a Java project from a Linux script, run_nmc_engine.sh. The problem is that I get an error when launching it :
Error: Could not find or load main class caos.aaai.CaosNMCEngine
The command I launched in my script was, more or less,
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine blablabla ...
I didn't add it all because I thought the error was in related to the first part of the command. I don't know where JCHEM is but I know it is
An implementation for chemical representation, search, storage, structural and non-structural data management functions. from ChemAxon website
It seems it can't find where the CaosNMCEngine.java file is. Yet, I thought it was well placed in the folder :

You can find the whole project on the webpage of the project on GitHub. Let me know if you need anything more to complete the readme. Maybe you will have more luck comparing the script with the one from the original project.
The full script is :
JCHEM=/Applications/ChemAxon/JChem-5.7.0
MAXMEM="2G"
if [[ `uname -a | grep Linux` ]] ;
then
JCHEM=/gpfs/home/aheifets/opt/jchem-5.7.1
MAXMEM="8G"
fi
TOP=`cd $(dirname $0)/../..; pwd -P`
PATH=$PATH:$JCHEM/bin
# rm ReactorDemo.class
# javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked ReactorDemo.java
# java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar ReactorDemo $1 $2 $3 #| tee /dev/stderr | mview - &
#rm RetroTests.class
#javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked RetroTests.java
#java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar RetroTests $1 $2 $3 #| tee /dev/stderr | mview - &
date
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/cleaned_reaction_library_JChem_5.7.0_DISABLED $TOP/data/SML $TOP/data/33.smiles 8000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/3/RXNs $TOP/data/BENCHMARK/PROBLEMS/3/SML $TOP/data/BENCHMARK/PROBLEMS/3/goal_d3.smarts 1 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#PROBLEM=16
# for PROBLEM in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18.1 19 20
#for PROBLEM in 11 #8 10 11 12 #1 12 14 15 16 #15 #11 12 14 16 18 19 8 9
for PROBLEM in 2
do
OUTDIR=rxndebug #exhaust #
mkdir -p $TOP/out/$OUTDIR/$PROBLEM
LOG=$TOP/out/$OUTDIR/$PROBLEM/log
ERR=$TOP/out/$OUTDIR/$PROBLEM/err
echo "==================================PROBLEM $PROBLEM=================================="
echo "==================================PROBLEM $PROBLEM==================================" > $LOG
echo "==================================PROBLEM $PROBLEM==================================" > $ERR
date
date > $ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar test.ReactorDemo2 $*
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.OperatorLibrary
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 5 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML EXHAUSTIVE >$LOG 2>>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/goal_c.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/solution_B.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
diff -b $LOG $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SOLUTION.txt
date
date >> $ERR
echo $LOG
done
scripting java launcher
I try to compile a Java project from a Linux script, run_nmc_engine.sh. The problem is that I get an error when launching it :
Error: Could not find or load main class caos.aaai.CaosNMCEngine
The command I launched in my script was, more or less,
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine blablabla ...
I didn't add it all because I thought the error was in related to the first part of the command. I don't know where JCHEM is but I know it is
An implementation for chemical representation, search, storage, structural and non-structural data management functions. from ChemAxon website
It seems it can't find where the CaosNMCEngine.java file is. Yet, I thought it was well placed in the folder :

You can find the whole project on the webpage of the project on GitHub. Let me know if you need anything more to complete the readme. Maybe you will have more luck comparing the script with the one from the original project.
The full script is :
JCHEM=/Applications/ChemAxon/JChem-5.7.0
MAXMEM="2G"
if [[ `uname -a | grep Linux` ]] ;
then
JCHEM=/gpfs/home/aheifets/opt/jchem-5.7.1
MAXMEM="8G"
fi
TOP=`cd $(dirname $0)/../..; pwd -P`
PATH=$PATH:$JCHEM/bin
# rm ReactorDemo.class
# javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked ReactorDemo.java
# java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar ReactorDemo $1 $2 $3 #| tee /dev/stderr | mview - &
#rm RetroTests.class
#javac -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar -Xlint:unchecked RetroTests.java
#java -cp .:/Applications/ChemAxon/JChem-5.7.0/lib/jchem.jar RetroTests $1 $2 $3 #| tee /dev/stderr | mview - &
date
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/cleaned_reaction_library_JChem_5.7.0_DISABLED $TOP/data/SML $TOP/data/33.smiles 8000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx2G -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/3/RXNs $TOP/data/BENCHMARK/PROBLEMS/3/SML $TOP/data/BENCHMARK/PROBLEMS/3/goal_d3.smarts 1 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#PROBLEM=16
# for PROBLEM in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18.1 19 20
#for PROBLEM in 11 #8 10 11 12 #1 12 14 15 16 #15 #11 12 14 16 18 19 8 9
for PROBLEM in 2
do
OUTDIR=rxndebug #exhaust #
mkdir -p $TOP/out/$OUTDIR/$PROBLEM
LOG=$TOP/out/$OUTDIR/$PROBLEM/log
ERR=$TOP/out/$OUTDIR/$PROBLEM/err
echo "==================================PROBLEM $PROBLEM=================================="
echo "==================================PROBLEM $PROBLEM==================================" > $LOG
echo "==================================PROBLEM $PROBLEM==================================" > $ERR
date
date > $ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar test.ReactorDemo2 $*
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.OperatorLibrary
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosNMCEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs_DISABLED $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 10000 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML >$LOG 2>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/goal.smiles 5 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML EXHAUSTIVE >$LOG 2>>$ERR
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/goal_c.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
#java -Xmx$MAXMEM -cp .:$TOP/build:$JCHEM/lib/jchem.jar caos.aaai.CaosEngine $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/RXNs $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SML $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/subgoals/solution_B.smiles 100 0 $TOP/data/BENCHMARK/PROBLEMS/GlobalRXNs $TOP/data/BENCHMARK/PROBLEMS/GlobalSML
diff -b $LOG $TOP/data/BENCHMARK/PROBLEMS/$PROBLEM/SOLUTION.txt
date
date >> $ERR
echo $LOG
done
scripting java launcher
edited May 9 at 15:13
asked May 9 at 14:42
ThePassenger
17610
17610
You may be better off asking on Stack Overflow underJavatag, as this is rather a niche Java question than a Linux specific question.
â ajeh
May 9 at 15:11
add a comment |Â
You may be better off asking on Stack Overflow underJavatag, as this is rather a niche Java question than a Linux specific question.
â ajeh
May 9 at 15:11
You may be better off asking on Stack Overflow under
Java tag, as this is rather a niche Java question than a Linux specific question.â ajeh
May 9 at 15:11
You may be better off asking on Stack Overflow under
Java tag, as this is rather a niche Java question than a Linux specific question.â ajeh
May 9 at 15:11
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
1) java is really looking for a .class at that point, not a .java.
2) If the .class you have is named caos.aaai.CaosEngine then java looks for caos/aaai/CaosEngine.class (ie, two directories down) in each directory or JAR added to the class path.
It is often simpler to packages all classes in a JAR, with the MANIFEST.MF file of the JAR having an Main-Class: classname entry pointing to the main() class, and then start the app using java -jar the_jar
thank you for your answer. Unfortunately I only haveCaosEngine.javaincaos/aaaiI never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own class
â ThePassenger
May 9 at 15:55
Then you have to compile the java to get a.classfrom a.java. You use the Java compiler (javaccommand) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs isjar(or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).
â xenoid
May 9 at 20:02
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
1) java is really looking for a .class at that point, not a .java.
2) If the .class you have is named caos.aaai.CaosEngine then java looks for caos/aaai/CaosEngine.class (ie, two directories down) in each directory or JAR added to the class path.
It is often simpler to packages all classes in a JAR, with the MANIFEST.MF file of the JAR having an Main-Class: classname entry pointing to the main() class, and then start the app using java -jar the_jar
thank you for your answer. Unfortunately I only haveCaosEngine.javaincaos/aaaiI never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own class
â ThePassenger
May 9 at 15:55
Then you have to compile the java to get a.classfrom a.java. You use the Java compiler (javaccommand) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs isjar(or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).
â xenoid
May 9 at 20:02
add a comment |Â
up vote
0
down vote
1) java is really looking for a .class at that point, not a .java.
2) If the .class you have is named caos.aaai.CaosEngine then java looks for caos/aaai/CaosEngine.class (ie, two directories down) in each directory or JAR added to the class path.
It is often simpler to packages all classes in a JAR, with the MANIFEST.MF file of the JAR having an Main-Class: classname entry pointing to the main() class, and then start the app using java -jar the_jar
thank you for your answer. Unfortunately I only haveCaosEngine.javaincaos/aaaiI never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own class
â ThePassenger
May 9 at 15:55
Then you have to compile the java to get a.classfrom a.java. You use the Java compiler (javaccommand) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs isjar(or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).
â xenoid
May 9 at 20:02
add a comment |Â
up vote
0
down vote
up vote
0
down vote
1) java is really looking for a .class at that point, not a .java.
2) If the .class you have is named caos.aaai.CaosEngine then java looks for caos/aaai/CaosEngine.class (ie, two directories down) in each directory or JAR added to the class path.
It is often simpler to packages all classes in a JAR, with the MANIFEST.MF file of the JAR having an Main-Class: classname entry pointing to the main() class, and then start the app using java -jar the_jar
1) java is really looking for a .class at that point, not a .java.
2) If the .class you have is named caos.aaai.CaosEngine then java looks for caos/aaai/CaosEngine.class (ie, two directories down) in each directory or JAR added to the class path.
It is often simpler to packages all classes in a JAR, with the MANIFEST.MF file of the JAR having an Main-Class: classname entry pointing to the main() class, and then start the app using java -jar the_jar
answered May 9 at 15:40
xenoid
1,6701620
1,6701620
thank you for your answer. Unfortunately I only haveCaosEngine.javaincaos/aaaiI never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own class
â ThePassenger
May 9 at 15:55
Then you have to compile the java to get a.classfrom a.java. You use the Java compiler (javaccommand) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs isjar(or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).
â xenoid
May 9 at 20:02
add a comment |Â
thank you for your answer. Unfortunately I only haveCaosEngine.javaincaos/aaaiI never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own class
â ThePassenger
May 9 at 15:55
Then you have to compile the java to get a.classfrom a.java. You use the Java compiler (javaccommand) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs isjar(or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).
â xenoid
May 9 at 20:02
thank you for your answer. Unfortunately I only have
CaosEngine.java in caos/aaai I never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own classâ ThePassenger
May 9 at 15:55
thank you for your answer. Unfortunately I only have
CaosEngine.java in caos/aaai I never did a JAR nor a MANIFEST.MF I only took the code from the last link I provided and try to modify it on my own to run my own classâ ThePassenger
May 9 at 15:55
Then you have to compile the java to get a
.class from a .java. You use the Java compiler (javac command) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs is jar (or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).â xenoid
May 9 at 20:02
Then you have to compile the java to get a
.class from a .java. You use the Java compiler (javac command) or use an IDE. A JAR is mostly a ZIP file, the command to create JARs is jar (or ask the IDE to generate it). But this is StackExchange territory (or Java 101...).â xenoid
May 9 at 20:02
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442794%2fhow-to-run-a-java-program-from-an-unix-script%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
You may be better off asking on Stack Overflow under
Javatag, as this is rather a niche Java question than a Linux specific question.â ajeh
May 9 at 15:11