Simple Java application error: Picked up _JAVA_OPTIONS: -Xmx4096m

Asked

Viewed 2,326 times

3

I’m taking a Java course and I went to solve a simple exercise where I should read two whole numbers from the keyboard and show the sum of them. But in the console I get the error Picked up _JAVA_OPTIONS: -Xmx4096m after the program shows the sum of the numbers. I believe it is not a code error, it may be some Java configuration error?

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int a, b;

        System.out.printf("Digite um valor inteiro: ");
        a = sc.nextInt();

        System.out.printf("%nDigite outro valor inteiro: ");
        b = sc.nextInt();

        a = a + b;

        System.out.printf("%nA soma dos valores digitados: %d", a);

        sc.close();
    }

}

On the console appears the following:

Console

  • I realized that this appears at the end of every program I do, does not interfere with the functioning but I wanted to know the reason.

1 answer

1

You probably have an environment variable configured with this name "_JAVA_OPTIONS" and its content is "-Xmx4069m", by default java recognizing that the OS has an environment variable with that name makes use of it, this "error" actually it’s just an indication of your java that it’s "catching" this setting.

To remove this simply delete the "_JAVA_OPTIONS" variable from your windows environment variables. As its configuration is quite simple, it will not affect the functioning of your java remove the variable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.