Eclipse lock execution so it cannot be terminated accidentally - eclipse

I am running multiple executions in my Eclipse. One is supposed to run for weeks and just crunch data. But at the same time I develop and regularly kill processes during i.e. debugging. It often happens that I accidentally kill the wrong task and days of calculations are gone. I do not really want to duplicate/split workspaces. Ideally I want to lock the long term task, so I have to unlock/confirm before it can be terminated. I googled but did not get any helpful results.
Eclipse Version:
Eclipse IDE for Java Developers
Version: 2020-03 (4.15.0)

Related

Building Eclipse from scratch - it takes an eternity

Lately I have challenged myself to build the Eclipse IDE from the source code. This will open an opportunity to start playing around with the code, and make some changes.
I found the following tutorial to guide me through the procedure: http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html
Especially chapter 13 of that Tutorial is helpful. Apparently I need to have the following software installed on my (Windows) machine:
Git
Maven Version 3.3.1 (make sure that the bin folder where you extract Maven is added to the PATH)
Oracle 1.8 JDK or higher
I have all this software on my desktop - so I'm ready to go. I start by cloning the newest Eclipse repository and it's submodules via Git to some folder on my machine:
git clone -b master --recursive git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git
This takes a couple of minutes. Maybe half an hour at most. Eureka - the folder is now pretty full with the Eclipse source code! The vogella tutorial proceeds with the actual build command. I open the command prompt in Windows and surf (cd..) to the right spot. Then I type the command:
mvn clean verify
I first got some errors. But thanks to the StackOverflow community, they are solved now. Please refer to this link for more info: https://stackoverflow.com/questions/37645180/building-the-eclipse-ide-from-scratch
Eclipse builds. And it builds. And it keeps building for hours. After many hours, I get the message that the build has finished. I'm amazed it took such a long time, since my computer is quite a beast:
> CPU: Intel Core i7-4790K CPU #4.00GHz
> RAM: 16.0GB
> System type: 64-bit OS
> Windows 10 Home
Anyway, after the build has finished, the JUnit testing automatically starts. I have no option to skip it. I wait for some more hours, until I really need to stop the system and go home. I close the command prompt - knowing that I interrupt the JUnit testing. But who cares :-).
I check my filesystem, and cannot find the files about which the Vogella tutorial speaks:
eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products/*
Help.. was the whole build procedure done for nothing? I want to redo the build, but is there a way to skip those JUnit testings?
EDIT: I followed the advice of Mr. Gerold Broser and added the -DskipTests flag to the mvn clean verify command. I believe that Eclipse is now building without doing all the JUnit testing. Nevertheless, I still feel like the build takes an eternity. I'm now waiting for 4 hours. Is this normal? Are there ways to tell the maven build tool that it can use all 4 CPU cores?
EDIT: The Eclipse build has finally stopped. Unfortunately, it is no big success. I get a very lengthy error message. The build has failed. I've opened up another StackOverflow post to get some help:
https://stackoverflow.com/questions/37662645/building-eclipse-from-scratch-build-failure
Hope you can help me out.
See Maven Surefire Plugin / Skipping Tests:
You can also skip the tests via the command line by executing the following command:
mvn ... -DskipTests

Why does Eclipse CPU usage increase when I run an application?

I run my Java application in Eclipse and see these two thing in Task Manager:
Before I start my application, Eclipse uses ~0% CPU. What exactly does Eclipse do after my program started?
If I run my application without Eclipse, will there be any difference in my Java process CPU usage in the case that my JVM settings are the same with Eclipse?
Eclipse has to read your program output to display it in the console, for example, which can take a bit of resources, especially if your program generates lots of output and/or long lines of output (in my experience, the Eclipse console is quite slow). I suppose you're not running in debug mode, in which case Eclipse would have to do more to handle the debugging.
So your application running outside Eclipse may go a bit faster, yes.
You can of course run something like jvisualvm to get a thread dump of Eclipse while your program is running to find out exactly Eclipse is doing.

How does Eclipse start weblogic?

I'm asking a slightly different question here: How does Eclipse start/stop weblogic when you right click on the server in Eclipse's server pane?
I ask, because this is the only way that I can actually stop and start my server. The .CMD files that come with weblogic don't work. They never have.
It doesn't help that I'm running my own command-line (JPSoft's TakeCommand/4NT), but even if I go into cmd.exe... The scripts don't work. They never have. 25 years of shell scripting and I can't get them to work. I've spent upwards of 4 hours.
So in the end, I want to just do "Whatever it is that Eclipse does", but Eclipse is not forthright about how it's stopping and starting the server.

Eclipse debugger stops working randomly

I have been working on a project that requires rigorous debugging at each step and I notice that my debugger just randomly stops working from time to time and does not respond to any of the breakpoints.
I tried restarting eclipse and unplugging my device over and over. Any particular reason this might be happening? Its extremely frustrating and I couldn't think of a better place to post this query.
Many a thanks in advance!
I know this is an old question. But I had that eclipse suddenly stopped working, i.e. died before even executing one line. I restarted VM and eclipse multiple time. Then I stumbled here. Thank you, it got my mind thinking.
For all major issues with eclipse, not loading, freezing or debugger fuck up (that is not because of your code :D ). Try the following line:
./eclipse -clean -clearPersistedState -refresh
First I would make sure your eclipse is not running out of heap space memory. If necessary increase the heap memory using the -mx Java command line flag. Running out of memory can cause various instability problems such as the one you describe.
-xms is the start memory (at the VM start), -xmx is the maximum memory for the VM
eclipse.ini : the memory for the VM running eclipse
jre setting : the memory for java programs run from eclipse
catalina.sh : the memory for your tomcat server

Error "Comparison method violates its general contract!" when installing any Eclipse plugin

(I've read this question, but that answer doesn't solve my problem, so don't mark this one as duplicate)
I have a fresh installation of Eclipse (Eclipse for PHP Developers / Helios Release / Build id: 20100617-1415 on Windows 7 x86) I can't install any plugin or addition. Neither from official plugins repository, nor from user-provided URLs.
Installation, even of tiny plugins takes "years" (starting at 10-20 minutes, ending on over an hour) though I'm on quite very fast Internet connection (around 2 MB/s), which is strange itself. And it always ends up with the same error message:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.php, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Comparison method violates its general contract!
Comparison method violates its general contract!
Error message is always the same, always mentioning epp.package.php, no matter, what plugin I'm trying to install. So I assume, that this is Eclipse-related, not plugin-related problem.
I did some reasearch on StackExchange (many similar topics but clearly programming question, related to errors in Java or Javascript code) and in the Internet in genereal. The only thing directly related to Eclipse, that I found was this forum topic saying about some know bug in Eclipse. Though this bug is marked as resolved fixed, I tried to adapt one of proposed quick solutions of starting Eclipse with:
eclipse.exe -Djava.util.Arrays.useLegacyMergeSort=true
(other, similar sources are unclear, whether there should be a space between -D and java.* or not)
But this has brought no effect. Again, installing even small plugin even from official repository takes very, very wrong and upon progress bar reaching around 20% (after about 20-30 minutes) entire installation process ends up with above error.
I have newest available stable versions of Eclipse for PHP and JRE.
I've read this question, but it brought me no closer to the solution. I saw no difference, when starting Eclipse with java.util.Arrays.useLegacyMergeSort=true switch and I wasn't able to update core Eclipse to newest version, because this process also failed with the same error.
And this does not explains, why installing anything takes so incredibly long on fairly fast connection?
Is downgrading to JRE 6 the only option I have?
The -Djava.util.Arrays.useLegacyMergeSort=true must come after the -vmargs switch, as that changes the command line from specifying Eclipse launch arguments to arguments to the JVM, which any -D would be.
Use this solution or upgrade to at least Indigo SR2.