Mac OS X: java -cp não funciona no shell script - Não foi possível localizar ou carregar a classe principal

0

Eu tenho um comando java que funciona bem na linha de comando e não em um shell script, pode um membro por favor avise?

Usando o MAC Sierra no prompt do terminal.

Obrigado.

Linha de comando que funciona bem diretamente no prompt de comando:

java -cp /Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/commons-codec-1.2.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/commons-collections-3.2.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/commons-httpclient-3.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/commons-lang-2.6.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/commons-logging-1.0.4.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/diffutils-1.3.0.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/fitnesse-20151230.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/htmllexer-2.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/htmlparser-2.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/jettison-1.3.2.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/json-20140107.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/junit-3.8.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/rhino-1.7R3.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/slf4j-api-1.6.6.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/smartrics-RestClient-2.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/smartrics-RestFixture-4.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/stax-api-1.0.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/velocity-1.7.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/xmlpull-1.1.3.1.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/xpp3_min-1.1.4c.jar:/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies/xstream-1.4.2.jar fitnesseMain.FitNesseMain -p 9090 -d src\main\resources -e 0 

Todos os jars no caminho de classe acima, foram definidos fazendo eco da variável $ CLASSPATH do script abaixo.

script start.sh que falha, que essencialmente tenta executar o acima:

    LIB=/Users/ramistefanidis/IdeaProjects/RestFixture/scratch/target/dependencies
for i in $LIB/*.jar; do
    CLASSPATH=$CLASSPATH:$i
done

java -cp CLASSPATH fitnesseMain.FitNesseMain -p 9090 -d src\main\resources -e 0

O erro recebido ao executar o script de shell acima:

Erro: não foi possível encontrar ou carregar a classe principal fitnesseMain.FitNesseMain

FYI: trabalhando na configuração do Fitnesse com as instruções em link

    
por Rami Del Toro 12.11.2017 / 20:21

0 respostas