Append an L to the value to define an integer of type long.
public class MainClass { public static void main(String[] a){ long longValue = 123456789L; System.out.println(longValue); } }
123456789