[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Confused with Refresh, Project->Clean, Run ...

"www" <www@xxxxxxxxxx> wrote in message 
news:ep7t48$j1u$1@xxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I am still not clear about several concepts. (I am using Eclipse on 
> Linux.)
>
> (1)Say, I have a Eclipse workspace, Test_Workspace. If I have moved a java 
> file, Test.java to /home/Test_Workspace/src/. I need to use Refresh. 
> Correct?

That's correct.  Whenever you make changes to the filesystem from "outside" 
of Eclipse, in order for Eclipse to find out about it you need to Refresh. 
Otherwise Eclipse won't know about the new file.

Of course, if you create or move the file by using Eclipse commands, then 
Eclipse knows about it automatically and Refresh is not necessary.


> (2)If I have modified Test.java file, I need to use Run->Run As->Java 
> Application. Correct?
>
> Usually, there is a compiling step (javac Test.java) and running step 
> (java Test). I am not clear the above procedure is doing both(javac 
> Test.java and java Test) or is just doing java Test

If you have Project -> Build Automatically turned on, then whenever you save 
a file or do something similar (like moving a file from outside and 
Refreshing), a build will automatically take place.  This build uses the 
Eclipse internal compiler, not javac, but the end result is the same.

If you have Build Automatically turned off, then you need to build by hand, 
by choosing the Project -> Build command.


> (3)There is a green arrow button just below menu bar. What does it mean by 
> clicking it? If I have modified Test.java, I can NOT just click the green 
> arrow button, because it does not recompile Test.java and will not show 
> the effect of modification, correct?

Depends whether you have Build Automatically turned on,


> (4)When I need to use Project->Clean ?

In theory, you never need to.  But sometimes incremental builds get messed 
up.  If you find bizarre things happening (for instance, it seems like the 
wrong code is getting executed), it's often good to do a Clean just in case.