So I'm trying to store a new book that the user enters into an external text file which includes the title of the book, the author, and the ISBN.
I have successfully achieved making a file. However, each time I rerun the program to create a new book, it says the file already exists. How can I make the program add to the existing file? Or should I just make it make a new file each time?
Thanks in advance.
public class TestMyLibrary {
    //Declare global var
    //Create a file in documents
    static File myFile=new File("/Users/adambunch/Documents/Library.rtf");
    //Create library object
    static Library lib=new Library ("400 Main St.");
    //Scanner to read from the file
    static Scanner input=new Scanner(System.in);
    static int choice; //User inputs a choice from the keyboard
    //Main method
        public static void main(String[] args) throws FileNotFoundException {
            //3 ways to Create books and add them to the Library
            //First way
            Book book1=new Book("The Lord of the Rings", "Sally Smith", 12345);
            lib.addBook(book1);
            //Second way
            lib.addBook(new Book("Harry Potter", "Sara Ahmed", 62347288));
            lib.addBook(new Book("Homes", "Sara Ahmed", 623743227));
            //Third way
            System.out.println("Enter the title of the book");
            String til=input.next();
            System.out.println("Enter the name of the author");
            String auth=input.next();
            System.out.println("Enter the ISBN of the book");
            int isbn=input.nextInt();
            lib.addBook(new Book(til,auth,isbn));
            //Add information into the file /Users/adambunch/Documents
            writeFile(myFile);
            readFile(myFile);
            //Borrow book "The Lord of the Rings"
            lib.borrowBook("The lord of the rings");
            //Create a menu
            System.out.println(">########################################################################");
            System.out.println("> Choose one of the options below by typing the corresponding number:");
            System.out.println(">====================================================================");
            System.out.println("1- Check library");
            System.out.println("2- Return book to the Library.");
            System.out.println("3- Borrow a book");
            System.out.println(">########################################################################");
            System.out.println(">Enter your option here: ");
            choice=input.nextInt(); //User inputs a choice
                if (choice==1){     
                    System.out.println(lib.getBookList());
                }
                if (choice==2){
                    System.out.print("Enter book title to return");
                    String til1r=input.next();
                    lib.returnBook(til1r);
                }
                if (choice==3){
                    System.out.print("Enter book title to borrow");
                    String til1r=input.next();
                    lib.borrowBook(til1r);
                }
        }
                //************************************************
                //Method to write into the file
                static  void writeFile(File file)throws FileNotFoundException {
                    if (myFile.exists()){
                        System.out.println("The file already exists");
                        System.exit(0);
                    }
                    PrintWriter output=new PrintWriter(myFile);
                    output.println(lib.address);
                    for(Book book:lib.bookList)
                        output.println(book.toString());
                    output.close();
                }
                //************************************************
                //Method to read from the file
                    static void readFile(File file)throws FileNotFoundException{
                        Scanner input=new Scanner(myFile);
                        String line="";
                        while(input.hasNext()) {
                            line=line+input.nextLine()+"\n";
                        }
                        System.out.println(line);
                        input.close();
                    }
                }
 
    