아래 groovy에서 java 코드를 실행하려고합니다. 클래스를 제대로 가져 왔고 클래스 패스에 필요한 jar 파일을 추가했다고 생각합니다. 그러나 여전히 컴파일 오류가 발생합니다.java를 groovy로 변환
자바 코드 :
package com.tradeking;
this.class.classLoader.rootLoader.addURL(new URL("file:///C:/Program Files (x86)/Groovy/Groovy-2.4.0/lib/commons-codec-1.10.jar"))
this.class.classLoader.rootLoader.addURL(new URL("file:///C:/Program Files (x86)/Groovy/Groovy-2.4.0/lib/scribe-1.3.7.jar"))
import org.scribe.builder.*;
import org.scribe.model.*;
import org.scribe.oauth.*;
import org.scribe.builder.api.DefaultApi10a;
import org.scribe.model.Token;
public class TradeKingApi extends DefaultApi10a
{
private static final String CONSUMER_KEY = "***";
private static final String CONSUMER_SECRET = "***";
private static final String OAUTH_TOKEN = "***";
private static final String OAUTH_TOKEN_SECRET = "***";
private static final String PROTECTED_RESOURCE_URL = "https://api.tradeking.com/v1/market/ext/quotes.xml";
public static void main(String[] args)
{
OAuthService service = new ServiceBuilder()
.provider(TradeKingApi.class)
.apiKey("***")
.apiSecret("***")
.build();
Token accessToken = new Token("***", "***");
}
}
내가 위를 실행하면, 내가받을 다음과 같은 오류 :
3 compilation errors:
Abstract method 'java.lang.String getRequestTokenEndpoint()' is not implemented but a method of the same name but different return type is defined: method 'java.lang.String getRequestTokenEndpoint()'
at line: -1, column: -1
Abstract method 'java.lang.String getAuthorizationUrl(org.scribe.model.Token)' is not implemented but a method of the same name but different return type is defined: method 'java.lang.String getAuthorizationUrl(org.scribe.model.Token)'
at line: -1, column: -1
Abstract method 'java.lang.String getAccessTokenEndpoint()' is not implemented but a method of the same name but different return type is defined: method 'java.lang.String getAccessTokenEndpoint()'
at line: -1, column: -1
어떤 힌트이나 제안 주셔서 감사합니다.
_what_ 작동하지 않습니까? 오류? 흔적? ... – cfrick
위의 실행하면 다음 오류가 발생합니다 : 1 컴파일 오류 : 클래스 DefaultApi10a 줄에서 해결할 수 없습니다 : 7, 열 : 4 – user3806824
질문을 편집하고 거기에 오류 메시지를 추가하십시오. 가능한 경우 전체 추적을 제공하고 소스 코드에 주석이있는 행/열이 무엇을 의미하는지 주석을 작성하십시오. – cfrick