第一行的jar执行命令错误
Jar execution command error from first line
来自 this 存储库
我尝试执行命令。
./PersonalityRecognizer -i ../output_dir -d -t 2 -a ../mairesse_Apache.arff
但是我收到这个错误。
C:/weka/weka-3-4/weka.jar: line 1: $'PK[=11=]3[=11=]4': command not found
C:/weka/weka-3-4/weka.jar: line 2: syntax error near unexpected token `('
C:/weka/weka-3-4/weka.jar: line 2: `▒=1 META-INF/▒=1META-INF/MANIFEST.MF▒M▒▒LK-.▒K-*▒▒ϳR0▒3▒▒M▒▒▒u▒I,.▒R(O▒N▒K/▒▒s▒t▒▒▒/N-▒r.JM,IM▒u▒▒Rp▒+▒1▒3▒▒P▒׀NMPK'
./PersonalityRecognizer: line 15: : command not found
我已经下载了weka jar文件,并按照说明要求在以下文件中给出了路径:
#! /bin/bash -
# ENVIRONMENT VARIABLES
JDK_PATH=../../apps/jdk1.5.0_05
WEKA=../../apps/weka-3-4/weka.jar
# ----------------------------------
COMMONS_CLI=./lib/commons-cli-1.0.jar
MRC=./lib/jmrc.jar
LIBS=.:$WEKA:$COMMONS_CLI:$MRC:bin/
$JDK_PATH/bin/java -Xmx512m -classpath $LIBS recognizer.PersonalityRecognizer $*
正如 jhenrique 所说,如果您使用 windows,则必须编辑 PersonalityRecognizer.bat(您似乎已经编辑了 bash 脚本,但 运行 在 windows).
然后您必须确保目录结构如下所示:
\ Personality-Recognition-in-SD-master (this is the cloned repo's root)
+---apps
+---Classification
+---data
+---mrc
+---output_dir
\---PersonalityRecognizer (this contains the PersonalityRecognizer.bat and bash scripts, note the subdirectory)
您还必须确保编辑 PersonalityRecognizer 子目录中的 PersonalityRecognizer.properties,以包含您的应用程序路径。如果您使用 windows,则必须使用双 / 作为路径分隔符:
##################################################
# Configuration File of the Personality Recognizer
##################################################
# All variables should be modified according to your
# directory structure
# Warning: for Windows paths, backslashes need to be
# doubled, e.g. c:\Program Files\Recognizer
# Root directory of the application
appDir = F:\Personality-Recognition-in-SD-master\PersonalityRecognizer
# Path to the LIWC dictionary file (LIWC.CAT)
liwcCatFile = lib/LIWC.CAT
# Path to the MRC Psycholinguistic Database file (mrc2.dct)
mrcPath = ../mrc/mrc2.dct
更新:
还要确保 PersonalityRecognizer.bat 中的 JDK_PATH 和 WEKA 变量指向有效的 JDK 路径和 WEKA 路径(weka.jar 包含在您克隆的 repo 中):
@echo off
rem WINDOWS LAUNCH SCRIPT
rem ENVIRONMENT VARIABLES TO MODIFY
set JDK_PATH="C:\Program Files\Java\jdk1.6.0_01"
set WEKA="F:\Personality-Recognition-in-SD-master\apps\weka-3-4\weka.jar"
rem ----------------------------------
set COMMONS_CLI="lib\commons-cli-1.0.jar"
set JMRC="lib\jmrc.jar"
set LIBS=%WEKA%;%COMMONS_CLI%;%JMRC%;%CD%;bin\
%JDK_PATH%\bin\java -Xmx512m -classpath %LIBS% recognizer.PersonalityRecognizer %1 %2 %3 %4 %5 %6 %7 %8 %9
来自 this 存储库
我尝试执行命令。
./PersonalityRecognizer -i ../output_dir -d -t 2 -a ../mairesse_Apache.arff
但是我收到这个错误。
C:/weka/weka-3-4/weka.jar: line 1: $'PK[=11=]3[=11=]4': command not found
C:/weka/weka-3-4/weka.jar: line 2: syntax error near unexpected token `('
C:/weka/weka-3-4/weka.jar: line 2: `▒=1 META-INF/▒=1META-INF/MANIFEST.MF▒M▒▒LK-.▒K-*▒▒ϳR0▒3▒▒M▒▒▒u▒I,.▒R(O▒N▒K/▒▒s▒t▒▒▒/N-▒r.JM,IM▒u▒▒Rp▒+▒1▒3▒▒P▒׀NMPK'
./PersonalityRecognizer: line 15: : command not found
我已经下载了weka jar文件,并按照说明要求在以下文件中给出了路径:
#! /bin/bash -
# ENVIRONMENT VARIABLES
JDK_PATH=../../apps/jdk1.5.0_05
WEKA=../../apps/weka-3-4/weka.jar
# ----------------------------------
COMMONS_CLI=./lib/commons-cli-1.0.jar
MRC=./lib/jmrc.jar
LIBS=.:$WEKA:$COMMONS_CLI:$MRC:bin/
$JDK_PATH/bin/java -Xmx512m -classpath $LIBS recognizer.PersonalityRecognizer $*
正如 jhenrique 所说,如果您使用 windows,则必须编辑 PersonalityRecognizer.bat(您似乎已经编辑了 bash 脚本,但 运行 在 windows).
然后您必须确保目录结构如下所示:
\ Personality-Recognition-in-SD-master (this is the cloned repo's root)
+---apps
+---Classification
+---data
+---mrc
+---output_dir
\---PersonalityRecognizer (this contains the PersonalityRecognizer.bat and bash scripts, note the subdirectory)
您还必须确保编辑 PersonalityRecognizer 子目录中的 PersonalityRecognizer.properties,以包含您的应用程序路径。如果您使用 windows,则必须使用双 / 作为路径分隔符:
##################################################
# Configuration File of the Personality Recognizer
##################################################
# All variables should be modified according to your
# directory structure
# Warning: for Windows paths, backslashes need to be
# doubled, e.g. c:\Program Files\Recognizer
# Root directory of the application
appDir = F:\Personality-Recognition-in-SD-master\PersonalityRecognizer
# Path to the LIWC dictionary file (LIWC.CAT)
liwcCatFile = lib/LIWC.CAT
# Path to the MRC Psycholinguistic Database file (mrc2.dct)
mrcPath = ../mrc/mrc2.dct
更新: 还要确保 PersonalityRecognizer.bat 中的 JDK_PATH 和 WEKA 变量指向有效的 JDK 路径和 WEKA 路径(weka.jar 包含在您克隆的 repo 中):
@echo off
rem WINDOWS LAUNCH SCRIPT
rem ENVIRONMENT VARIABLES TO MODIFY
set JDK_PATH="C:\Program Files\Java\jdk1.6.0_01"
set WEKA="F:\Personality-Recognition-in-SD-master\apps\weka-3-4\weka.jar"
rem ----------------------------------
set COMMONS_CLI="lib\commons-cli-1.0.jar"
set JMRC="lib\jmrc.jar"
set LIBS=%WEKA%;%COMMONS_CLI%;%JMRC%;%CD%;bin\
%JDK_PATH%\bin\java -Xmx512m -classpath %LIBS% recognizer.PersonalityRecognizer %1 %2 %3 %4 %5 %6 %7 %8 %9