0

I have a project in eclipse which contains both a jsp file and a java class. But when I make a change in my java class, eclipse does not understand the changes in the class until I close eclipse and open it again. It is very annoying that I have to close eclipse and open it after even just adding a print statement. How can I fix this?

example, lets say i have this method :

public String m1(){
     return "Johnny";
} 

and this statement in jsp file:

<%= a.m1() &>

(I am passing jsp:useBean part of jsp our class name is a )

this prints "Johnny".Then i make change on method like this:

public String m1(){
  return "Liz";
}

after this, i build my project.But it still prints Johnny rather than Liz.When i close eclipse and reopen it this time it prints Liz.

9
  • In the menu, select: Project > Build automatically Commented Jul 24, 2014 at 8:48
  • Yeah I did this but even it builds there is no change until I close eclipse Commented Jul 24, 2014 at 8:51
  • 1
    You are invoking your web server incorrectly on your code. Add details on how you currently work. Commented Jul 24, 2014 at 9:01
  • i hope i make it clear this time Commented Jul 24, 2014 at 9:04
  • @user3783144 How are you invoking the JSP? Commented Jul 24, 2014 at 9:04

2 Answers 2

2

To get eclipse to recompile your code:

Project -> Build All

or just hit Ctrl+B

To have that happen whenever you make a change (and save it):

Project -> Build Automatically

To have eclipse notice when you make a change to a file even from outside eclipse:

Window -> Preferences -> General -> Workspace -> Refresh using native hooks or polling
Sign up to request clarification or add additional context in comments.

Comments

0

This seems to be an issue with Eclipse. Try downloading the latest Eclipse version. Before that try these things:

  • Clean Project
  • Delete meta data of workspace, create new work space and import project again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.