My JSON file resides in the projects root folder, I have correctly set up the dependencies and now I'm trying to add the JSON file Using the instructions as provided by Firebse themselves here.
Here is the code from my main java file:
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.auth.FirebaseCredentials;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.management.RuntimeMXBean;
import java.io.*;
import java.net.*;
import java.util.*;
import java.io.LineNumberReader;
import java.lang.management.ManagementFactory;
import com.sun.management.OperatingSystemMXBean;
import java.lang.management.ManagementFactory;
import java.util.Random;
public class Climate {
public static void main(String [] args){
FileInputStream serviceAccount = new FileInputStream("serviceAccountKey.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
.setDatabaseUrl("https://*retracted*.firebaseio.com/")
.build();
FirebaseApp.initializeApp(options);
}
}
this is how it look in the IDE
and this is the message under next to it:
It says file not found but the file is there i assure you, am I being really dumb here, please excuse my incompetence I'm new to firebase... any help would be much appreciated.