Eclipse Syntax Coloring reset after restart - eclipse

I installed Ubuntu 15 new and I installed eclipse Mars.
Now, I want to have the syntax highlighting exactly like in visual studio, so i downloadet the .epf here http://eclipsecolorthemes.org/?view=theme&id=23347 and imported it into eclipse.
Until here, I have no problems, but when I restart eclipse the highlighting will reset after 5 seconds to default.
I don't know why, but when I start eclipse via sudo, I don't have the problem. I have no more ideas...
I saw, that eclipse run this on startup:
http://pastebin.com/6YGVxfhU
I dont know, how i can stop it

To disable all Oomph startup tasks
In preferences, choose Oomph | Setup Tasks. Then check the Skip automatic task execution at startup time.
To disable which preferences Oomph tracks
In preferences, choose Oomph | Setup Tasks | Preference Recorder.
Check the Record into: checkbox.
In the table uncheck the preferences you don't want synchronized. For your case it is probably the set of /instance/org.eclipse.ui.workbench/[...].
(Optional) Click Open the recorder target file button and fully edit your preferences.

If you want to use Oomph to track your syntax, you can import the .epf file into the preference recorder:
Open Window > Preferences and go to Oomph | Setup Tasks | Preference Recorder
Make sure Record into is selected and whichever profile you want to record to is selected (probably User.) Open the recorder file using the button next to the dropdown.
A .setup file will open in the editor. Close the preference window. An Oomph toolbar should have appeared. The third button is Import Preferences.
Oomph - Import Preferences Button
Click it, browse to your .epf file and open it. Move whatever preferences you want to import from Available Preferences to Selected Preferences and click OK.
The preferences will be added to the .setup file, under the root node (probably User.) Drag them into the User Preferences node (the first child node with the folder icon) and delete any existing nodes with conflicting names (it won't combine them.)
Save the file.
You should now be able to restart Eclipse and have Oomph load in your correct syntax coloring.
Answer from this eclipse forum post with a few extra steps I had to do to get it working.

Related

.vscode/settings.json is empty but plugins are disabled in workspace

I want to disable several plugins in certain workspace in VS code. So I've started vs inside workspace, opened plugins tab and clicked arrow next to disable button and choose Disable (workspace). And it works. Now when I open certain workspace I have disabled plugins which I've disabled before. But where does VS code store the information about disabled plugins in workspace? In my workspace where I've disabled plugin I have .vscode/settings.json but this file is empty (same result if I do: File > preferences > settings choose Workspace and click Open Settings (top right)). Re-enabling plugins in workspace also works as expected.

How to change the *default* default encoding in Eclipse?

Every time a new workspace is created, Eclipse defaults to Cp1250 encoding.
Whenever I create a new branch of the project, and as result switch to a new workspace in Eclipse, I need to go to Window -> Preferences -> General -> Workspace : Text file encoding and manually switch to "Other: UTF-8". If I forget this step, Eclipse mangles the UTF-8 characters in the project files.
Can I change the default somehow, permanently, so that all new workspaces start as UTF-8 without need to switch them manually?
Actually, it is quite simple:
Create a defaults.ini file in the Eclipse configuration folder. For example, if Eclipse is installed in C:/Eclipse create C:/Eclipse/configuration/defaults.ini. The file should contain:
org.eclipse.core.resources/encoding=UTF-8
If you want to set the line terminator to UNIX values you can also add:
org.eclipse.core.runtime/line.separator=\n
In eclipse.ini in the Eclipse install folder (e.g., C:/Eclipse) add the following lines:
-plugincustomization
D:/Java/Eclipse/configuration/defaults.ini
You might need to play around with where you put it. Inserting it before the "-product" option seemed to work.
This appears to be determined by this code in org.eclipse.ui.WorkbenchEncoding:
/**
* Get the default encoding from the virtual machine.
*/
public static String getWorkbenchDefaultEncoding() {
return System.getProperty("file.encoding", "UTF-8");
}
So it is taken from the 'file.encoding' environment variable, defaulting to 'UTF-8' if that is not set.
This is one of the key things that Eclipse Oomph was created to solve, the ability to set default default preferences, i.e. preferences set across workspaces.
You can go "whole hog" and adopt using Oomph as a full Eclipse Installer and share the install scripts between your team members. The installer can configure everything from which plug-ins to install, to default preference values, to where to check code out from.
Preference Recorder
However, for now you can simply use the Preference Recorder.
Install Oomph, it is possibly already installed if you are using Eclipse Mars. If not, from the Mars update site you can install "Oomph Preference Management"
Open the preferences page, you should now have a new icon next to Help in the bottom left. It will allow you to turn on/off the preference recorder:
With the recorder on, change your preferences you want, in this case your encoding, then press OK. You will then be asked if you want to track the changed preferences across your workspaces. You can change the values in the User Policy column.
Now if you create a new workspace, those tracked preferences will be applied to the new workspace.
If you want to see what is being recorded, in Preferences, see Oomph -> Setup Tasks -> Preference Recorder
To access the full setup configuration, press the button to the right of the Record Into drop-down (top right of UI) and the setup file will be opened in the editor, where you can do further control and mods:
PS. the default default of the encoding is a hotly contested issue at Eclipse, hopefully the default default will change to UTF-8 everywhere.
in eclipse.ini add :
-Dfile.encoding=UTF-8

Liberty Profile Configuration Editor within Eclipse MARS no longer appears

The Liberty Profile Configuration Editor no longer appears. All was working great and now all I get is the XML editor. The option for the Configuration Editor is still in the context menu but I always get the XML editor.
I would like the option back. Is there a HOW TO?
Perhaps the version of the Liberty plugins you have is not compatible with Eclipse Mars. You should update it, easiest way is probably via Eclipse Marketplace. Here's what looks like the latest Liberty Profile tools in the marketplace: https://marketplace.eclipse.org/content/ibm-websphere-application-server-liberty-profile-developer-tools-0
This also could be as simple as the related editor for server.xml was messed up. If you click on the server.xml file, and use context menu "Open With..." Do you still see "Liberty Profile Configuration Editor" in the list?
Chuck
Is the Design tab still showing but the design view displays an error when you click on it? If so, what is the error?
Are there any messages in the .log file (<your workspace>/.metadata/.log)
Is it not working on some particular files or not working at all, for instance, if you create a new file does it open with the configuration file editor? To create a new file, right click on your server folder in the explorer view and select New -> Liberty Profile Configuration File. Give it a name like test.xml and click Finish.
One thing you could try is to regenerate the runtime cache and see if that helps:
Window -> Show View -> Other -> Server -> Runtime Explorer
Right click on runtime in Runtime Explorer view and select Edit
Click on Advanced options in the dialog
Click the Refresh button
Wait for the refresh timestamp to be updated
or:
Window -> Preferences -> Server -> Runtime Environment -> SELECT YOUR RUNTIME -> CLICK Edit -> CLICK Advanced options... -> CLICK Refresh
Wait for the refresh timestamp to be updated

Show dialog to choose workspace while it starts

I know its a silly question but i am stuck into it from 2 hours..Can any body tell me how should i enable the dialog which opens at the time we start eclipse and we choose workspace location from there.
See I want this window to be displayed first when eclipse starts
By mistake I have checked "Use this as the default and do not ask again".
Please guide me how to show up this dialog again
You can find it here :
Menu: Window -> Preferences -> General -> Startup and Shutdown -> Workspaces -> Prompt for workspace on startup
Eclipse preferences has a lot of options. You can search for specific options by typing in the filter text box at the top of the preferences dialog.
If you type in 'startup' for instance the list will be much shorter.
window > preferences > general > startup and shutdown > workspaces
then check 'Prompt for workspace on startup'
If your workspace is corrupted and Eclipse doesn't startup with your currently pre-selected workspace, you may edit SHOW_WORKSPACE_SELECTION_DIALOG=false to SHOW_WORKSPACE_SELECTION_DIALOG=true
which is located in file
C:\PathToEclipse\eclipse\configuration\.settings\org.eclipse.ui.ide.prefs
before you start the IDE.

How to configure eclipse to autosave on run?

I'm looking for a configuration or plugin for eclipse that automatically saves files (so I don't have to use Ctrl+S). It could do it on lost focus or over some period of time. I think I saw something like that (I know IDEA has it), but I cant find it now.
Update seven years later (Eclipse Neon 4.6)
Eclipse now has an Automatic Save of dirty editors
The autosave option is disabled by default.
A new autosave preference page (Preferences > General > Editors > Autosave) is available and allows to enable/disable the autosave and change the interval of autosave.
The countdown is reset on keyboard activity, mouse click, or when a popup is displayed (e.g. content assist, preference page, ...).
Original answer (2009)
The OP IAdapter added in the comments:
I bet plugin like I describe exists.
... and you are right!
Eclipse plugin saveDirtyEditor should do just what you need.
Copy the SaveDirtyEditors_1.0.2.jar in your plugin directory.
You will get a new preference page under
General > Editors > Text Editors > Save Dirty Editors
, allowing you to save dirty files like 'myfile.java' under 'myfile.java.snapshot' every 30 seconds (can be less if you want).
Without additional plugin, though, Eclipse does not support natively that feature.
The closest could be:
Window > Preferences > type "build"
> General > Workspace > [x] Save automatically before build
That way, each time you hit CTRL+B for actually building your sources, they would be saved.
But I realize this is not exactly what you are after.
Beware your option would not be very efficient with the "build automatically" option activated... (that would trigger too much builds)
Again, without achieving exactly what you are looking for, you also have:
Run/Debug > Launching > Save required dirty editors before launching
Run/Debug > Launching > [x] Build (if required) before launching
Note: the difference between IntelliJ IDEA and eclipse is the "compile on save" feature:
As mentioned in the IDEA FAQ:
Q:
Can I enable "compile on save" in IntelliJ IDEA?
IntelliJ IDEA currently doesn't support this feature.
However there is an "Eclipse-mode" plug-in which provides similar functionality, so we suggest you to try this plug-in.
Note that by default IntelliJ IDEA saves the files for you, so you don't have to press the Ctrl+S shortcut frequently like you need to do in other IDEs.
However, with Eclipse, the "build on save" is activated by default, hence the absence of that particular feature.
http://code.google.com/p/eclatosa/
"Saves all open editors in eclipse when deactivating the eclipse window (like in IntelliJ)"
No need to install more plugin.
Window -> Preferences -> General -> Workspace
and there you can check:
Save automatically before build + Build automatically
If that doesn't work try this:
Preferences -> Run/Debug -> Launching -> Save dirty editors before launching
I wrote a plugin a long time ago to do this that still seems to work: http://www.stateofflow.com/projects/71/save-me
It saves the editor when it loses focus. However, if you switch away from eclipse it doesn't notice.
Try this
Goto Eclipse Preferences > General > Editors > Autosave
if it not work then try this
Preferences -> Run/Debug -> Launching -> Save dirty editors before launching