Eclipse error … cannot be resolved to a type

前端 未结 17 1837
清歌不尽
清歌不尽 2020-11-28 08:09

I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat.

I am getting the error: com.ibm.ivj.eab.dab.DatastoreJDBC<

相关标签:
17条回答
  • 2020-11-28 08:25

    Easy Solution:
    Go to

    Project property -> java builder path -> maven -> find c3p0-0.9.5.2.jar

    and see the location where the file is stored in the local repository and go to this location and delete the repository manually.

    G

    0 讨论(0)
  • 2020-11-28 08:29
    • Right click Project > Properties
    • Java Build Path > Add Class Folder
    • Select the bin folder
    • Click ok
    • Switch Order and Export tab
    • Select the newly added bin path move UP
    • Click Apply button

    0 讨论(0)
  • 2020-11-28 08:29

    For many new users don't forget to add an asterisk (*) after your import statements if you wanna use all the classes in a package....for example

    import java.io.*;
    
    public class Learning 
    {
        public static void main(String[] args) 
        {
            BufferedInputStream sd = new BufferedInputStream(System.in);
                // no error
        }
    }
    

    ================================================================

    import java.io;
    
    public class Learning 
    {
        public static void main(String[] args) 
        {
            BufferedInputStream sd = new BufferedInputStream(System.in);
                // BufferedInputStream cannot be resolved to a type error
        }
    }
    
    0 讨论(0)
  • 2020-11-28 08:30

    To solve the error "...cannot be resolved to a type.." do the followings:

    1. Right click on the class and select "Build Path-->Exclude"
    2. Again right click on the class and select "Build Path-->Include"

    It works for me.

    0 讨论(0)
  • 2020-11-28 08:34

    There are two ways to solve the issue "cannot be resolved to a type ":

    1. For non maven project, add jars manually in a folder and add it in java build path. This would solve the compilation errors.
    2. For maven project, right click on the project and go to maven -> update project. Select all the projects where you are getting compilation errors and also check "Force update of snapshots/releases". This will update the project and fix the compilation errors.
    0 讨论(0)
  • 2020-11-28 08:35

    Also If you are using mavenised project then try to update your project by clicking Alt+F5. Or right click on the application and go to maven /update project.

    It builds all your components and resolves if any import error is there.

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