Fibonacci generating algorithm
Advice 1

One very useful principle is that each method should solve only one problem and not more. In this context, I suggest that you roll a static method that simply computes a desired Fibonacci sequence and returns it as an array/list. Then, another method can call the previous and output the numbers.

Advice 2

Instead of closing a Scanner explicitly, you could use a try with resources. Any Autocloseable can do and will be closed implicitly.

try(Scanner scanner = new Scanner(System.in)) {
    // Use scanner here.
}
// Scanner automatically closed here.


The above will close Scanner when exiting the block, or in the case of exception.

Advice 3

Fibonacci sequence grows exponentially. For that reason you might want to use BigInteger.

Summa summarum

An alternative implementation may look like this:

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class FibonacciGenerator {

    public static BigInteger[] getFibonacciSequencePrefix(int n) {
        BigInteger[] result = new BigInteger[n];

        BigInteger a = BigInteger.ONE;
        BigInteger b = BigInteger.ONE;

        for (int i = 0; i &lt; n; ++i) {
            result[i] = a;
            BigInteger tmp = a;
            a = b;
            b = b.add(tmp);
        }

        return result;
    }

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int n = scanner.nextInt();
            System.out.println(Arrays.toString(getFibonacciSequencePrefix(n)));
        }
    }
}