I'm attempting to store some data in pastebin by editing a specific post with Java. I have looked at some Pastebin api for java like JPastebin but I can't find any of the api that can edit a pastebin post, is there anyway that you can edit a pastebin post with Java?
Looking at their official Developers API page, it doesn't look like editing is available via API.
Other posts also seem to confirm this, e.g. a recent one:
On the other hand, looking at this:
there's an edit method. You can see the source here (it's Javascript, not Java, but you should be able to manage):
Glancing through it, it looks like it's loading a paste to get its current contents, then submitting it again with the same values overridden by the newly supplied ones.
In other words, there doesn't seem to be an official API support for this, but you can try the unofficial way from the better-pastebin. Of course, since it's not an official API, it's not guaranteed to stay the same or even available in the future.
If you can use other services, Gists allow editing: