Jira REST API access from java

So i want to get json data from my jira project which has a jql selection included: https://(system).atlassian.net/rest/api/3/search?jql=project=(projectname) AND issuetype=Bug AND (priority = High OR priority = Blocker)

The probelm is, that i need to authenticate myself, to access the REST API and i don’t know how to do that in Java.
Thank you for helping me!


Which of the auth options fits your goals best? The details of how to do it in Java depend on picking one of those first.

I think OAuth or Basic Auth would fit the best!