How can I get Eclipse IDE to default to "Selected lines" in the Find/Replace dialogue when multiple lines are selected? - eclipse

When working in Eclipse and hitting Ctrl+F with lines of code selected, the default behavior I expect is for the Find/Replace dialogue to open with the "Selected lines" option and, perhaps, either buffer contents or a previous search query in the "Find" prompt. On my home machine, what happens instead is the entire selection gets automatically copied to the "Find" prompt and Scope is reset to "All" instead of "Selected lines" every time.
I somehow do have this working by default on my work machine: "Selected Lines" scope option is chosen automatically when more than one line is selected in the editor.
Possibly unrelated: I do have CDT installed and I work mostly with C++ in Eclipse. Home machine is running Ubuntu 18.10, work machine is running Ubuntu 18.04.
I tried:
Re-downloading Eclipse, reinstalling CDT & cmake4eclipse
Changing to a new Workspace in Eclipse (without copying settings)
Searching high and low online for recipes on how to control this.
How do I change the IDE at home to the desired "Selected Lines" behavior?
[Edit 1 hour later]: I am now almost convinced the issue has to do with the Ubuntu version somehow. I'm running 18.04 on my Laptop (same as my work computer) and I just upgraded CDT & Eclipse Platform to latest stable versions (9.7 and 4.11/2019-03, respectively), which I have everywhere else. The new "wrong" behavior didn't appear. I will also start a thread on the Eclipse forums or perhaps even open a bug report. I don't want to reinstall the whole system or downgrade it (slim chance of success) just to get this back; if it's an Eclipse bug, I'd rather work on fixing it.
[Edit 2 days later] The bug did not manifest on a fresh install of Ubuntu 18.10. I still have no idea what was different on the 'culprit' machine. I ended up wiping the drive and reinstalling 18.04 on the same machine and the problem went away.

Related

Minizinc IDE does not open anymore

I am using Minizinc IDE (the latest version) on Windows 10. I have been using it for a time and everything was fine. All of a sudden, when I wanted to open Minizinc IDE, it shows that it is open in the taskbar, but the IDE windows does not appear! when I hover the mouse over the icon in the taskbar, it shows a white rectangle! I waited for an hour and no change, restarted my PC, uninstalled Minizinc software, and re-installed it again, but none of these have helped! Any suggestions?
Their might be a problem with your search path. Or some dynamic link libararies (DLL) might be missing or hidden.
You could try a dependency checker like https://github.com/lucasg/Dependencies to find and solve the problem.
Start at file "...\MiniZinc\MiniZincIDE.exe"
Here are the dependencies listed on my Windows 10 PC:

Eclipse Neon.3 fails to launch after install

I've installed Eclipse Neon.3 on my windows 7 machine, after the install process has finished, the installer has an option to 'launch now', which I do and the IDE boots up and works as expected.
However when I close eclipse and then reopen it, I get a crash which prevents it from booting up (sorry for this being a picture, but there doesn't seem to be an easy way to copy the text):
The version I've installed is Release 4.6.3, and the build ID is 20170314. I've installed and removed it 3 times and observed the same behaviour each time. I've tried doing a reset between boots and installs. I've also tried inspecting my environment variables, which look like this:
JAVA_HOME:C:\Program Files\Java\jdk1.8.0_91
PATH: %PATH%;%JAVA_HOME%\jre\bin
Is this a known issue, or do I have something wrong in my setup? Prior to this I discovered 4 versions of the jre/jdk on my machine, and two versions of eclipse. I think I have correctly removed all but the one referenced from my java home, and I entirely removed eclipse and downloaded the latest version (neon.3).
I've fixed the issue, and whilst I'm still not entirely sure why it was a problem, here is how I fixed it.
I opened a terminal and ran 'java -version' (I should have done this first). It was failing to find java.exe, despite the bin folder being on the path. Running this revealed that it was actually calling a shortcut to java.exe found in 'c /programdata/oracle/java/javapath/' which pointed to a now non existent version of java.
So long story short, if you have a similar problem, check if you have shortcuts in the folder 'c /programdata/oracle/java/javapath/java.exe' and ensure they point to the correct program.

Eclipse editor unable to display file contents

I've run into a very strange issue with my Eclipse installation. In fact, I've tried installing three different instances and the problem persists, so something must be seriously messed up with my machine.
The best way I can describe it is this. When I open a file in Eclipse (regardless of file type - I've tried .java, .js, .xml, etc.), the file appears to open and the filename is shown at the top of the editor panel as normal. But the file itself appears to be empty or blank.
Upon clicking in the editor window to attempt typing, it gets even more strange. The normal blinking black cursor is the full height of the window. Typing doesn't actually do anything. No text shows up, but it appears as if the file is being edited because the (*) symbol displays next to the filename as if it hasn't been saved since it was last changed.
I would provide a screenshot, but it's simply a blank window with a giant typing cursor. My current environment information is below, but like I said, I've had the issue with three different versions of Eclipse. Also, it's peculiar that this started happening seemingly randomly. Everything was fine but my machine was overdue for a restart. After restarting I opened up my workspace and this just sort of happened. I haven't been able to find any suggestions that aren't "reinstall" or "run Eclipse with the -clean tag" (neither of which worked).
Windows 7 Enterprise
Service Pack 1
Processor: Intel(R) Xeon(R) CPU E5-2695 v2 # 2.40GHz
RAM: 8GB
System type: 64-bit
Eclipse Mars 4.5.2

eclipse - swt - using windowbuilder in xfce env

I have some problems with eclipse indigo x64 Linux; The problem is using windowbuilder (the SWT); I tried using gwt or swing but they both cause either windowbuilder freeze or even eclipse crash...
The alike issue it seems I found related info in official eclipse indigo offline Help which says :
How can I prevent the preview window from flashing under Linux using Metacity
In order to create the graphics that you see in the design view,
WindowBuilder Pro creates an off screen window containing the various
widgets and they takes a screen snapshot of them. This works very well
under Windows, OSX and some versions of Linux. Recent versions of the
Metacity window manager (more recent than 2.1.4), however, have been
modified/"fixed" to disallow windows to be opened off screen. This
forces the preview window to appear on screen leading to an annoying
flashing effect any time you make a change. The solution is to disable
the Metacity "fully_onscreen" constraint by patching the Metacity
source code and rebuilding and installing the patched version into
your system.
Here are the steps to follow:
Download the Metacity source code from ftp://ftp.gnome.org/pub/gnome/sources/metacity/
Unpack the source code tarball into any temporary directory.
Chdir into this directory (with the unpacked code).
Find window.c file and open it with your favourite texteditor.
Find a line with "window->require_fully_onscreen = TRUE;"
Replace it with "window->require_fully_onscreen = FALSE;"
Save the changes and close the editor.
Open a terminal and chdir into the directory with the source code (nice if you have already done this)
Run "./configure".
Run "make all".
Make sure that steps 9 & 10 completed without errors.
Become root (or execute the next command via "sudo" depending on the Linux you are running)
Run "make install" (or "sudo make install").
Save your work and close any application you are working with.
End your session (or press Ctrl-Alt-Delete to restart the x-server) and log in again.
You are done!
well seems like I have the snapshot really but, as I can get it, the snapshot doesn't want to dispose or similar so I have either resize the whole eclipse or press F5 to refresh (which works not at once);
I am not sure how to fix the issue in case I have xfce+adwaita installed? I don't have metacity installed; Seems like xfce works with gtk instead of metacity (correct me if I am wrong);
So my question is... how to fix the "window flashing or freezing" if I have :
xfce4
adwaita-dark theme
linux arch x64ce
Thanks
Try to install install libswt-gtk-3-jni and libswt-gtk-3-java.

Eclipse Mars Scrolling in Lubuntu

Just installed Eclipse Mars on Lubuntu 14.
While scrolling up and down in the console or editor - I get a kind of black rectangle covering some text, or the test is kind of twisted visually (lines become non-straight).
Anyone know how to fix this?
Haven't had this in previous versions of Eclipse on the same comp.
Exactly the same thing happened to me installing Eclipse Mars on Lubuntu 14 Toshiba Satellite notebook. I was really looking forward to the day of the Eclipse annual release of Mars and I was disappointed to be so disappointed with 5 minutes on installing.
Anyway, I can confirm that setting environment variable SWT_GTK3=0 by way of export does circumvent the problem. If you open a terminal and type "export SWT_GTK3=0" in the shell, you will also need to start Eclipse via the command line while remaining in the same shell. If you start Eclipse via a desktop launch icon, Eclipse will not see the SWT_GTK3 environment variable and the problem will persist. This is because environment variables in Linux are per-process and an application launched from the desktop is running in a different process to a shell process in a terminal.
So that Eclipse always sees the correct SWT_GTK3 environment variable after starting your machine, best you export SWT_GTK3=0 globally. To do this on Lubuntu, follow these steps:
Open a terminal window
Open the file /etc/profile for editing as sudo (e.g. sudo gedit /etc/profile)
Add the line
export SWT_GTK3=0
at the end of the file.
Save file, quit editor and reboot your machine.
Launch Eclipse Mars and hopefully your scrolling problem is fixed.
This worked for me but, as always, YMMV.
btw. You can check the SWT-GTK3 environment variable was exported after rebooting by opening a terminal window and typing the 'env' command. You should see
SWT_GTK3=0 in the list of environment variables and values that are displayed.
It seems like a new bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=469027
It happens also under Kubuntu. Anyway the workaround, at least for me, is to export the following environment variable:
SWT_GTK3=0
I solved my problem in Ubuntu 15.04 with Eclipse Mars by adding the following code in the start of data in the Exec option in eclipse.desktop (/home/.local/share/applications):
Exec=env UBUNTU_MENUPROXY=0 SWT_GTK3=0 /usr/lib/jvm/...
In that way you leave intact your OS preferences and act only on Eclipse starting script.