2017-04-18 4 views
0

현재 프로토콜 버퍼 라이브러리를 사용하는 프로젝트에서 작업하고 있습니다.프로토콜 버퍼가있는 프로젝트에서 Java 파일을 컴파일 할 때 오류가 발생했습니다.

현재 jar 파일을 생성하려고합니다. 괜찮 으면 실행되지 않습니다. 이것이 실패, 그러나

bash: find . -iname "*.java" > sources.txt 
bash: java @sources.txt 

을, 다음과 같은 메시지 (분명히 단축) 출력합니다 : :이 방법을 통해 프로젝트 내부의 각 클래스를 컴파일 할 때 (나는 맥북 에어 사용하고 있습니다)

./protobuf/build/java/intergroup/board/Board.java:9: error: package com.google.protobuf does not exist 
    com.google.protobuf.ExtensionRegistryLite registry) { 
        ^

./protobuf/build/java/intergroup/board/Board.java:13: error: package com.google.protobuf does not exist 
    com.google.protobuf.ExtensionRegistry registry) { 
        ^

./protobuf/build/java/intergroup/board/Board.java:7769: error: package com.google.protobuf.Descriptors does not exist private static final 
com.google.protobuf.Descriptors.Descriptor 

... //Repeats a good number of times for other Protocol Buffer classes 

왜 이것이 jar 파일이 작동하지 않는 이유입니까? 그게 도움이된다면 Eclipse를 사용하고 있습니다.

답변

0

Java 파일을 bash를 사용하여 클래스 파일로 컴파일하지 마십시오. 대신 Eclipse를 사용하십시오. 이 방법을 사용하는 방법보다 길면 시간이 오래 걸리고 잘 돌아갑니다. 이것이 IDE 나 (Integrated Development Environment)를 사용하여 바스 체나 명령없이 응용 프로그램을 작성하고 컴파일하는 이유입니다.

참고 : 이전의 답변은 오늘 다시 읽은 후에 저의 이해에서 정확하지 않습니다.

다른 메모 : 왜 bash를 사용하고 있습니까?