I have to build a Decision Support System, but dont have much experience in Java. So after I connected to MySql with Eclipse (with Connector/J) eclipse started to mess up my other projects. Now, when i try to run other projects in eclipse (that are not related to MySql, ex. Guessing Game) the following error message apperars:
Launch configuration DocsConnectionPropsHelper references non-existing project MySql connection test.
Can anyone help me to resolve this problem please?
UPDATE. it seems that when i press "RUN" elcipse is not running the project that im working with, but other
Your update indicates the issue is actually running the wrong project. To avoid that you may want to close projects you're not working on (right click them in package explorer and select close).
If you do need multiple projects open then when clicking the run icon (which defaults to re-run whatever was ran last among your open projects) make sure you have open in the editor window something that can be ran (and is from the project you want to run).
Then click the drop down arrow to the right of the icon. This will open up a small menu with options to change your build configurations or how it should run your program (i.e. as an application or on a server).
To solve the problem:
-click right botton on the project package you want to work on (run)
-choose Run As
-choose Run Configurations...
-choose DocsConnectionPropsHelper - if in the Project box you see not correct title just remove it. Also remove anything what is in the Main Class box.
-click Apply
-the best option is to close Eclipse and reopen it to make sure that all the settings were configured
It worked for me. Hopefully it will work for you too.
Related
I was working on a project in Intellij then suddenly there was a pop up and now the run button is greyed out. It is a Java FX project and it runs with coverage and debug, but the normal run button is greyed out. What could be the problem?
PS: I know I don't give you much to work with but unfortunately it was working and now it isn't, that's all.
I had the same issue and fixed it with the old "Invalidate Caches and Restart"
Open the source code, right-click and hit run using the option run "filename.java".
IntelliJ will make the configuration for you and then you can click the run button after the configuration is made by the IDE.
Same thing for debug configuration.
This has happened to me countless times. One possible problem is that the program is still running in the background and hasn't exited completely. Check your running processes for java applications and see if it exists.
Try to start the program again via Run in the menu bar.
Alt+Shift+F10 solved my problem.
I guess for me disabling windows instant replay fixed the issue.
Restarting IntelliJ and re-opening the project resolved the issue for me.
I think it the maven/gradle plugin that failed to load.
For me I closed the project, open another previous project and the run button appeared.Then I closed it and open my new project,I got a prompt bottom right that says "load maven script" I clicked it and it was resolved.
Change the jdk version to 11 or any lts ..
Steps :
file> Project Structure
Edit SDK [enter image description here][1]
Click on the below link to see the image for editing SDK :
[1]: https://i.stack.imgur.com/3IyXA.jpg
I had the exact same thing using IDEA 2021.3.3 ultimate edition. My "Run Hello (Shift+F10)" button was greyed out, so I right clicked the source code (any whitespace in the editor worked fine), and there was an option in the menu called "Run Hello.main() (Ctrl+Shift+F10)", which WAS clickable. I clicked it, then it ran, after which the first button was no longer greyed out.
Intellij doesn't show run button even if that file is in src folder.
Maybe do you know what to do?
P. s. It's strange because that file used to show run button but after recloning git repository it just doesn't show any more.
Right click on src directory and select option Mark Directory As > Sources Root.
There is an Intellij bug that will result to an intermittent disappearance of that little tiny green run button on the left side of the source code (on same column where the red circle breakpoints are). Yes, you can right-click on the mouse and can do the run via the menu, BUT we love that tiny green button so bring it back!! From time to time, i see this green friend and then suddenly it vanish mysteriously and comes back again. I did all, such as rm -rf .idea and other weird stuff, but no explanation has ever been achieved to explain the vanishing green button and it's sudden re-appearance intermittently.
I am drafting this answer, because all of the above answers seems to claim that there is a logical explanation of the intermittent disappearance of our little green friend and that a sequence of steps exists to make our little green friend re-appear, when in fact, there is no such steps and we just have to accept this is a bug to save the remaining hairs in our scalp.
In my case Run/Debug buttons disappeared for all projects after updating from IDEA 2019.2 to 2019.3. Tried checking Sources Root, Invalidate Caches, Run/Debug configurations etc - no luck. Only restoring Run/Debug action group helped:
Right click on main toolbar (where the button disappeared) > Customize Menus and Toolbars... > select Run/Debug > Restore Run/Debug.
I got the same problem with intellij 2019.3 and 2020.1 and found the solution here : https://youtrack.jetbrains.com/issue/IDEA-228180.
Basically, in the IDE the buttons run/debug and the error detection in the code were missing.
The fix was to disable the plugin 'Gradle' (I don't need it anyway) :
Settings > Plugins > Gradle and click disable and apply.
After restarting your IDE it should work
I had this issue when building a microservice with SpringBoot.
I added a new microservice into the root folder and I could not run it.I am using Maven.
Step:
Open pom.xml
right click and select "Add as maven project"
It should resolve it immediately but you can reload the IDE if it does not update immediately.
IDE: Idea 2021.2.3
Build tool: Gradle
I removed the .idea and reimported the project from the Gradle source. Worked fine after.
Another reason could be the Highlighting Level set to None, it should be set at least to Syntax.
First, make the folder as source root.
Second, make sure you set the project’s sdk correctly. For example, if you set the sdk correctly then import java.util.Scanner can be analyzed by IDEA.
Tip:
try not setting the SDK to IDEA’s bundled JDK. I set the project’s SDK to JDK 11 bundled by IDEA at first then found it couldn’t resolve import java.util.Scanner. Setting to JDK 16 which is installed by the OS’s package manager solved this problem, then the “run” button showed up.
If IDEA can index a java file then the file icon will show with a small “c”, indicating a java class. If not, the file icon will show with a small “j”, as this problem’s image shows, indicating a java file which IDEA doesn’t index.
In my case there was a plugin (springboot helper) which I had to disable.
Reinstall the IDE, it solved my problem.
I also applied all these methods but it still didn't work so I stopped my window firewall and allowed access for this application. I don't know how it worked out for me but it just got displayed on top of my screen that window defender firewall has stopped some of this app's features and there was an option to allow so I clicked on it and it now works just fine.
I have the followinf issue in running Vaadin in JDeveloper. I opened NetBeans and install the corresponding plug-in and ran the example and it worked all ok. So then, I copy the same project structure to a JDeveloper project but, when I try to run the project I am asked to set a "Default Run Target" which I don't know how to do... The starting point should be Vaadin Servlet but how to do If I am ask to select a file...
Hope someone knows how to solve this... Cheers from Argentina...
Instead of hitting run on your project - select a specific page in your application that you want to run in the application navigator, right click on it and choose run.
Or just select a specific JSF/JSP/Servlet that you want to run when prompted.
I usually run a dual-monitor setup, so I have two Eclipse windows open for the same workspace, displaying different files. When I'm debugging and a breakpoint is hit, Eclipse switches to the "Debug" perspective, but it also shows the file/line where the breakpoint is in both of my windows. This occurs even if the file containing the breakpoint was open in one window but not the other (before the breakpoint was hit).
This is really annoying.
How can I have Eclipse only show the file containing the breakpoint in one window? Ideally, it would choose which window based on where the file is open already. If it's not already open somewhere, I don't really care which window it pops up in.
You can create another workspace and in that workspace create a new project from the same src code (same files in file system) of the one in your current project in your current workspace.
That would let you stop on one breakpoint without the other window stopping their too.
Notice that after you make some code modifications in one project you'd have to refresh the other project for those changes to apply in it.
Eclipse switches to the debug perspective for all windows the debug perspective has been opened once (i.e. the little icon on the right top corner is available). If you close that perspective (switch to another perspective is not sufficient), it won't switch to it anymore on that window.
At least, that's the behaviour I observed on Kepler (I know, that question is older but just came across, maybe it still helps someone).
This worked for me:
In Window->Preferences->Run/Debug->Launching->Launch Configurations enable "Apply window working set(s)"
Personally I find this more efficient than creating two workspaces.
Closing the Debug perspective (righ-click on the little icon on the right top corner) worked for me.
I'm using Oxygen and I have the following settings in the Run/Debug Preferences:
Open the associated perspective when launching: Never
Open the associated perspective when an application suspends: Prompt
Maybe you select the sources for Debugging by "File System Directory" instead of by "Java Project". To change this go to Run=>Debug Configuration=>Add Sources=Button: ADD...=>Java Project and select your Projects.
Make sure, that the added sources are found first by moving them to the top.
To disable multiple debugging in multiple windows in eclipse, go to Windows > Preferences > Run/Debug and uncheck Activate the debug view when a breakpoint is hit
I'm developing an eclipse plugin for creating a plugin for another java platform.
I've managed to figure out the LaunchShortcut concept, LaunchDelegate, etc. The basic codepath of the plugin:
I have a launchShortcut display if it detects the project right clicked is a "plugin" project.
This is detected via a propertyTester
Once successful, my launch shortcut runs, which finds an existing launch configuration, or creates a new one if non previously existed.
This launch configuration is then launched via DebugUITools.launch(...)
My LaunchDelegate is thus run, which sets up VMRunnerConfiguration for launching the "application" the plugin is to be loaded with. This is all done so we can easily use the debugger in eclipse against the launched application to test the plugin.
Up until this point, the world is happy and well. You can do this over and over and over again by right click project, go to run/debug, launch the plugin.
However, the SECOND you click the drop down in the Eclipse menu bar for run or debug (you know the list of apps previously run), from this point forward the right click on project no longer works.
The PropertyTester is not even invoked. Digging deep into the LaunchConfigurationManager shows that some how my launchShortcut no longer exists, which is especially strange since the list of shortcuts is only loaded once.
Anyways, I'm at a COMPLETE loss as to what Eclipse is doing here and what I need to do in order to make things happy again.
Any advice/help would be greatly appreciated. Thank you.
For those of you who may hit this problem later.
Apparently, your PropertyTester needs to be able to test java.lang.Object. If you do not do this and you try to test something like IJavaProject, your plugin will fail during the hover of the run drop down as it will not be able to use your property tester on certain objects (duh).
Whats not duh is when this happens, that your shortcut is removed from all possible places it can be used.