eclipse - swt - using windowbuilder in xfce env - eclipse

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.

Related

NIOS II IDE unsuably slow

I've installed Quartus and NIOS II IDE on my Linux machine. Originally I tried importing an existing NIOS II Project into Eclipse, but it just sits there spinning away and eventually tells me it can't import the project because it already exists.
I tried installing everything on a Win10 machine and the project imported OK. I did notice that some of the paths in the orignal project have backslashes. So, for example:
#include "..\subfolder\include_file.h"
Kind of thing. I wonder whether maybe it was that was causing issues.
So, I then tried creating an hello world NIOS Processor in Quartus and making a NIOS II project from scratch. Every step along the way with Eclipse was grindingly slow, but eventually worked up until the point I was able to hit Finish at which point it's just hanging with the little circle with red and blue arrows spinning round and round.
I also have a pop up window with a long list of:
Remote System Explorer Opertion
lines, and at the top it says:
The user operation is waiting for background work to complete
It seems like everything is installed correctly, I can open the NIOS II Eclipse IDE from Quartus for example. Quartus itself works nicely.
I used these instructions to installed Eclipse:
Is anyone able to give me any pointers as to why this is so incredibly slow please? My Linux machine is pretty high spec and flies. Nothing else whatsoever even vaguely struggles on it.
If there's anything I can try to give diagnostic info, am more than happy to supply. Thanks!
I found a solution here
https://askubuntu.com/questions/761604/eclipse-not-working-in-16-04
To test if this fix works, try opening a terminal, and doing
$export SWT_GTK3=0
then run eclipse-nios2. That is, do something like
$ ~/intelFPGA_lite/20.1/nios2eds/bin/eclipse-nios2
If that fixes the problem then to make the fix permanent edit eclipse.ini which for me is in intelFPGA_lite/20.1/nios2eds/bin/eclipse_nios2
In that file, between the lines openFile and --launcher.appendVmargs
insert
--launcher.GTK_version
2
So it reads:
openFile
--launcher.GTK_version
2
--launcher.appendVmargs
and save.
Worked for me!
Try using Visual Studio Code instead. It can do (almost) everything that Eclipse can do, with the added benefit that you can debug remote. E.g. in my setup, I develop exclusively using macOS. I have Quartus installed in a Ubuntu 20.04 VM and VSCODE allows me to develop and debug as if I'm running Quartus natively in macOS.
I'll provide a rough 'how-to' below.
I strongly suggest using a Ubuntu environment for Quartus (other linux environments should work too: I've tested Arch and Manjaro). The Windows install is a royal pain to get working, regardless of IDE choice. I haven't tried the Windows version since 20.1 but nothing worked out of the box and it took many hours or messing with config files to fix it. Also, the Windows version isn't native anyway - it's actually running in Ubuntu via WSL.
Make sure you have installed your required version of Quartus - this should work for Pro, Standard and Lite editions. You can skip the manual installation of NiosII Build Tools for Eclipse if you'd like but I would actually recommend installing it. It can still be useful, if only for creating a new project, BSP etc.
Install VSCODE along with the C/C++ Extension provided by Microsoft (and the Visual Studio Code Remote - SSH extension if you intend to use that feature)
Create a new project using Eclipse (or skip, if you already have a project)
Open VSCODE, select open and navigate to the software directory of your project.
VSCODE will open your project and you should see your application directory and BSP directory.
From here, you can work on your code with full linting, auto completion etc.
If you need to regenerate your BSP, you can either do that using Eclipse or just run the command-line tool instead.
Compiling
If you allowed Eclipse to create your project for you, it will have produced a makefile in your application directory. Compiling is as simple as running 'make' from the application directory. I like to keep a terminal window open within VSCODE so I can run various tools as I work so this is usually how I can compile code. If, instead, you'd like to integrate this into VSCODE, you can define a task (https://code.visualstudio.com/docs/editor/tasks).
Eclipse automatically adds new sources that you create to the makefile. VSCODE won't do this - however, I personally don't think this is a bad thing. I don't like IDEs messing with my makefiles, I want fully control over them myself. So when you create a new source file, just remember to add it to the makefile. There is probably a way to get VSCODE to add sources files automatically (you can run commands on save etc) - but I have no motivation to try to figure this out.
Debugging
It is also possible to debug Nios2 software live on the target via the USB-Blaster using VSCODE. To do this, open the launch.json file in the .vscode folder of your project. If this file does not exist, just create it. The path should be:
<project root dir>/.vscode/launch.json
Copy the following into the launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "app",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/app/app.elf",
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerServerAddress": "localhost:2334",
"miDebuggerPath": "/PATH/TO/intelFPGA/20.1/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/nios2-elf-gdb",
"debugServerPath": "/PATH/TO/intelFPGA/20.1/quartus/bin/nios2-gdb-server",
"debugServerArgs": "--tcpport 2334 --reset-target --tcppersist",
}
]
}
This file is a list of debug targets and settings. You can add any number of configurations here, but easiest to just start with one for now. The configuration above is called 'app', you can change this to suit your own project if you wish.
Update the "program" entry with the path to your applications elf
file
Update the "miDebuggerPath" path with the path the nios2-elf-gdb on
your system. This is the gdb client for Nios2
Update the "debugServerPath" path with the path the nios2-gdb-server.
This is the gdb server for Nios2
Save the file and now click on the "run and debug" button on the left
side control panel in VSCODE
You'll see play button at the top of the screen next to the configuration you just defined in launch.json. Hit the play button - this will start an instance of the gdb server, followed by the gdb client and connect the two. If all goes well, your target will run and stop in main.
VSCODE will provide you with a set of debug tools for stepping, watching variables, call stack - all that good stuff. On the right hand side, you can view the debug console which will allow you to enter commands directly into the gdb console. Note, you have to prepend your commands with -exec. E.g. to print the value of a variable x, you would type:
-exec print x
Caveat
There is a problem with this debugging method: nios2-gdb-server doesn't always exit cleanly and as a result the port doesn't close. If you try to start another debug session, the server won't start because the port is in use. Eclipse solves this problem by randomizing the port everytime it launches the gdb. I have not found a way to do that VSCODE yet.
I find easiest way around this is to run the gdb server manually when I need it. Comment out the two 'debugServer' lines above. Open a second terminal in VSCODE and run:
nios2-gdb-server --tcpport 2334 --reset-target --tcppersist
This will keep the server running even when you stop debugging. If you start another debug session, it will reconnect to the same server instance.
Update: rioV8 provided a helpful solution to this problem which involves using a vscode extension to generate a random environment variable which can used be used in place of the port numbers. The solution is here.

How do I stop command line developers tool icon from showing

This isn’t much of a big problem just a nuisance.
So when ever I open and or close eclipse/IntelliJ application on my Mac, this icon shows up saying “the git command requires the command line developers tool. Would you like to install?”.
This icon shows up when ever I do anything relating to java programming (opening/ closing IDE, creating a new class, sometimes when configuring main class, opening a new project). I always press “cancel” instead of “install” when the icon appears.
Upgrade your Eclipse to 2020-09 (4.17) or at least EGit to 5.9.
Eclipse does not require to have the command line Git to be installed, but calls the git command to check whether the command line Git is installed (and if it's installed, how it is configured). A change that came with a macOS update redirects the git command causing this dialog to pop up. For details see Eclipse bug 564372.
For IntelliJ see JetBrains' bug tracker, e.g. here.

Netbeans 12.1 menu fonts too small, --fontsize no longer works in /etc/netbeans.conf for Ubuntu 20.04

Netbeans 12.1 no longer respects the --fontsize directive in the /etc/netbeans.conf config file.
The menu fonts are way too small on a large screen.
Yet setting Preferences->LXQt Settings->Font->Point size in the Ubuntu control menu, which is normally respected by most Unix app windows, does not carry through either.
And although Netbeans's
Tools->Options->Fonts & Colors->Profile: NetBeans->Syntax->All Languages->Default -> Font
setting changes the font for the code itself inside the editor, it doesn't change the IDE menus.
You would think, after all these years, that there would be a command inside the Options to change the menu font size, but it's still not there yet.
And now editing config to change the --fontsize startup option is no longer respected.
How best to change the size of all the system fonts in the Netbeans IDE display environment?
The best solution I've found so far is to change the Look & Feel.
Invoking aptitude install netbeans currently (Sept '20) gives version 10, which breaks with a jcraft/jsch error, also "could not successfully run the /usr/bin/g++ compiler" on my system even though g++ is perfectly fine and protections cleared, also "Build Host not connected", after C++ is installed from the 8.2 repository. Tastes like some kind of jdk error (I've got /usr/lib/jvm both 8 and 11 jdks installed, hard to believe it can't find them). But if the install doesn't work right out of the box, it's a bad sign. So I tried snap install netbeans --classic . This gets version 12.
Netbeans version 12 comes with the Metal Look & Feel configured by default. Changing this to the GTK+ look and feel, using Tools->Options->Appearance->Look and Feel->GTK+ with a restart, finally got the menus to the correct system size.
Unfortunately, the Help->About popup still does not respect this, having minuscule fonts. Perhaps there is a better way?
Although "Look and Feel" is an improvement, I would still like to see direct control of the IDE menu fonts. From the Options Fonts & Colors menu.
Running netbeans from commandline with an additional argument --fontsize 12 works for me. Open a console and go the bin directory of netbeans and use the command ./netbeans --fontsize 12. Change the font size to whatever suits you.
In Netbeans in Tools->Options->Appearance->Look and Feel, I could solve the problem.
But in my case, the selected option already was GTK+. Changing to Metal solved it.
Install Netbeans 13.
It should help

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

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.

Eclipse cannot save python2.7 interpretor

Though this is strange but happening with me. I add python3.2 in in the Pydev> interpreter-python it is saved for always. I can run my scripts pretty well. But when I add a 'python2.7' in the Pydev> interpreter-python it shows there till preferences window is open and once I close the preferences window it disappears and takes other interpreters with it. I mean an empty 'interpreter-python' setting.
I save my workspace in dropbox so that I can use share my settings on different systems both using Ubuntu 12.04 X64. I am sure it is not a Dropbox ACL setting issue as 'Python3.2' settings save and work pretty well until I add 'python2.7' which removes all the interpreters including itself.
Please Help. Unable to code.
AK