The shell executes the jar program and manually configures the JDK environment that executes the jar, executing the script as:
#!/bin/shexport java_home=/home/hadoop/szw/jdk1.8.0_25 Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATHecho ' Date ' Java-jar Stanford.jar edu.stanford.nlp.wordseg.chinesedictionary-inputdicts in.txt-output Dict.ser.szw.gzecho ' Date ' Java-jar Stanford_model.jar edu.stanford.nlp.ie.crf.crfclassifier-prop ctb.prop-serdictionary Dict.ser.szw.gz-sighancorporadict data-trainfile in.txt-serializeto newmodel.ser.szw.gz > Newmodel.log 2> Newmodel.errecho ' Date '//print time, where ' is the key above the TAB key
With this script execution is always error, ': Not a valid identifierport: ', tried a lot of ways always find the cause of the error, the last discovery is the script file format problem, need to convert this script to UNIX format, script I use notepad+ + Edit, save is default to Windows format , convert this to UNIX and perform normally.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/58/29/wKiom1SqXdHiYn3jAALuacRgbe8151.jpg "title=" Untitled. png "alt=" wkiom1sqxdhiyn3jaaluacrgbe8151.jpg "/>
This article is from the "Punk" blog, please be sure to keep this source http://yimaoqian.blog.51cto.com/1328422/1599395
Executing jar in Shell