I’m a new user to MyEclipse (but not to Eclipse), and so I’ve followed this online tutorial provided by MyEclipse.
Since it shows a different interface, the tutorial is probably for previous version, but no problem because I managed to cope with most of the problems, except the following two:
1) I’ve followed the creation of the HelloWorld.java class and used the same package name, com.genuitec.test. Then I’ve also created the helloWorld.jsp and put in everything shown in the tutorial. However, after I’ve typed
HelloWorld hw = new HelloWorld();
the corresponding import isn’t created. No problem, I added manually this line:
<%@ page import="com.genuitec.test.HelloWorld"%>
but Eclipse underlines the import name with red line ❗ The reason (as shown in the small red box next to the vertical scrollbar) is
“The import com.genuitec.test.HelloWorld conflicts with a type defined in the same file (in file:”com.genuitec.test.HelloWorld”)”
What’s wrong???
I’ve found that if I change the line to become
<%@ page import="com.genuitec.test.*"%>
, it’s not longer underlined. Well, for this part, maybe the problem is solved!?
2) I then typed in
out.println("message = " + hw.helloWorld());
and this time, it’s helloWorld method which is underlined in red. The reason is
“The method helloWorld() is undefined for the type HelloWorld”
Despite all this, if I deploy the project to my Tomcat5, the webpage is still displayed correctly.
Could somebody tell me if I still to do some more setting or did what?