How to configure Eclipse to compile using Oracle javac 1.7.0_09?

前端 未结 2 1310
孤街浪徒
孤街浪徒 2020-12-11 04:32

I am trying to compile following piece of code:

public class DuplicateMainExample {
    public static void main(Stri         


        
相关标签:
2条回答
  • 2020-12-11 05:16

    Eclipse will never use javac. Its ability to do dynamic highlighting is intimately connected with its own compiler, which has special abilities to operate incrementally.

    If you want an IDE that uses javac, you might investigate intellij.

    0 讨论(0)
  • 2020-12-11 05:25

    Simply because you have declared the same method with exactly the same signature twice ... Only one main method for class should be declared .

    Eclipse have embedded its own compiler and in the case of two main methods it gets the last one, the eclipse compiler and the javac compiler are two different compilers ...

    Take a look at this older post for more information ...

    If you want to compile with javac you could try using the ant javac adapter from within eclipse ... However i think that ECJ is even better than javac(my opinion) ...

    0 讨论(0)
提交回复
热议问题