Autoboxing can't convert an int to an Integer

java

Solution

You need to have your language level set to at least 1.5/5.0 to take advantage of autoboxing/unboxing.

Change your settings in `Project --> Properties --> Java Compiler`, chances are, it's not set to the right level.

Note this is NOT directly tied to the version of the JDK you're using, it simply means the level in which your java code will be interpreted as if it were no higher than the language level version, using any particular version of the JDK that is at least at or higher than the given language level setting.

IE: you're using JDK 1.8+, setting your language level to 5.0 means you will only be able to use java features that are up to JDK 1.5.

Problem

I am a complete beginner and I'm trying to learn java. I read about the concept of `Autoboxing` and `Unboxing` here. I am working on java version 1.8.0_05 and using Eclipse. The code is : ``` class Test { public static void main(String[] args) { Integer iob = 100; // shows error -> Type mismatch: Cannot convert from int to Integer } } ``` Thanks for the help.

Original source