Add bitcoin payments to java app using BitcoinJ I need to add Bitcoin payment to my application using the BitcoinJ library, but I'm new to using Bitcoin. I have one thought To create a new address for each new user, but I don't know if this is the right approach or not. Please tell me how to implement it correctly.
(I need to determine from which user the payment was received and in what amount)
Not really for BitcoinJ, but a general approach.
You generate new address for every user you register. Store it in your DB with the userID for future reference.
Create a getAPI taking a String input. use your API endpoint and open the Bitcoin.conf file.
walletnotify=curl &lt;your API&gt;

If you want to have confirmation logic as well, you may need one more getAPI, and get the endpoint. then update your bitcoin.conf file again with following:
blocknotify=curl &lt;your Block API&gt; 

Now when user makes the deposit to the address you generated, Bitcoin node will notify your app by calling the wallet notify API. You get the transaction hash. Use that txHash and make a Post call to your daemon with RPc command:
getTransaction &lt;txHash&gt;

Now you'll have entire transaction object to find which user has made the deposit.
Free tip: Bitcoin node calls walletnotify two times:

When a transaction is added to the chain.
When that transaction receives first confirmation.

If you don't want more than one confirmation, then blockNotify is not needed.
If you want a practical example, you can check my Github repo, where I have done it. It's not based on BitcoinJ but the logic remains the same:
https://github.com/kunalbarchha/generic-wrapper-for-bitcoinforks