You cannot export a backup (on-demand or automated), as documented here. What you can do however is to export your data to a SQL dump file or a CSV file, depending on your use case, and store it on Cloud Storage.
There is no Java utility to perform an export but Google exposes an API endpoint for you to trigger an export. Here's an example request using standard curl tool:
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{"exportContext":
{"fileType": "SQL",
"uri": "gs://<BUCKET_NAME>/<PATH_TO_DUMP_FILE>",
"databases": ["<DATABASE_NAME1>", "<DATABASE_NAME2>"] }}' \
-X POST \
https://www.googleapis.com/sql/v1beta4/projects/[PROJECT-ID]/instances/[INSTANCE_NAME]/export
You'll find further details about exporting data in the documentation here.