第一行的 jar 执行命令错误



来自此存储库

我尝试执行该命令。

./PersonalityRecognizer -i ../output_dir -d -t 2 -a ../mairesse_Apache.arff

但是我收到此错误。

C:/weka/weka-3-4/weka.jar: line 1: $'PK0304': 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,以包含您的应用程序路径。如果你使用窗口,你必须使用双/作为路径分隔符:

##################################################
# 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 包含在您克隆的存储库中(:

@echo off
rem WINDOWS LAUNCH SCRIPT
rem ENVIRONMENT VARIABLES TO MODIFY
set JDK_PATH="C:Program FilesJavajdk1.6.0_01"
set WEKA="F:Personality-Recognition-in-SD-masterappsweka-3-4weka.jar"
rem ----------------------------------
set COMMONS_CLI="libcommons-cli-1.0.jar"
set JMRC="libjmrc.jar"
set LIBS=%WEKA%;%COMMONS_CLI%;%JMRC%;%CD%;bin
%JDK_PATH%binjava -Xmx512m -classpath %LIBS% recognizer.PersonalityRecognizer %1 %2 %3 %4 %5 %6 %7 %8 %9

相关内容

  • 没有找到相关文章

最新更新