cannot find symbol, java, classloader

后端 未结 2 475
执笔经年
执笔经年 2021-01-29 03:23

Currently doing a typestate project and I am having problems with importing the List class. When I try to compile the class it throws an error in command line saying cannot find

2条回答
  •  耶瑟儿~
    2021-01-29 04:18

    Your Java file is missing an import statement for java.util.List, which is why it's failing to compile.

    Unlike String and Integer, List is not in the java.lang package. You need to import java.util.List, not java.lang.List.

    If I'm understanding your scenario correctly, your other program is generating the import statements and attempting to add an import for java.lang.List, which doesn't actually exist. Interestingly, there's no import statement in your code for java.lang.List. I don't know if that's a bug in your other program or a feature! But more than likely your problem will go away if you replace your line in the .scr file with type "java.util.List" from "rt.jar" as List;

提交回复
热议问题