is it possible to get access token without these steps
System.out.println("1. Go to: " + authorizeUrl);
System.out.println("2. Click \"Allow\" (you might have to log in first)");
System.out.println("3. Copy the authorization code.");
in java
If you only need a short-lived access token for your own account, you can use the "Generate" button on the app's page on the App Console.
Otherwise, no, it's not possible to bypass the authorization page step of the app authorization flow. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.
You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.
The official Dropbox Java SDK can actually handle the refresh process for you automatically, as long as you supply the necessary credentials, e.g., as shown retrieved in the examples here.