title: How to use C++ or Java Console Application to operate my Cloud Firestore project?
body: <p>I use Cloud Firestore to store data for my Android application, then I want to make a supporting tool to operate my Cloud Firestore project easily.(It is too hard and bore for me and my fingers to add more 100 datas in a constant format to Cloud Firestrore by Webpage GUI.)</p>
  <p>Therefore, I want to make a support tool to</p>
  <ol>
  <li>read CSV file(I know how to do this in C++ or Java)</li>
  <li>connect to my Cloud Firestore project</li>
  <li>operate(add or erase) data deriving from CSV file.</li>
  </ol>
  <p>I read Google Official start up guide &quot;Get started with Cloud Firestore&quot;(<a href="https://firebase.google.com/docs/firestore/quickstart#java_1" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/quickstart#java_1</a>), and did following things.</p>
  <ol>
  <li>install gradle</li>
  <li>Set <strong>User</strong> environment variable in following sentence.(the location is the secret json file made by Cloud Firestore Service Account.)</li>
  </ol>
  <pre><code>GOOGLE_APPLICATION_CREDENTIALS=&quot;C:\Users\username\Downloads\service-account-file.json&quot;
  </code></pre>
  <ol start="3">
  <li>write &quot;build.gradle&quot; as following sentence.</li>
  </ol>
  <pre><code>    apply plugin: 'java'
      apply plugin: 'application'
  
      mainClassName = 'Main'
  
      repositories {
          mavenCentral()
      }
  
      dependencies {
          implementation 'com.google.firebase:firebase-admin:6.11.0'
          implementation 'com.google.firebase:firebase-firestore:21.2.1'
      }
  </code></pre>
  <ol start="4">
  <li>write following java file.</li>
  </ol>
  <pre><code>import com.google.auth.oauth2.GoogleCredentials;
  import com.google.cloud.firestore.Firestore;
  import com.google.firebase.FirebaseApp;
  import com.google.firebase.FirebaseOptions;
  
  import java.io.*;
  //the following two package does not exist, by gradle's compiling.
  import com.google.firebase.cloud.*;
  import com.google.firebase.firestore.*;
  
  public class Main {
      public static void main(String args[]) {
  
          try {
              FirebaseOptions options = new FirebaseOptions.Builder()
                      .setCredentials(GoogleCredentials.getApplicationDefault())
                      .setDatabaseUrl(&quot;https://rikotenapp2020.firebaseio.com&quot;).build();
              FirebaseApp.initializeApp(options);
  
              System.out.println(&quot;no exception!&quot;);
  
              Firestore db = FirestoreClient.getFirestore();
              //from my survey, if I erase the rest code(DocumentReference...~println();})
              //I can compile it successfully.
  
              DocumentReference ref = db.collection(&quot;AppVersion&quot;).document(&quot;Android&quot;);
              ApiFuture&lt;DocumentSnapshot&gt; future = ref.get();
  
              DocumentSnapshot document = future.get();
              if (document.exists()) {
                  System.out.println(&quot;android app version is &quot; + document.getData());
              } else {
                  System.out.println(&quot;No such document!&quot;);
              }
  
          } catch (IOException e) {
              System.out.println(&quot;IOException happened!&quot;);
          }
      }
  }
  </code></pre>
  <p>I set up &quot;Firestore Admin SDK&quot;, was I wrong?
  If someone know how to resolve this, I'm very glad to get your valuable advices if you can tell me.
  This is my first question, and I'm not native English speaker.Please forgive my hard-understand question.</p>