How to open a second package-explorer window in Eclipse? - java

I use Eclipse Neon.3 and work with Working Sets in hierarchial package presentation setting. I use the Java perspective.
And I have two working sets (working-set-new and working-set-old) for two different projects (project-old and project-new).
For a better refactoring of the old project to the new project I want to show both projects in the package exporer. So I want to open the package explorer a second time and put it next to the other package explorer. This might help me a lot to check which classes from the old project I have already moved to the new project (without scolling).
My question is: Can I open a second package explorer? And when yes how?
Or can I do it another way?

Eclipse uses a singleton model for the views, so I don't think you can open a second Package Explorer view within the same window.
One option is to open a second window so that Working-Set-Old is in the first window and Working-Set-New is in the second window.
Open a second window by clicking on Window -> New Window

Related

Eclipse's Window Builder missing Design

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

IntelliJ asking to configure SDK and "run" won't appear in dropdown

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

Nothing happens when I try to create a new java project on Eclipse

I have downloaded Eclipse classic and when I try to create a new project and finish the new java project wizard, it doesn't show anything, could someone please help?
Once you're done creating a project folder, create a JAVA class. That'll open the editor with a Hello World program. You can code in that file.
Check in Project explorer tab whether Working Set are shown on top. If yes, make sure the working set in which you cretaed the project is selected.
Note, working set is created automatically in project creation wizard. You need to untick the checkbox if you dont want working set.

Can you force eclipse to run/debug another project when a particular one is ran/debugged?

I'm working with Ligdx, an API for cross plattaform game development that by default generates at least 2 projects:
The core project: This is the one you are supposed to work on, where all the classes and logic should be placed.
The desktop project: This one is automatically generated from the core project.
The core doesn't have any class to start it because it's supposed to be started from the desktop (or other platforms) project.
It is also always selected -because its what you are working on- so pressing the "run" or "debug" buttons will attempt to run the core project and not the desktop one and immediately fail thus forcing you to select the desktop project before hitting run/debug. This can get extremely annoying, especially when debugging.
So is there a way to force Eclipse to always run the desktop project?
Rekaszeru's answer to this question shows how to set up Eclipse in order to always launch the previously launched application.
You simply have to go to preferences / run-debug / launching and check the "Always launch previously launched application" box as he shown in the picture he used to illustrate his answer:
This will not force one of the projects to always be launched but it would pretty much solve the problem unless you are working on multiple projects at the same time or you alternate between Web/Android/Desktop.
If Your asking how to start a Core project from already existing project present in the eclipse then all you need to do is Right Click on desktop folder of the project and go over Run As and select Java Application
But if that is not what you have posted for I can only understand that you need to understand how a LibGDX project is deployed.... From Desktop project "In xyzMain.java" file you will have a method call to the core project saying:
new LwjglApplication(new Sample(), cfg);
This is where you'r Sample Class from the core project is called over.
But from the title I get a diff feeling that you wish to add another project to your already existing project...
You can do that by changing the build Path of the project....by including Other proj to the one you wish to compile and run.
Hope this helped you out..
I´m not aware of doing exactly what you have described, but I´d suggest using the Launch Configurations menus and dialgos to do what you want in a similar quick way.
Note that you can configure your launch configurations doing: Run -> Run Configurations... (also Run -> Debug configurations...)
Option 1).
Once you have run your Desktop Project, simply use the Run Drop-down button, which contain your launch configurations:
Option 2).
Save a launch configuration file in your Core project (or wherever you want) using the last "common" tab of the launch configuration dialog:
Then you can simply right-click on your that file to launch your Desktop Project:
P.S: I´d also suggest reading a little bit about run configurations in lars tutorial

Possible to have several instances of Eclipse open simultaneously?

I'd like to know if it's possible to have several instances of Eclipse open at the same time. I'm using it for Java development. I know I can have several files from different projects open at the same time (at least that's what it seems to me), but whenever I try to open a second instance it shows me the following message:
alt text http://img46.imageshack.us/img46/5033/sxbz3mti34afybrafhc32m0.png
Is there any easy way to have several instances of Eclipse open, each one with a different project?
Thanks
Either create multiple workspaces (Preferences / Startup, tickbox to ask which on every startup)
Or more likely, I think Window / New Window will open a second eclipse viewing window on the same workspace.
yes, each on a different wokspace.
Projects and Workspaces in Eclipse are different. A workspace has a set of global settings and then it has a set of projects.
There are two kinds of project. Projects in the workspace and projects outside the workspace. If you use in the workspace projects (for example, by telling eclipse to make a project via a source control checkout), then it can only be in that workspace.
If you create projects outside the workspace, then you can import each one into as many workspaces as you like.
You can make as many workspaces as you like. Each workspace can be open in only one instance of eclipse.
A better answer to have only the resources from certain project in the new Window is by right clicking the project and select "Open in New Window"
You may want to use Working sets.
A common problem in Eclipse is that
your data in your workspace grows and
therefore your workspace is not well
structured anymore. You can use
working sets to organize your
displayed projects / data. To setup
your working set select in the Package
Explorer -> Show -> Working Sets.
I tend to use different workspaces for different contexts, not just working sets. For that none of the answers above is satisfactory, instead you might want to use the "-data" option on the command line. That allows you to specify the workspace to open, if that is different from the already open one, then a new Eclipse instance will be started.
See http://labs.distriqt.com/post/844 for more details.
There is a way. I have several installations of eclipse in separate folders. Each setup for a different language/job and perspective (CF, Java, Birt). Each has its own workspace so they don't interfere with each other. You can work out if your machine can handle the multiple instances.
If I understand well, your problem is that you would like not to see the other projects while working on one. What you could do is close the projects you're not working on, and then in the package explorer, choose filters > closed projects. This way the closed projects no longer appear in the package explorer.
If you want multiple Eclipse instances open on the same workspace (with the same projects) then you want to use 'Window > New Window'. This will even let you drag views from one window to another.
If you want to display different sets of projects in each Eclipse Window then I'd suggest you use set up a 'Working Set' for each combination of projects you want to work with. You can then select a specific working set from within the Package Explorer. You can create working sets using 'File > New > Java Working Set'.
Something else to consider is that a Workspace is more than just a group of projects - preferences are all stored at the Workspace level. This means that it is quite easy for your preferences to get out of sync if you work with multiple Workspaces.

Categories

Resources