2013-05-06 2 views
-1

이 대답을 읽은 후 Setting multiple jars in java classpath 저는 여전히 당황합니다. Linux와 Windows에서 실행되도록 클래스 경로를 지정할 수있는 유일한 방법이 있습니까? 예를 들어,이 2 개의 명령을 실행하고 Linux에서 '*'와일드 카드 뒤에 ':'을 넣어야하지만 Windows에서는 ';'을 사용해야합니다.Java 클래스 경로를 교차 플랫폼 방식으로 설정하십시오.

java -mx1300m -cp "*;" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "wordsAndTags,typedDependencies,penn" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz %1 

java -mx500m -cp "$scriptdir/*:" edu.stanford.nlp.parser.lexparser.LexicalizedParser \ 
-outputFormat "typedDependencies" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz $* 

감사합니다.

답변

2

그런 것은 아닙니다. 별도의 ".sh"및 ".bat"파일을 만들거나 ".jar"파일 안에 모든 프로그램 종속성을 넣고 실행 파일로 만들 수 있습니다. 호환되는 jvm을 사용하는 경우 모든 OS에서 jar 파일 만 필요합니다.

관련 문제