I installed eclipse on Ubuntu 16.04 but this code
public class WhileCounter
{
public static void main ( String [] args)
{
int counter = 1;
while (counter <= 10)
{
System.out.printf("%d", counter);
++counter;
}
System.out.println();
}
}
I'm getting this error
The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, int)
and a warning
Build path specifies execution environment OSGi/Minimum-1.2. There are no JREs installed in the workspace that are strictly compatible with this environment.
So I remove open jdk by this command
sudo apt-get purge openjdk-\*
and use this to install oracle jdk
apt-get install oracle-java8-installer
but the problem still exist.