I am new to using Eclipse (I just downloaded it).
I began creating a new project, wrote some code, added some packages and classes and closed the project.
Now, I opened it again and I'd like to add a class to a package. So I right-click on that package and the standard popup window appears. But when I now hover over "New ->", there are only three options: "Project", "Example" and "Other". The first time I worked on the project, there were many more options, f.ex. I was able to click on "Class" direct. Right now, I have to select "Other", type "Class" into another window and click "Ok".
Is there any switch or so in the settings that I accidentally enabled that changes the default right-click popup?
I added an image.
Thank you for help!
It seems you are not in the Java perspective: Window > Perspective > Open Perspective > Java
Related
When I'm using Eclipse to code in Java, I want to use the 'New' button (located below File, Edit...) to create a new class. I know it's possible because I've been able to use it like that on a different computer. However, the only options displayed are "Project", "Example", "Other...". So I have to select other and go find "Class".
I want a way to modify this list to include Java Project, Class, and whatever else I need. It's the same story when I right-click the src folder in the package explorer. I want to make a class in that folder, but I have to click other, navigate the new window to class, etc.
Can this be simplified?
Make sure you're in the right perspective. I see what you're looking for if I'm in the "Java" perspective, but not in other perspectives, such as "Java EE" or "Debug".
A "perspective" in Eclipse is the set of panes, toolbars, menus, etc. for a particular purpose. There should be toolbar buttons all the way on the right for them.
in order to customize new option in Eclipse, On the top of Eclipse, click on Window, Navigate to > Perspective > Customize Perspective > Menu Visibility > file > new.
now you can customize new Option.
I am using the Lynda.com tutorial Gradle for Java Developers to learn Gradle. In the tutorial, he opens a new project with no template and copies a folder from the exercise files into the new project (I'm not sure if this is relevant to my problem). Without altering the Java class found in said folder, he right-clicks it from the sidebar and clicks "run" from the drop-down menu.
When I right-click it the class, "run" does not appear. Additionally, there is a message at the top of the text editor that says something along the lines of needing to configure an SDK. When I click on it, a pop-up saying something about "1.8" appears, as well as an "OK" button. When I choose run from the top menu, it simply brings up an "edit configuration" pop-up.
Can anyone explain to me why my layout is so different from the tutor's?
Edit: Now I see where my issue came from. The tutor was misleading with his "how to use the exercise files" video. He showed it to be as simple as clicking "open" on Intellij and opening the folder or dragging the folder to the intellij icon, without configuring an SDK. But in the tutorial video I was watching, he did something completely different by creating a new project and pasting a folder within the folder for the video, which actually ended up looking different from the template he used (His project was called GradleLab and he copied the exercise files within it, while all the other exercise files include the GradleLab folder
Here is a screenshot of IntelliJ 2017.3.3 "New Project" dialog box.
Note how the Project SDK popup shows in red text an older release of Java 9 that I physically deleted from my Mac (from the /Library/Java/JavaVirtualMachines folder).
⇒ How do I delete that particular "Project SDK" setting within IntelliJ?
Clicking the "New" button in the upper-right of that dialog lets me add another JVM but does not allow me to delete.
Select Project Structure from the File menu.
Click SDKs in the left column and select the SDK you want to remove.
Click the Delete icon (the minus sign).
Click Apply (essential!) then OK to close the Project Structure window.
I just tried this in 2017.3.3 and it worked fine. The JetBrains documentation states that you can also click Alt+DELETE instead of clicking the Delete icon, but that didn't work for me.
Here's the screen:
To be clear, this action means that the SDK you just removed will no longer be available when you try to create a new project; that SDK will have to be added again on an individual project basis if needed.
I have a really annoying problem in Eclipse java neon, when i do a right click on a package in order to create a new class or in any area, Eclipse don't show me proposition like class, package or even project but only a incomplete menu unusable
I have already launch eclipse with -clean but not help
An illustration of the problem, I also notice that Eclipse is in... debug mode ? (upper left corner)
Select menu Window -> Perspective -> Customize Perspective....
Select Menu Visibility tab.
Select tree node File -> New.
Toggle check box of menu items as you like.
You are in the Debug Perspective (see What is a Perspective?). You can switch back to the Java or JEE perspective (where most development activities are typically performed) by using the perspective switcher toolbar in the upper-right corner of the Eclipse window.
I suggest you learn about the use of Perspectives in Eclipse.
Try
File --> New --> (Then choose what you want)
Specify the Source folder and package.
When I don't find something in the menu there, I just click on Other... and search for whatever I want to create. Regardless of the Perspective.
Of course it could more practical to customize the Perspective to include the frequently used items as mentioned.
Is there a way in Eclipse, to see empty parent packages? I have an issue freely viewing/accessing package new.galaxywar.client.resources.images.game that only contains 2 sub-packages:
I tried creating that package again, because I thought that i might not have it in my eclipse project, but it won't let me:
How do I prevent "views from filtering empty parent packages"?
In "Project Explorer" panel, click on the "View Menu" button (represented as a triangle).
Then go to "Customize View..." and deselect "Empty parent packages".
This should do the trick.
While I'm not sure how to perfectly solve the problem, I do know that you can still access the package if you try creating a new file in there, for example package-info.java.
Try doing that by starting to add a Class as usual, but specify the package to be the package you can't seem to access in the Package Explorer.
In recent versions of Eclipse, the steps in the accepted answer have slightly changed:
In Project Explorer panel,click on View Menu button
Then click on Filter
Deselect Empty Parent Packages
Eclipse IDE for Java Developers |
Version: Photon Release (4.8.0)
Build id: 20180619-1200
In Eclipse Version: 2019-03 (4.11.0)
On the Project Explorer tab press the triangle in the upper right corner.
In the menu choose Filters and Customization...
In the Filters and Customization menu unmark Empty packages and Empty parent packages.
Press OK
Now you should see the empty packages.
It's been 6 years since someone answered this question, and in the present day there is way more easiest methods to show hidden parent packages: "View menu" -> "Package presentation" -> "Hierarchical".
View menu of project explorer
Package presentation option
Hierarchical option