The idea compiler cannot determine the type parameter of T, and for the type variable T with the upper bound of int,java.lang.object, there is no single maximum instance, the solution

Source: Internet
Author: User

You can compile and run in Eclipse, the same code, using idea compilation will fail error: Unable to determine <t>t type parameter, no unique maximum instance for type variable T with upper bound of Int,java.lang.object

By looking up data on the web, it was mentioned that Eclipse uses JDT compilation and Ant Javac to use JDK to find several solutions:

1. Configuration using JDK compilation [0].

2. By strengthening the type conversion, you can temporarily bypass the problem and refer to [1][2].

3.[2][3] Also points out that this is a JDK1.6 version of the problem, [2] that after upgrading to the jdk1.6.0_45 version, the test packaging is not a problem, and I did not succeed, according to [3] referenced in the StackOverflow link, it was pointed out that this is a JDK bug , which was repaired in JDK1.7 [4]. The problem does not occur after using JDK1.7.

Above is the solution of Baidu;

But I switched the compiler in idea, no JDK, no error in eclipse.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.