I've tried cleaning and validating my project, restarting both Eclipse and my computer and my java class files won't open in the editor. Also, I've tried deleting the project from my workspace and reimporting it and no luck. Does anyone know what it might be?
Window -> Reset Perspective worked for me
Try this Right Click on File -> Open With -> Java Editor
Make sure you are in the Java perspective.
Try cleaning eclipse. Start eclipse with
eclipse --clean
Hope this helps.
make sure that a single click is selected for open mode. if you go to preference setting, it will be the first thing you will see
Related
I'm working on a group project with Github and Eclipse. My partner has done a lot of work on a GUI and put his work on Github and then I have imported his work through eclipse. For some reason I can not open a design view at all, theres no buttons down the bottom to switch between design and source, trying to open in windowbuilder editor just opens up the code, running the project just says "Unable to Launch, the selection can not be launched". I know I have everything installed properly because I made a test project with a GUI and it has everything above working fine. We both have same versions of everything so I'm really just not sure what to do beyond manually restarting it on my end and copying and pasting code to get it to work.
You can try: Right click in class -> Open With -> Select your design view editor
Okay, I got it to work.
I was importing it directly through eclipse > GIT > Clone. and it wasnt working. but for whatever reason when I cloned it through git onto my desktop and then imported it that way through eclipse, Import > General > Projects from folder. it worked fine.
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 made a mistake and deleted the .metadata folder in my home directory (I'm using Linux redhat.) Now, Eclipse doesn't launch at all. The window with the eclipse icon shows up and nothing happens after that.
Any solution to this? Did it actually even depend on that .metadata directory?
Thanks in advance.
First thing I would try is opening Eclipse in a new workspace. The other thing you can also try is starting Eclipse in clean mode, just add -clean.
When I open my file Java - I see ... nothing
but when I Restart Eclipse - all working again ... before it will not open another file of my project
what happens? I can not restart eclipse every time
Right click on the root of your project and select Refresh. Maybe the files are out of sync with the file system.
This could be a problem with installation of eclipse.I will suggest you to reinstall eclipse and adt plug in.
I have recently been setting up SVN in Eclipse using the Subversive plugin (I am still a bit lost, but that's another issue).
I have been using this guide (http://soledadpenades.com/2008/12/10/add-svn-support-to-your-eclipse-installation/) and finally got it working!
The only problem now is, I can't seem to find the Package Explorer, which is the only explorer I could ever seem to get working how I wanted it to (grouping projects into working sets).
Normally, you get it from going to Window → Show View → Other, and then select it from the list. The only thing is, it's not IN the list of views... leaving me rather confused.
Just to be clear, I was using the package explorer before with no problems. I am running the latest version of everything as I did the auto update.
Any suggestions as to what is wrong here?
I'm guessing you've made it a fast view or minimised it to it. You could try holding down Ctrl + F7 to see a list of all views, then up/down arrow to the View. If Package Explorer is in the list it has been minimised or something.
If you select it and still can't see it, try Window → Reset Perspective... to restore all views to their defaults.
Alt+Shift+Q worked for me when I was in debug mode.
Weirdly enough, although reset perspective didn't work, menu Window → New window worked! It opened a new window with the perspectives reset.
For me I needed to do two things:
Reinstall the "Eclipse Java development tools" via Help → Install Software → Programming Languages
Delete and recreate the .metadata Eclipse Workspace settings.
Honestly, deleting the .metadata directory is probably sufficient - try that first.
At the top right corner, there is a button called Open Perspective. Click on it, and then Java Default. Everything will come back to normal.
Are you sure you are in the Java perspective?
As views are related to perspectives this could be the problem. The current perspective can be found in the upper right corner.
You may be missing the JDT plugin containing the Package Explorer.
I think you were actually still in the Debug perspective, since that was what did it for me. As someone mentioned above, I had to go to the top right and hit "Java perspective" to get back to my normal views.
Three answerers were helpful, however the only cure was to reinstall Eclipse and install the plugins again. Weird problem, and the exact cause not found. I may have deleted some files somehow, but a reinstall solved it.
On the right top you can select Java or JRE or whatever. That button might got changed. So click the neighbor buttons such as Java or something.
Go to Window -> perspective -> Open Perspective -> Java. Now all the packages in Java will be displayed in the package explorer.