pages tagged eclipse http://meng6net.localhost/tag/eclipse/ <p><small>Copyright © 2005-2020 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Mon, 26 Oct 2020 18:12:13 +0000 Installing CheckStyle plugin for Eclipse http://meng6net.localhost/blog/Installing_CheckStyle_plugin_for_Eclipse/ http://meng6net.localhost/blog/Installing_CheckStyle_plugin_for_Eclipse/ eclipse java syntax tool Tue, 16 May 2017 23:59:39 +0000 2018-10-13T03:27:57Z <p>I recently discovered a tool for checking Java code formatting and other coding style related issues -- <a href= "http://checkstyle.sourceforge.net/">CheckStyle</a>. It features <a href="http://checkstyle.sourceforge.net/availablechecks.html">a list of style checks</a> such as</p> <blockquote> <p>...<br /> * Restricts nested boolean operators (&amp;&amp;, ||, &amp;, | and ^) to a specified depth (default = 3).<br /> * Checks for empty blocks.<br /> * Checks for long source files.<br /> ...</p> </blockquote> <p>There's also an Eclipse plugin for it: https://checkstyle.org/eclipse-cs/#!/. The Eclispe update URL is http://eclipse-cs.sf.net/update/. As of at least Eclipse 4.8.0 (Aug., 2018), this update URL no longer works.</p> <p>There is a caveat at the time I install it:</p> <p>the plugin's homepage http://eclipse-cs.sourceforge.net/ gives http://sevntu-checkstyle.github.com/sevntu.checkstyle/update-site/ as the installation URL, but it does not work. However on http://eclipse-cs.sourceforge.net/downloads.html a different installation URL http://eclipse-cs.sf.net/update/ is given, which turns out to work correctly. It seems someone has not updated the Web pages consistently. And it has certainly confused some: http://stackoverflow.com/questions/11865025/error-while-installing-check-style-plugin-for-eclipse.</p> /blog/Installing_CheckStyle_plugin_for_Eclipse/#comments Wolfram Language (Mathematica) package structure http://meng6net.localhost/journal/Wolfram_Language_Mathematica_package_structure/ http://meng6net.localhost/journal/Wolfram_Language_Mathematica_package_structure/ Eclipse IDE IntelliJ IDEA Mathematica Wolfram Language computing note project Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <p>When creating a package in Wolfram Language (Mathematica), the typical structure looks like the following:</p> <p><code>path/to/MyPackage/</code>:</p> <pre><code>. ├── Documentation │ └── English │ ├── Guides │ │ └── MyPackage.nb │ ├── ReferencePages │ │ └── Symbols │ │ ├─── MySymbol1.nb │ │ └─── MySymbol2.nb │ └── Tutorials | ├── MyTutorial1.nb │ └── MyTutorial2.nb ├── FrontEnd │ ├── Palettes │ │ ├── MyPalette1.nb │ │ └── MyPalette2.nb │ └── SystemResources │ └── Bitmaps │ └── MyPackage │ ├── XXX.png │ └── YYY.png ├── Kernel │ ├── MyPackageFile1.wl │ ├── MyPackageFile2.wl │ ├── MyPackage.wl │ └── init.m ├── PacletInfo.m └── PacletInfoTemplate.m </code></pre> Examples of using Eclipse http://meng6net.localhost/computing/example/examples_of_using_eclipse/ http://meng6net.localhost/computing/example/examples_of_using_eclipse/ computing documentation eclipse example note software Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Uninstalling plug-in</h2> <p>Preferences → Install/Update → Uninstall or update software that is already installed → select some plug-ins → click Uninstall</p> <h2>Move a project's directory</h2> <p>Suppose you have a project 'project1' which is at path <code>/home/XXX/workspace/project1/</code> and you want to move it to <code>/home/XXX/workspace/group/project1/</code>.</p> <p>In order to avoid destroying the metadata of the project such as working sets and .project file, use the refactor function in the menu rather than deleting and recreating the project.</p> <ol> <li>Create the directory <code>/home/XXX/workspace/group/</code>.</li> <li>Use menu Windows &gt; Views &gt; Other &gt; Navigator.</li> <li>Right click on the project of interest in the Navigator view.</li> <li>Choose refactor &gt; move, and select the new path <code>/home/XXX/workspace/group/</code>, and click OK.</li> </ol> <h2>Change a CVS repository to use 'ext' connection method</h2> <p>By default a CVS repostiory created in Eclipse uses a non-standard connection method 'extssh'. To change an existing project to use 'ext' connection method,</p> <ol> <li> <p>Window &gt; Open Perspective &gt; CVS Repository Exploring &gt; add a CVS repository with same setup as the 'extssh' repository but this time specify 'ext' as connection method.</p> </li> <li> <p>Preferences &gt; Team &gt; CVS &gt; Ext Connection Method &gt; check 'Use another connection method type to connect', choose 'connection type' as 'extssh'.</p> </li> <li> <p>Open Window &gt; View &gt; Navigator, in the Navigator view, right click on the interested project, go to menu Properties &gt; CVS &gt; Change Sharing &gt; choose the CVS repository with 'ext' connection method.</p> </li> </ol> <h2>Using the same physical directory as projects in different workspaces</h2> <ul> <li>Git clone (or CVS check out) a version controlled project to a centralized location on one's computer.</li> <li>In each Eclipse workspace that you need the repository or project, use the menu "File &gt; Import... General: Existing Projects in Workspace" to import the repository, but point it to the directory prepared in the last step. Make sure the "copy projects into workspace" checkbox is <em>unchecked</em>.</li> </ul> <h2>Notes</h2> <h2>See also</h2> <h2>References</h2> <h2>External links</h2> Installing and configuring Eclipse http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_eclipse/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_eclipse/ computing configuration documentation eclipse installation note plugin software tool Tue, 16 May 2017 23:59:39 +0000 2020-10-26T18:12:13Z <p>Last verification: 2020-10-26, macOS version 10.14.6, Eclipse version 2020-09 (4.17.0).</p> <h2>eclipse.ini</h2> <h3>Memory size</h3> <p>On macOS, the configuration file</p> <pre><code> ../Eclipse.app/Contents/MacOS/eclipse.ini </code></pre> <p>or for Eclipse 4.5 and later:</p> <pre><code> ../Eclipse.app/Contents/Eclipse/eclipse.ini </code></pre> <p>has</p> <pre><code>-startup ../../../plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar --launcher.library ../../../plugins/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731 -showsplash org.eclipse.platform -vmargs -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Xms1024m -Xmx1536m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+UseParallelGC -Dorg.eclipse.swt.internal.carbon.smallFonts </code></pre> <ul> <li><code>Xms</code> and <code>Xmx</code> are the starting and maximum heap size for JVM running Eclipse, respectively. Heap stores objects, so anything that create large number of objects will require large value for <code>Xmx</code></li> <li><code>PermSize</code> and <code>MaxPermSize</code> are for memory storing classes (data structures, not object instances) so they normally don't need to be large[<sup id="fnref:1"><a href= "http://meng6net.localhost/tag/eclipse/#fn:1" rel="footnote">1</a></sup>].</li> <li><code>-Xss2m</code> sets the Java stack size to 2MB; If it requires very deep level of recursion and can have large inputs, a stack size too small may cause <code>java.lang.StackOverflowError</code></li> <li><code>-XX:+UseParallelGC</code> enables the <em>parallel garbage collector</em>[<sup id="fnref:2"><a href="http://meng6net.localhost/tag/eclipse/#fn:2" rel= "footnote">2</a></sup>].</li> </ul> <h3><code>-Dorg.eclipse.swt.internal.carbon.smallFonts</code></h3> <p>On high-resolution displays, removing</p> <pre><code>-Dorg.eclipse.swt.internal.carbon.smallFonts </code></pre> <p>is said to make the font size larger for some GUI elements. But I couldn't notice any difference.</p> <p>References:</p> <ul> <li> http://apple.stackexchange.com/questions/24621/how-do-increase-font-size-of-eclipse-globally</li> </ul> <h2>Preferences</h2> <p>Note preferences are workspace specific and you can export, save, and import preferences metadata using menu File ⟶ Export ⟶ Preferences [<sup id="fnref:3"><a href="http://meng6net.localhost/tag/eclipse/#fn:3" rel= "footnote">3</a></sup>].</p> <ul> <li> <p>Preferences ⟶ General ⟶ Compare/Patch ⟶ enable "Ignore white space"</p> </li> <li> <p>Preferences ⟶ General ⟶ Keys ⟶ Scheme:Emacs</p> </li> <li> <p>Preferences ⟶ General ⟶ Network Connections</p> <ul> <li>⟶ SSH2: add private keys</li> </ul> </li> <li> <p>Preferences ⟶ General ⟶ Editors</p> <ul> <li>Check "Allow in-place system editors".</li> <li>Size of recently opened files list: 20 (the maximum)</li> <li>⟶ Text Editors: <ul> <li>Uncheck "Enable spell checking" to help speeding up text editor.</li> <li>Check "Show print margin".</li> <li>Check "Insert spaces for tabs".</li> <li>Check "Show whitespace characters".</li> </ul> </li> <li>⟶ AnyEdit Tools: <ul> <li>Convert: Tab width/number of spaces for tab: 4</li> </ul> </li> </ul> </li> <li> <p>Preferences ⟶ General ⟶ Appearance</p> <ul> <li>⟶ Theme: Dark</li> <li> <p>If the "Darkest Dark Theme with DevStyle" plug-in is installed</p> <ul> <li>⟶ Theme: DevStyle Theme</li> <li>⟶ DevStyle ⟶ Color Themes <ul> <li>Workbench theme: Dark Gray (Darkest Dark)</li> <li>Icon colors: Pastels</li> <li>Editor theme: Solarized Dark</li> <li>check "Theme background"</li> <li>check "Enable breadcrumb"</li> </ul> </li> </ul> </li> <li> <p>⟶ Colors and Fonts ⟶</p> </li> <li> <p>⟶ Basic ⟶ Text Font: Source Code Pro 18</p> <ul> <li>⟶ CVS <ul> <li>Outgoing Change (Background): dark green</li> <li>Outgoing Change (Foreground): white</li> <li>Ignored Resource (Background): dark gray</li> <li>Ignored Resource (Foreground): light gray</li> </ul> </li> <li>⟶ Git <ul> <li>Uncommitted Change (Background): dark green</li> <li>Uncommitted Change (Foreground): white</li> <li>Ignored Resource (Background): dark gray</li> <li>Ignored Resource (Foreground): light gray</li> </ul> </li> </ul> </li> </ul> </li> <li> <p>Preferences ⟶ Team ⟶ CVS</p> <ul> <li>⟶ Console: Check "Show CVS console automatically when command is run"</li> <li>⟶ Ext Connection: let CVS modules use ext connection method to use Eclipse's extssh connection method. Reference: Eclipse (version 4) documentation <a href= "http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-19cvs-ext.htm"> Workbench User Guide &gt; Reference &gt; Preferences: CVS Ext Connection Method</a> <ul> <li>Check "Use another connection method type to connect";</li> <li>For Connection type, select 'extssh'.</li> </ul> </li> </ul> </li> <li> <p>Preferences ⟶ Java ⟶ Editor</p> <ul> <li>⟶ Content Assistant: Change "Auto Activation Delay" to 500 ms.</li> </ul> </li> </ul> <h3>Preferences ⟶ Wolfram (with Wolfram Workbench plugin)</h3> <ul> <li>⟶ Editor <ul> <li>⟶ Advanced: Editor update delay (ms). I use 1500 ms.</li> <li>⟶ Indenting: Indent with spaces</li> </ul> </li> <li>⟶ Wolfram Cloud <ul> <li>User name: (email address)</li> </ul> </li> </ul> <h2>Plug-ins</h2> <p>(If not specifically mentioned, in reasonably modern version of Eclipse, install plug-ins using the menu Help &gt; Eclipse Marketplace.)</p> <h3>UI</h3> <ul> <li><a href= "https://www.genuitec.com/products/devstyle/">DevStyle</a> <ul> <li>As of Eclipse 4.7, one can install it from Help &gt; Eclipse Marketplace. I use the "Darkest Dark" color theme by setting Preferences ⟶ General ⟶ Appearance ⟶ Theme: DevStyle Theme (Darkest Dark).</li> <li>4.4+: Use Preferences ⟶ General ⟶ Appearance ⟶ Theme: Dark</li> <li>Pre-4.4: <ul> <li><a href= "http://marketplace.eclipse.org/content/eclipse-4-chrome-theme">Jeeeyul's Eclipse Themes</a>, customize UI elements such as window color.</li> <li><a href= "http://marketplace.eclipse.org/content/eclipse-color-theme">Eclipse Color Theme</a> Customize editor styles such as font, background color, etc.</li> </ul> </li> </ul> </li> </ul> <h3>Java</h3> <ul> <li> <p><a href="http://checkstyle.sourceforge.net/">CheckStyle</a></p> <ul> <li>As of Eclipse 2020-09, one can install it from Help &gt; Eclipse Marketplace. The name of the plug-in as of Eclipse 2020-09 is "Checkstyle Plug-in 8.35.0".</li> <li>As of Eclipse 4.6, one can install it from Help &gt; Eclipse Marketplace. The name of the plug-in as of Eclipse 4.8.0 (Aug., 2018) is "Checkstyle Plug-in 8.12.0".</li> <li>Eclipse plug-in site: http://eclipse-cs.sourceforge.net/</li> <li>Plug-in repository URL: http://eclipse-cs.sf.net/update/</li> <li>Available checks: http://checkstyle.sourceforge.net/availablechecks.html</li> <li><a href= "http://algs4.cs.princeton.edu/linux/checkstyle.xml">Robert Sedgewick's check-style configuration file used for his algorithms course</a>.</li> <li>I usually set it to use "Google Checks" in Window &gt; Preferences &gt; CheckStyle &gt; Global Checks Configuration.</li> </ul> </li> <li> <p><a href= "http://findbugs.sourceforge.net/">FindBugs/SpotBugs</a></p> <ul> <li>As of Eclipse version 2018-09 (4.9.0) and Sept. 2018, according to https://github.com/spotbugs/spotbugs, FindBugs has been succeeded by SpotBugs, and install the SpotBugs plug-in from Help &gt; EclipseMarketplace.</li> <li>As of Eclipse 4.4, one can install it from Help &gt; Eclipse Marketplace.</li> <li>Plug-in repository URL: http://findbugs.cs.umd.edu/eclipse or http://findbugs.cs.umd.edu/eclipse-candidate if the former does not work.</li> <li><a href= "http://algs4.cs.princeton.edu/linux/findbugs.xml">Robert Sedgewick's FindBugs configuration file used for his algorithms course</a>.</li> </ul> </li> <li> <p><a href= "https://marketplace.eclipse.org/content/eclipse-code-recommenders"> Eclipse Code Recommenders</a></p> <ul> <li>As of 2020-10 and Eclipse 2020-09, it reports "repository not available" error when attempting to install it.</li> <li>Install it from Help &gt; Eclipse Marketplace.</li> </ul> </li> <li> <p><a href="http://www.objectaid.com/">ObjectAid UML Explorer</a></p> <ul> <li>Plug-in repository URL: http://www.objectaid.com/update/current</li> </ul> </li> </ul> <h3>Uqbar Tomcat XT Eclipse Plug-in</h3> <p>For launch and administer Tomcat's contexts.</p> <ul> <li>As of Eclipse 4.4, one can install it from Help &gt; Eclipse Marketplace.</li> </ul> <h3>Scala</h3> <ul> <li><a href="http://scala-ide.org/">Scala IDE</a>.</li> <li>As of Eclipse 4.4, one can install it from Help &gt; Eclipse Marketplace.</li> <li>Plug-in repository URL: http://scala-ide.org/download/current.html.</li> </ul> <h3>Mathematica</h3> <ul> <li>Wolfram Workbench <ul> <li>As of 2018-10 and Eclipse version 2018-09 (4.9.0), install it manually following the instruction at https://web.archive.org/web/20180108074322/http://support.wolfram.com/kb/27221.</li> <li>As of 2017-10, install it from Help &gt; Elcipse Marketplace: http://marketplace.eclipse.org/content/wolfram-workbench-2).</li> </ul> </li> </ul> <h3>Version control</h3> <ul> <li> <p>CVS Integration</p> <ul> <li>As of at least Eclipse version 2018-09 (4.9.0), to install CVS client, <ol> <li>Help &gt; Install New Software...</li> <li>Set 'Work with: --All Available Sites--'.</li> <li>Type filter text 'CVS'.</li> <li>Install 'Eclipse CVS Client'.</li> </ol> </li> <li>Since Eclipse 4.5, it is no longer included in Eclipse by default. One can install it by going to the menu Help &gt; Eclipse Marketplace and searching by keyword "CVS Integration"</li> </ul> </li> <li> <p><a href="http://eclipse.org/egit/">EGit</a></p> <ul> <li>Since Eclipse 4.4, it is included in Eclipse as the built-in Git support.</li> </ul> </li> </ul> <p>I don't use Mercurial and SVN any more as of Eclipse 4:</p> <ul> <li><a href= "http://www.javaforge.com/project/HGE">MercurialEclipse</a></li> <li><a href="http://subclipse.tigris.org/">Subclipse</a></li> </ul> <h3>Editing</h3> <ul> <li><a href="http://andrei.gmxhome.de/anyedit/">AnyEdit</a> <ul> <li>As of Eclipse 4.4, one can install it from Help &gt; Eclispe Marketplace.</li> <li>Plug-in repository URL: http://andrei.gmxhome.de/eclipse/.</li> </ul> </li> </ul> <h3>Programming languages</h3> <ul> <li><a href="http://eclipsejsonedit.sourceforge.net/">JSON editor</a> <ul> <li>As of at least Eclipse 4.7.0 and 2017-8, one can install it from Help &gt; Eclispe Marketplace.</li> </ul> </li> <li><a href="http://www.eclipse.org/papyrus/">Papyrus</a>: UML modeling support</li> </ul> <h3>Misc</h3> <ul> <li><a href="http://eclipse.org/mylyn">Eclipse Mylyn</a> <ul> <li>Plug-in repository URL: http://download.eclipse.org/mylyn/releases/latest.</li> <li><a href="https://wiki.eclipse.org/Mylyn/FAQ">FAQ</a>.</li> </ul> </li> <li><a href="http://eclipse.org/gef">Eclipse Graphical Editing Framework</a> <ul> <li>Plug-in repository URL: http://download.eclipse.org/tools/gef/updates/releases</li> </ul> </li> <li><a href= "https://marketplace.eclipse.org/content/os-x-eclipse-launcher">OS X Eclipse Launcher</a> <ul> <li>As of at least Eclipse version 2019-06 (4.12.0) and 2019-6, one can install it from Help &gt; Eclispe Marketplace.</li> </ul> </li> <li><a href= "https://marketplace.eclipse.org/content/workspace-badge-plug-mac-os-x"> Workspace Badge Plug-in for macOS</a>. <ul> <li>As of at least Eclipse version 2019-06 (4.12.0) and 2019-6, this is superseded by the <a href= "https://marketplace.eclipse.org/content/os-x-eclipse-launcher">OS X Eclipse Launcher</a> plug-in.</li> </ul> </li> </ul> <h2>References</h2> <ul> <li><a href= "http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F"> Eclipse Wiki: FAQ How do I increase the heap size available to Eclipse?</a></li> </ul> <div class="footnotes"> <hr /> <ol> <li id="fn:1"><a href= "https://stackoverflow.com/questions/12114174/what-does-xxmaxpermsize-do/12114284#12114284"> https://stackoverflow.com/questions/12114174/what-does-xxmaxpermsize-do/12114284#12114284</a><a href="http://meng6net.localhost/tag/eclipse/#fnref:1" rev="footnote">↩</a></li> <li id="fn:2"><a href= "https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html"> https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html</a>, <a href= "https://web.archive.org/web/20200211194652/https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html"> https://web.archive.org/web/20200211194652/https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html</a><a href="http://meng6net.localhost/tag/eclipse/#fnref:2" rev="footnote">↩</a></li> <li id="fn:3"><a href= "http://stackoverflow.com/questions/4214526/how-to-save-eclipse-settings-fonts-formatting-etc"> http://stackoverflow.com/questions/4214526/how-to-save-eclipse-settings-fonts-formatting-etc</a><a href="http://meng6net.localhost/tag/eclipse/#fnref:3" rev="footnote">↩</a></li> </ol> </div> Key bindings of Eclipse and Wolfram Workbench http://meng6net.localhost/computing/key_bindings/key_bindings_of_eclipse_and_wolfram_workbench/ http://meng6net.localhost/computing/key_bindings/key_bindings_of_eclipse_and_wolfram_workbench/ Eclipse computing keyboard shortcut Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Key bindings I frequently use</h2> <table class="datatable"> <thead> <tr> <th>key binding</th> <th>description</th> <th>type</th> <th>comment</th> </tr> </thead> <tbody> <tr> <td></td> </tr> <tr> <td><kbd>Cmd</kbd>-<kbd>click</kbd></td> <td>find definition of the highlited symbol</td> <td colspan="2">navigation</td> </tr> <tr> <td></td> </tr> <tr> <td><kbd>Ctrl</kbd>-<kbd>G</kbd></td> <td>find next instance of the highlighted text</td> <td colspan="2">navigation</td> </tr> </tbody> </table> <p><a href="http://meng6net.localhost/data/key_binding_eclipsewb.dsv">Direct data download</a></p>