Fun with Eclipse

Discussion in 'Java' started by Roedy Green, Jul 3, 2005.

  1. Roedy Green

    Roedy Green Guest

    my old slickedit has gradually gone south trying to deal with new Java
    1p5 syntax, so I decided to bite the bullet and try to do a project in
    Eclipse.

    The process was remarkably easy.

    Eclipse does things for you all the time in the background without
    being asked.

    Thee formatter is the most configurable I have ever seen but it won't
    do the "correct" layout I have using for years.

    I is a whole new way of working . Instead of using search replace you
    find by navigating a tree or by clicking to find definitions and
    references.

    Every time you hit save it recompiles.

    I love the way it cleans up messy Javadoc, and finds and fixes syntax
    errors with just as much anal retentiveness as it handled the code
    itself. You can configure everything. It is beautifully done so you
    instantly see the effects of what you are asking for on some sample
    code.

    It is slow to start, but I never had to wait for it once it got going.

    The downsides:
    it has its own error messages which are petty bad.
    Don't try any of the fancy stuff like global rename, method reordering
    until you have a clean compile. It can turn your code to much.
    Happily the undo works back past your save.

    Global rename actually works. It seems so effortless when you use it,
    no big deal. You change an enum constant and all code is instantly
    converted to it.


    The biggest problem I had is it hops all by itself from module to
    module and I sometime think I am working on code X when it really
    somewhat similar code Y. Further other than by deleting a file, I
    could not get it to ignore a file for a while. Not even renaming it to
    non-java extensions worked. It still tried to recompile it.

    the import filters did not work, but other than that most seems to
    work as advertised, even without reading the help.

    I miss block cuts with right mouse other than that this thing seems to
    do everything but eat.

    I am very impressed the way it can navigate imperfect code. I would
    prefer something that protected you more from screwing things up. It
    can be such a bitch when a stray { turns a class fop top level to
    nested or vice versa.


    It is fun seeing some of the ideas I promoted about years ago in my
    scid essay now realised. See http://mindprod.com/projects.html#SCID


    It does not seem to have sensible idea of priority. I will fuss about
    JavaDoc before it gets to the serious syntax errors. By default it
    should sort with the worst problem on top. Perhaps this is because by
    default javadoc testing in turned off.


    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 3, 2005
    #1
    1. Advertising

  2. Roedy Green

    IchBin Guest

    Roedy Green wrote:
    > my old slickedit has gradually gone south trying to deal with new Java
    > 1p5 syntax, so I decided to bite the bullet and try to do a project in
    > Eclipse.
    >
    > The process was remarkably easy.
    >
    > Eclipse does things for you all the time in the background without
    > being asked.
    >
    > Thee formatter is the most configurable I have ever seen but it won't
    > do the "correct" layout I have using for years.
    >
    > I is a whole new way of working . Instead of using search replace you
    > find by navigating a tree or by clicking to find definitions and
    > references.
    >
    > Every time you hit save it recompiles.
    >
    > I love the way it cleans up messy Javadoc, and finds and fixes syntax
    > errors with just as much anal retentiveness as it handled the code
    > itself. You can configure everything. It is beautifully done so you
    > instantly see the effects of what you are asking for on some sample
    > code.
    >
    > It is slow to start, but I never had to wait for it once it got going.
    >
    > The downsides:
    > it has its own error messages which are petty bad.
    > Don't try any of the fancy stuff like global rename, method reordering
    > until you have a clean compile. It can turn your code to much.
    > Happily the undo works back past your save.
    >
    > Global rename actually works. It seems so effortless when you use it,
    > no big deal. You change an enum constant and all code is instantly
    > converted to it.
    >
    >
    > The biggest problem I had is it hops all by itself from module to
    > module and I sometime think I am working on code X when it really
    > somewhat similar code Y. Further other than by deleting a file, I
    > could not get it to ignore a file for a while. Not even renaming it to
    > non-java extensions worked. It still tried to recompile it.
    >
    > the import filters did not work, but other than that most seems to
    > work as advertised, even without reading the help.
    >
    > I miss block cuts with right mouse other than that this thing seems to
    > do everything but eat.
    >
    > I am very impressed the way it can navigate imperfect code. I would
    > prefer something that protected you more from screwing things up. It
    > can be such a bitch when a stray { turns a class fop top level to
    > nested or vice versa.
    >
    >
    > It is fun seeing some of the ideas I promoted about years ago in my
    > scid essay now realised. See http://mindprod.com/projects.html#SCID
    >
    >
    > It does not seem to have sensible idea of priority. I will fuss about
    > JavaDoc before it gets to the serious syntax errors. By default it
    > should sort with the worst problem on top. Perhaps this is because by
    > default javadoc testing in turned off.
    >
    >


    Yes, Eclipse is nice. The best part are all of the free plugins that you
    can use from the eclipse tools project or the open source projects and
    plug-ins at http://www.eclipse.org/community

    There is also nice collection of plugins at

    http://www.eclipse-plugins.info/eclipse

    http://www.eclipseplugincentral.com/

    Good information at the Eclipse Wiki at http://eclipsewiki.editme.com

    Are you using the latest 3.1 version. I found that this loads much
    faster than any of the 3.1 milestones versions.

    --


    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA
    __________________________________________________________________________

    ' If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)
    IchBin, Jul 3, 2005
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    I have had some more experience with the beast and I wish I had read
    the following few paragraphs before I started. I got is so much
    trouble trying to modify Eclipse *.java files behind its back. My
    changes kept disappearing.

    Eclipse is a true SCID.

    You may have no interest in how Eclipse works under the hood, but you
    had better understand at least as much as I am about to explain. This
    means its stores your Java source code in a structured database. This
    is how it can navigate so quickly, do global renames, refactor, find
    references and declarations instantly, compile instantly and undo
    changes, etc. It does not use Javac.exe at all (except in an ant
    build). It tokenises your source as you type and uses its own
    incremental/background compiler when you hit save.

    Every time you click save at saves a conventional *.java copy of the
    class source on disk along with a corresponding compiled *.class file.
    However, if you modify one of those files, delete it, rename etc.,
    nothing happens. It is as if Eclipse were oblivious to your changes.
    The true copy of your program is inside the database. To allow other
    programs to change your source code, don't touch Eclipse's *.java
    files. They there mainly for curiosity, for backup and for CVS. In the
    case the entire Eclipse database were corrupted, you would lose
    nothing since your last save, even if you had no backup of the eclipse
    database itself.

    Instead of meddling with Eclipse's *.java files, export, fix with your
    conventional tools and editors and the import the back again.

    Import is the trickiest feature of Eclipse. Check after every import
    that your new source overrode the old and went into the correct place.
    It is so easy to mess up and effectively lose all the work you did
    outside Eclipse. If you screw up, you can compare Eclipse files with
    your exported ones, correct your copy of the files with Diffzilla, and
    reimport them. Again, there is no point in using Diffzilla to directly
    fix the Eclipse files.
    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 4, 2005
    #3
  4. Roedy Green

    Roedy Green Guest

    On Sun, 03 Jul 2005 10:41:23 -0400, IchBin <> wrote or
    quoted :

    >Are you using the latest 3.1 version. I found that this loads much
    >faster than any of the 3.1 milestones versions.


    I am using 3.1. I tend to just leave it up. If I want to do
    something else, I just leave it running.

    I played with TaskManager but it did not seem to want to tell me just
    how much real memory that was costing me.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 4, 2005
    #4
  5. Roedy Green

    Roedy Green Guest

    On Sun, 03 Jul 2005 10:41:23 -0400, IchBin <> wrote or
    quoted :

    >
    >Are you using the latest 3.1 version. I found that this loads much
    >faster than any of the 3.1 milestones versions.


    After I get more familiar with it, I will try compiling it with Jet to
    see how that speeds it up, especially the loads.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 4, 2005
    #5
  6. Roedy Green

    Chris Smith Guest

    Roedy Green <> wrote:
    > After I get more familiar with it, I will try compiling it with Jet to
    > see how that speeds it up, especially the loads.


    I'm not very familiar with Jet, but the fact that 95% of Eclipse's code
    is loaded via not only dynamic loading, but also a very heavily tweaked
    custom classloader might frustrate your attempts to get a big
    performance boost from static compilers. It's likely that practically
    the entire application will be JIT compiled anyway.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Jul 4, 2005
    #6
  7. Roedy Green wrote:
    > On Sun, 03 Jul 2005 10:41:23 -0400, IchBin <> wrote or
    > quoted :
    >
    >
    >>Are you using the latest 3.1 version. I found that this loads much
    >>faster than any of the 3.1 milestones versions.

    >
    >
    > I am using 3.1. I tend to just leave it up. If I want to do
    > something else, I just leave it running.
    >
    > I played with TaskManager but it did not seem to want to tell me just
    > how much real memory that was costing me.
    >


    To get a real feeling for memory using Windows Task Manager, you should
    add the "Virtual Memory" column to your view.

    Ray

    --
    XML is the programmer's duct tape.
    Raymond DeCampo, Jul 4, 2005
    #7
  8. Roedy Green

    Chris Smith Guest

    Raymond DeCampo <> wrote:
    > To get a real feeling for memory using Windows Task Manager, you should
    > add the "Virtual Memory" column to your view.


    As always when analyzing performance data, interpret the values with
    caution.

    Since Java is garbage collected and has a somewhat sophisticated
    collector, it can depend on the memory pressure of the system. For
    example, if Eclipse claims to be using 200MB of memory in task manager,
    that may be because the garbage collector hasn't seen a good enough
    reason to run collection recently. Modern JVM versions do release
    memory to the operating system occasionally, and that number may quickly
    shrink when memory is needed.

    A more complete process viewer can show you the working set size, which
    is generally a better indicator of the total memory "tied up" with that
    process.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Jul 4, 2005
    #8
  9. Roedy Green

    Roedy Green Guest

    On Mon, 04 Jul 2005 02:44:11 GMT, Raymond DeCampo
    <> wrote or quoted :

    >To get a real feeling for memory using Windows Task Manager, you should
    >add the "Virtual Memory" column to your view.


    I did. IT does not seem to fluctuate though if what they meant by that
    was real ram used.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 4, 2005
    #9
  10. Roedy Green

    Roedy Green Guest

    On Sun, 3 Jul 2005 20:20:37 -0600, Chris Smith <> wrote
    or quoted :

    >I'm not very familiar with Jet, but the fact that 95% of Eclipse's code
    >is loaded via not only dynamic loading, but also a very heavily tweaked
    >custom classloader might frustrate your attempts to get a big
    >performance boost from static compilers. It's likely that practically
    >the entire application will be JIT compiled anyway.


    That is no problem. If they dynamically loaded files live in the jar,
    or you make a list of them, Jet will precompile them to.

    I tried this out with my Holidays application that dynamically loads
    little classes to describe each possible holiday.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
    Roedy Green, Jul 4, 2005
    #10
  11. Roedy Green

    Guest

    Chris Smith wrote:
    > Roedy Green <> wrote:
    > > After I get more familiar with it, I will try compiling it with Jet to
    > > see how that speeds it up, especially the loads.

    >
    > I'm not very familiar with Jet, but the fact that 95% of Eclipse's code
    > is loaded via not only dynamic loading, but also a very heavily tweaked
    > custom classloader might frustrate your attempts to get a big
    > performance boost from static compilers. It's likely that practically
    > the entire application will be JIT compiled anyway.


    This is correct, but with Excelsior JET you can have the JITted classes
    cached to disk and then recompile them into one DLL (or shared object
    if you are running Linux.) This issue is discussed in details here:

    HOWTO: Compile Eclipse Platform with Excelsior JET
    http://www.excelsior-usa.com/kb/000010.html
    , Jul 4, 2005
    #11
  12. Roedy Green

    Roland Guest

    On 4-7-2005 3:47, Roedy Green wrote:

    >
    > I have had some more experience with the beast and I wish I had read
    > the following few paragraphs before I started. I got is so much
    > trouble trying to modify Eclipse *.java files behind its back. My
    > changes kept disappearing.

    [...]
    >
    > Every time you click save at saves a conventional *.java copy of the
    > class source on disk along with a corresponding compiled *.class file.
    > However, if you modify one of those files, delete it, rename etc.,
    > nothing happens. It is as if Eclipse were oblivious to your changes.

    [...]
    You can enable 'Window -> Preferences -> General -> Workspace ->
    Refresh automatically'. I've never used it, but from what I understand
    from Help, on the Windows platform file changes outside Eclipse will be
    detected automatically due to a refresh monitor based on file system
    callbacks.

    There's also 'Window -> Preferences -> General -> Startup and Shutdown
    -> Refresh workspace on startup' and you can refresh a resource (file,
    package, directory, project) yourself: using the right-click context
    menu, or F5.
    --
    Regards,

    Roland de Ruiter
    ` ___ ___
    `/__/ w_/ /__/
    / \ /_/ / \
    Roland, Jul 4, 2005
    #12
  13. Chris Smith wrote:
    > Raymond DeCampo <> wrote:
    >
    >>To get a real feeling for memory using Windows Task Manager, you should
    >>add the "Virtual Memory" column to your view.

    >
    >
    > As always when analyzing performance data, interpret the values with
    > caution.
    >
    > Since Java is garbage collected and has a somewhat sophisticated
    > collector, it can depend on the memory pressure of the system. For
    > example, if Eclipse claims to be using 200MB of memory in task manager,
    > that may be because the garbage collector hasn't seen a good enough
    > reason to run collection recently. Modern JVM versions do release
    > memory to the operating system occasionally, and that number may quickly
    > shrink when memory is needed.


    I don't see how this makes them different from any other application.
    From the OS point of view, the memory is in use, whether the JVM thinks
    it can be freed or not. More important, a request for memory from
    another process will not trigger garbage collection in the JVM to free
    up system resources.

    >
    > A more complete process viewer can show you the working set size, which
    > is generally a better indicator of the total memory "tied up" with that
    > process.
    >


    Ray

    --
    XML is the programmer's duct tape.
    Raymond DeCampo, Jul 4, 2005
    #13
  14. Roedy Green

    Chris Smith Guest

    Raymond DeCampo <> wrote:
    > I don't see how this makes them different from any other application.
    > From the OS point of view, the memory is in use, whether the JVM thinks
    > it can be freed or not. More important, a request for memory from
    > another process will not trigger garbage collection in the JVM to free
    > up system resources.


    Yes, it's a bit more complex than I'd originally said, but it does make
    a difference. There are actually two ways.

    First, IIRC the garbage collector actually does pay attention to memory
    pressure in the system when deciding whether to release memory to the
    operating system during collection, Don't hold me to that; it's a
    distant memory from investigating the workings back when the memory
    release was first added several years ago. I don't recall the source.

    Second, the operating system has its own ways to deal with a ballooning
    process -- by swapping it out -- and the garbage collector *definitely*
    pays attention to RAM locality when running, so that it will tend to run
    more often and compact heap space more aggressively if the process is
    seeing an unusually high number of page faults.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Jul 4, 2005
    #14
  15. Chris Smith wrote:
    > Raymond DeCampo <> wrote:
    >
    >>I don't see how this makes them different from any other application.
    >> From the OS point of view, the memory is in use, whether the JVM thinks
    >>it can be freed or not. More important, a request for memory from
    >>another process will not trigger garbage collection in the JVM to free
    >>up system resources.

    >
    >
    > Yes, it's a bit more complex than I'd originally said, but it does make
    > a difference. There are actually two ways.
    >
    > First, IIRC the garbage collector actually does pay attention to memory
    > pressure in the system when deciding whether to release memory to the
    > operating system during collection, Don't hold me to that; it's a
    > distant memory from investigating the workings back when the memory
    > release was first added several years ago. I don't recall the source.
    >
    > Second, the operating system has its own ways to deal with a ballooning
    > process -- by swapping it out -- and the garbage collector *definitely*
    > pays attention to RAM locality when running, so that it will tend to run
    > more often and compact heap space more aggressively if the process is
    > seeing an unusually high number of page faults.
    >


    Swapping a process out is irrelevant here. It does not matter if the
    process is in physical memory or not for it to use the OS memory
    resources. E.g., the Windows page file is capped at a particular
    (configurable) size. So a process eating virtual memory does effect the
    entire system.

    As to your first comment, without a source or reference it is just
    speculation. It may very well be true, but I would like to see
    something document before I would repeat it.

    Ray

    --
    XML is the programmer's duct tape.
    Raymond DeCampo, Jul 4, 2005
    #15
  16. Roedy Green

    Chris Smith Guest

    Raymond DeCampo <> wrote:
    > Swapping a process out is irrelevant here. It does not matter if the
    > process is in physical memory or not for it to use the OS memory
    > resources. E.g., the Windows page file is capped at a particular
    > (configurable) size. So a process eating virtual memory does effect the
    > entire system.


    Ah, I see where we're disagreeing now.

    I'd venture a guess that on general-purpose desktop systems (as opposed
    to specialized embedded or dedicated computer systems) there are *far*
    more commonly problems with a process's optimal working set not fitting
    into RAM (result: lots of disk access and bad performance) than with
    running out of page file (result: processes being killed by the OS
    and/or actual failures and error messages). In fact, I'd guess that the
    vast majority of people have not even seen the latter problem for at
    least several years. I wouldn't worry about running out of virtual
    memory.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Jul 5, 2005
    #16
  17. Roedy Green

    Tim Tyler Guest

    Roland <> wrote or quoted:
    > On 4-7-2005 3:47, Roedy Green wrote:


    > > I have had some more experience with the beast and I wish I had read
    > > the following few paragraphs before I started. I got is so much
    > > trouble trying to modify Eclipse *.java files behind its back. My
    > > changes kept disappearing.

    > [...]
    > >
    > > Every time you click save at saves a conventional *.java copy of the
    > > class source on disk along with a corresponding compiled *.class file.
    > > However, if you modify one of those files, delete it, rename etc.,
    > > nothing happens. It is as if Eclipse were oblivious to your changes.

    > [...]
    >
    > You can enable 'Window -> Preferences -> General -> Workspace ->
    > Refresh automatically'. I've never used it, but from what I understand
    > from Help, on the Windows platform file changes outside Eclipse will be
    > detected automatically due to a refresh monitor based on file system
    > callbacks.
    >
    > There's also 'Window -> Preferences -> General -> Startup and Shutdown
    > -> Refresh workspace on startup' and you can refresh a resource (file,
    > package, directory, project) yourself: using the right-click context
    > menu, or F5.


    Seconded.

    If you change a file outside Eclipse, you typically need to "Refresh" it -
    or one of its parents - in Eclipse, by chossing the "Refresh" option from
    Eclipse's context menu.

    Eclipse's default configuration is still a bit puzzling for me -
    it ships with many of the syntax colouring categories disabled,
    and doesn't use the "Package Explorer" by default - both highly
    questionable decisions IMO.
    --
    __________
    |im |yler http://timtyler.org/ Remove lock to reply.
    Tim Tyler, Jul 9, 2005
    #17
  18. Roedy Green

    Tim Tyler Guest

    Roedy Green <> wrote or quoted:

    > The downsides:
    > it has its own error messages which are petty bad.


    IMO, Eclipse's compiler knocks spots off every other Java compiler
    I've ever seen.

    One of the the best things is that it *actually* knows which class
    files need recompiling to leave your project in a consitent state.

    Also it has a number of built-in lint like tools - so even before
    you have installed Checkstyle in Eclipse, it produces much more
    helpful output than most other IDEs can manage.

    > Global rename actually works. It seems so effortless when you use it,
    > no big deal. You change an enum constant and all code is instantly
    > converted to it.


    ....and that's just the tip of the huge Eclipse refacoring iceberg:

    Highlight a block of code and choose "Refactor->extract method" - and
    watch as Eclipse figures out what return type you need, and all the
    relevant method parameters and their names - and basically does
    everything for you.

    ....or highlight an expression and turn it into a local variable -
    and watch as Eclipse finds all the equivalent occurrences of that
    expression in scope and converts them to the new variable automatically.
    --
    __________
    |im |yler http://timtyler.org/ Remove lock to reply.
    Tim Tyler, Jul 9, 2005
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Fish
    Replies:
    65
    Views:
    1,697
    Mabden
    May 18, 2004
  2. javaguy44
    Replies:
    1
    Views:
    991
  3. John Bailo

    Fun With Eclipse and Smart Clients

    John Bailo, Aug 31, 2005, in forum: Java
    Replies:
    1
    Views:
    411
    Andrew Thompson
    Aug 31, 2005
  4. dolphin
    Replies:
    4
    Views:
    312
    Jorgen Grahn
    Aug 25, 2007
  5. er
    Replies:
    2
    Views:
    485
Loading...

Share This Page