title: connecting to firestore emulator from java admin sdk
body: <p>I am trying to connect to firestore emulator from inside my java application, without much success.</p>
  <pre><code>FirebaseOptions options = FirebaseOptions.builder()
              .setCredentials(GoogleCredentials.getApplicationDefault())
              .setDatabaseUrl(&quot;localhost:8082&quot;)
  
              .setProjectId(&quot;xxx&quot;)
              .build();
      var app = FirebaseApp.initializeApp(options);
  
      Firestore db = FirestoreClient.getFirestore(app);
      final ApiFuture&lt;WriteResult&gt; update = db.collection(&quot;users&quot;).document().set(Map.of(&quot;test&quot;, &quot;mest&quot;));
      try {
          final WriteResult writeResult = update.get();
      } catch (InterruptedException | ExecutionException e) {
          e.printStackTrace();
      }
  </code></pre>
  <p>This simply tries to connect to firebase, disregarding the database url.</p>
  <p>I looked at the node sdk, which has a <code>emulator</code> method and database settings, but they don't exist on Java side.</p>