<p>Since Litecoin is a fork of bitcoin you can use <code>JavaBitcoindRpcClient</code> to connect with litecoin client and execute API calls.</p>

<p>link:<a href="https://github.com/Polve/JavaBitcoindRpcClient" rel="nofollow noreferrer">https://github.com/Polve/JavaBitcoindRpcClient</a></p>

<p>To connect with client, you can use below code :</p>

<pre><code>String user = "RPC_USER_NAME";
String password = "RPC_PASSWORD";
String host = "127.0.0.1";
String port = "PORT";

try {
    URL url = new URL("http://" + user + ':' + password + "@" + host + ":" + port + "/");

    BitcoinJSONRPCClient bitcoinClient = new BitcoinJSONRPCClient(url);
    System.out.println(bitcoinClient.getInfo());
} catch (MalformedURLException e) {
    e.printStackTrace();
}
</code></pre>

CC BY-SA 3.0
2017-12-12T09:18:49.920Z
Thank you @AjitSoman . I have went through it earlier but not able to find any example for using it,It will helpful if you can provide few reference for the example.
Aman Vyas
CC BY-SA 3.0
2017-12-12T09:46:21.397Z
I have added connection code
Ajit Soman
CC BY-SA 3.0
2017-12-12T07:30:49.237Z
2017-12-12T09:46:07.463Z
2017-12-12T09:46:07.463Z
Ajit Soman
<p>In my implementation the java URL cannot be built with the structure <a href="http://username:pass@server:port" rel="nofollow noreferrer">http://username:pass@server:port</a></p>

CC BY-SA 4.0
2019-10-21T22:16:42.183Z
2019-10-21T22:16:42.183Z
Victor Manuel Matus Garcia
<p>I am looking for Java Json-Rpc for Litecoin or any implementation for Litecoin</p>

<bitcoind><json-rpc><litecoin><java><litecoin-qt>
JAVA JSON-RPC for Litecoin
Aman Vyas
# JAVA JSON-RPC for Litecoin

(Asked by: username_0 on 2017-12-12)

I am looking for Java Json-Rpc for Litecoin or any implementation for Litecoin

**Tags:** bitcoind, json-rpc, litecoin, java, litecoin-qt


---

## 2 answers

### Answer by username_1 on 2017-12-12. Score: 2 | Accepted answer

Since Litecoin is a fork of bitcoin you can use JavaBitcoindRpcClient to connect with litecoin client and execute API calls.
link:https://github.com/Polve/JavaBitcoindRpcClient
To connect with client, you can use below code :
String user = "RPC_USER_NAME";
String password = "RPC_PASSWORD";
String host = "127.0.0.1";
String port = "PORT";

try {
    URL url = new URL("http://" + user + ':' + password + "@" + host + ":" + port + "/");

    BitcoinJSONRPCClient bitcoinClient = new BitcoinJSONRPCClient(url);
    System.out.println(bitcoinClient.getInfo());
} catch (MalformedURLException e) {
    e.printStackTrace();
}

> **Comments:**
> **username_0**: Thank you @AjitSoman . I have went through it earlier but not able to find any example for using it,It will helpful if you can provide few reference for the example.  
> **username_1**: I have added connection code  

---

### Answer by username_2 on 2019-10-21. Score: 0

In my implementation the java URL cannot be built with the structure <http://username:pass@server:port>


---

