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
Related
I have a simple Eclipse Java project that consists in only one Class made with Eclipse's Window Builder (Swing class). The coding was made on my notebook, and saved on cloud, so I could access It from my home's computer.
When I opened this project in this home computer, I noticed I had not installed Window Builder on it yet, so I installed and restarted Eclipse.
The problem is that even tho I installed WB, Eclipse still doesn't show the Design tab on this class. Did I miss something?
Simply restarting Eclipse a couple times somehow made it work, everything good!
Missing Source/Design tabs
When you open your Swing Project, follow these steps to show Source/Design tab:
Right click on your file Swing.java for example
Choose open with Window Builder editor
This will bring you back the Source and Design Panels
When I create a new Java project or open an existing one, IntelliJ doesn’t highlight any of the text nor does it suggest anything. All the code is 1 single color. I’ve marked my src file, made sure power safe is off, made sure highlight is enabled, and even reinstalled IntelliJ CE. I’ve also disabled all plugins. Any suggestions is appreciated.
picture here
Your screenshot shows that the file is not recognized as a java source file.
Go to Preferences -> Editor -> File types
Scroll down in the list of Recognized File Types and click Java.
In the list of registered patterns make sure it shows *.java.
Also ensure the file is not marked in the Ignore files and folders section at the bottom of this preferences panel. Perhaps you added it by accident (with some shortcut).
Also, while reinstalling IntelliJ, you have probably imported your previous settings. With it, you inherited this issue.
If this doesn't help, please share a screenshot of your project/module structure and setup.
Last but not least, try to create the file using the context menu. E.g. try to right click on your src folder and select new and select Java class or Package from the options. Would be good to check anyway, to see if these are valid options. If they do not appear here, it indicates the project setup is erroneous.
Solved! Thanks to #yole I did the following 'make sure that the *.java extension is listed in "Registered patterns" for the Java file type in Settings | Editor | File Types".
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
This problem continues to persist and I am hoping that someone who understands Eclipse can help.
Previously, I worked on a project that involved reading files. However, I am complete with that project and now my current project keeps reading the previous file.
I just want to run programs seperate from the personalityy.java file
I have already tried run -> configuration
Screenshot
It reads from personalityy.java
You're pretty unclear about what exactly you're trying to do, but in short, to run a java application, right-click on the source file in the explorer and select "Run As" and "Java Application".
It looks like you are new to Eclipse. Don't worry the problem is pretty simple. The Green run button on the menu bar will run the last run program by default. You probably have the new file open and you are using the run button in the menu to run. What you have to do is.
Open the file you want to run.
Right click inside the new file in text editor
Click Run as
Click Java Application.
In the future you can click the black down arrow beside the run button to select which program you want to run.
How can I create a RCP application, which looks exactly like the Eclipse IDE with all menus, views, dialogs...?
Here is one example: http://richclientplatform.blogspot.com/2007/12/oil-and-gas-industry-using-eclipse.html
I followed Lars Vogel's tutorial to create a simple RCP application: http://www.vogella.de/articles/EclipseRCP/article.html.
... what are the next steps?
The ide bundle provides you with classes and extension points that allow you to use the workspace metaphor but it does not include the extensions that add all the functionality that you would see in the Eclipse IDE.
Since each bundle in an RCP app application adds menu, views, and dialogs the way to get your application to look like the IDE is to include all of the bundle that come with the IDE.
Usually you start with a pretty bare application like something tutorials that Vogel (who I find puts out good tutorials) puts out describe. Then when you find something that you want to add you research which bundle provides it and you add that bundle. As you do this your application will grow in functionality without picking up functionality your user does not need.
EDIT: Let me walk you through creating a simple RCP application.
Create a new Project by going to File -> New -> Project
Select Plug-in Project
Set the Project name to com.mydomain.rcp
Click Next
Under Rich Client Application select Yes
Click Next
Select RCP Mail Template
Click Finish
You now have an RCP app with some functionality. Next we will run it:
Select Run -> Run Configurations...
Select Eclipse Application on the left
Right click and select New
Look for Program to Run/Run a Product. Select com.mydomain.rcp.product
Click on the Plug-ins tab
Find Launch with at the top and select plug-ins selected below only
Click Deselect All on the right
In you list of plug-ins select com.mydomain.rcp
At the bottom de-select Add new workspace plug-ins to this launch configuration automatically
On the right click on Add Required Plug-ins
On the bottom click on Run
The application should be running the sample mail application. Go ahead and close it down. Now let's add a plugin so we can get the Search menu to show up like it does in the Eclipse IDE.
In your com.mydomain.rcp project open up your plugin.xml file
Click on the Dependencies tab
Under Required Plug-ins click Add...
Type in org.eclipse.search
Select org.eclipse.search (not the source one)
Click OK
Save the plugin.xml file
From the menu select Run -> Run Configurations...
Click on the Plug-ins tab
On the right click on Add Required Plug-ins
On the bottom click on Run
You should now see the Search menu with the File Search option just like the IDE has. You will not see the Java Search or the Plug-in Search though because we did not add the appropriate JDT or PDE plugins containing those additions. Hopefully this gives you an idea how to add new plugins.