0

I've forked and imported project from Github using Eclipse. But I am getting red cross at a lot of places which is valid java code. Also the keyword highlighting features etc have gone as a part of this.

I've ran the application in tomcat (from within eclipse) and it seems to work fine. How can I avoid this? What am I doing wrong?

Red cross

Edit: I am able to solve the red cross issue, answer posted below. But I still can't get the syntax highlighting for Java code to work in the JSP. I've tried solutions posted in stackoverflow like opening it with the JSP Editor, which I am doing. The project is already a webproject. What more can I do to fix this?

mahacoder
  • 895
  • 3
  • 14
  • 29
  • 1
    What does the error state? – Ferrybig Feb 24 '16 at 10:03
  • The one at line 3 says, `import java.sql cannot be resolved` – mahacoder Feb 24 '16 at 10:06
  • 6
    Use code, not screenshots. This is StackOverflow, not flickr ;) – phaberest Feb 24 '16 at 10:06
  • 1
    @phaberest Haha +1 for the Flickr comment – Debosmit Ray Feb 24 '16 at 10:09
  • 3
    @phaberest I used the screenshot because I wanted to show that the problem was with eclipse and not the code. – mahacoder Feb 24 '16 at 10:10
  • Images are not indexed, that makes your question unsearchable from others who may have the same problem. Help others find a solution that others already encountered is part of our community scope – phaberest Feb 24 '16 at 10:13
  • @phaberest Doesn't the text in the question and the heading do that job? I wasn't even sure that stackoverflow was the right place to post the question – mahacoder Feb 24 '16 at 10:16
  • Have you ever searched for a solution on Google? You always write down the error/exception or a piece of your failing code. None of them in this question. SO is surely the right place, yep. Welcome, anyway! ;) – phaberest Feb 24 '16 at 11:08
  • Possible duplicate of http://stackoverflow.com/questions/16918959/import-cannot-be-resolved – phaberest Feb 24 '16 at 11:09

1 Answers1

0

This is a very silly error but since I've figured it out, I'll post the answer for others who might encounter the same. The github project I cloned had using a different version of java(1.6). So I went and changed it the version in my system 1.8, and the errors have gone.

Edit: Although the errors are gone, the syntax highlighting for the java code within the jsp is still absent.

mahacoder
  • 895
  • 3
  • 14
  • 29