Is there a way to force Eclipse to open in the default perspective?

前端 未结 3 1759
無奈伤痛
無奈伤痛 2021-01-02 15:11

Problem:

Whenever I start Eclipse (3.5.2 Galileo) it always opens in the previous perspective I was using. I want it to ALWAYS open in the default perspective, but

相关标签:
3条回答
  • 2021-01-02 15:50

    If you can find out what that perspective's ID is, you can force Eclipse to reopen with it using the -perspective command line switch (followed by that ID).

    0 讨论(0)
  • 2021-01-02 16:10

    There is no setting in the preferences dialog to do that. However, as a hack you can find the last perspective attribute stored in the file: workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml. It's an XML file, and the attribute you want to freeze is: <perspectives activePerspective="...">.

    You can use a simple script to alter that setting before running Eclipse.

    0 讨论(0)
  • 2021-01-02 16:14

    Run this script before running eclipse:

    perl -p0777i.bak -e "s/activePerspective=\"[^\"]*\"/activePerspective=\"org.eclipse.jst.j2ee.J2EEPerspective\"/g" ~/workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
    
    0 讨论(0)
提交回复
热议问题