package com.company;
public class Main {
    public static void main(String[] args) {
        int count = 0;
        do {
            count = count + 1;
            if (count == 500000000) {
                break;
            }
            System.out.print(count);
            System.out.print("\n");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
                Thread.currentThread().interrupt();
            }
        }while(true);
    }
}
Simply want this to run in the console from jar file, not in the background
 
     
    