开发者

ClassNotFoundException while Running Java Application

I am getting a ClassNotFOu开发者_StackOverflow社区ndException while running a code.I am using Eclipse. Although it has main method with proper arguments it is still not able to launch the code. Package name and import is also correct.

public class TestNew {

    public static void main(String[] args)
    {
        ArrayList<String> sumList=new ArrayList<String>();

        Cm cm=new Cm();
        sumList=cm.sumListCombo();
        for(int i=0;i<=sumList.size();i++)
        {
            System.out.println(sumList.get(i));
        }

    }
}

Import of respective packages are done.


Try refreshing the Project, then clean it and build it. If there is no problems, your code will work. If there is a problem, it will be some kind of 'Organize Imports' issue. Ctrl+Shift+o and you are ready.


Try Ctrl + Shift + O if you're on windows.

This organizes your imports(adds missing ones and removes unnecessary ones).

Then on the menu bar, Project >> Clean...

Then re-launch your app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜