Package presentation in Java EE perspective in eclipse - java

I have a problem when switching to my Java EE perspective in eclipse indigo.
In my Java perspective I have this layout:
But when I switch to Java EE perspective I get this:
I have tried this and this unsuccessfully. I want to have the first layout in the Java EE perspective. Is there a way to do it?

Package presentation can be found here :

These are my settings in eclipse 4.2 which result in the layout you want:
- folder presentation: grouped
- package presentation: flat

You can switch this using the "Package Presentation -> Flat" from the drop down menu in the project explorer.

You can also import your project by using "import existing maven projects" . It will then configure the folders to be flat.

The above answers do not really solve the real problem that most noobs experience in Eclipse. So I thought I would add an answer to this question since the questioner resolved to reinstalling eclipse which is not necessary nor a viable solution. The real issue is that when you created or rather imported this project, you picked the option to create a Project in eclipse, not a Java Project. If you pick Project, it creates it as a filesystem looking directory structure similar to what you see in windows explorer. To fix this, just re-import your project from the workspace as a "Java Project" and you can change the package structure as flat or hierarchical as per your viewing pleasure.. Hope this helps.

Related

How to make a Java project the default in Eclipse

I've been making small prototype programs recently, and it bothers me to have to set up the project each time. I have to import all the libraries, copy over an identical main class, then write a lot of code that I have already written before. Is there any way that I can save a project in Eclipse as a template, so that whichever programs I use the template for will have an identical classpath and original classes?
Thanks in advance.
You can copy (and paste) a project. Right click on the project (in the project navigator), and then paste. (CTRL+C then CTRL+V - or adjust if on on a mac)
I realize this is not as nice as a default, but it is a lot simpler than moving to maven.
I think you want the same logics as the maven archetypes do. So you have to create your own archetype as a template for new programs and start with it.
Have a look over here - http://maven.apache.org/guides/mini/guide-creating-archetypes.html - this is a guide how to implement this.
Maven is the most robust answer (and I'd recommend at it as well). However, a more direct approach is to maintain an Eclipse workspace as a template. You can put the workspace (.metadata) folder in same location as your template projects. Then copy that folder structure to any new projects, including the .metadata folder. Switch workspaces to work on different projects.

Importing a checkout svn source code as java project in eclipse

I have a project whose source code is hosted in svn and I have checked out the source code already say in a folder "myfolder". The directory structure of my code is as follows:
myfolder/trunk/src/ is where my code resides. Now I create a Java project using eclipse using File -> new java project with the location to be myfolder/trunk/src/. When I do this, all the package structure gets changes and I have errors in my sources files.
It would be great if somebody can tell me what is the correct way to do this. I have found some articles on the internet, but the more I read the more I get confused.
Thanks
Vandana
You should have probably chosen to Import Existing Project into your workspace and you should try that instead. It works great as long as you have your .project file defined. To fix the errors you have now, Create a new src folder in your project and point it at trunk\src, so that it correctly recognizes all your Java files.
You probably should use myfolder\trunk as the root of your project, rather than myfolder\trunk\src. As Perception has mentioned, try to "Import Existing Project" first (rather than start a new project and point it at your source).
First, I assume you already have subversive/subclipse plugin installed in your Eclipse and you have used the right URL to import your source code.
Before checkout your source code, you may change your perspective to Java perspective.
Then you only need to use File-Import-SVN(choose SVN as your import source)-Checkout projects from SVN-Next-Give your project a Name-Finish.
If you have problem about installing SVN plugin, reference is http://subclipse.tigris.org/
http://www.eclipse.org/epsilon/doc/articles/epsilon-source-svn/

How to compare two eclipse installations for missing features?

I have two coexisting installations of eclipse on my machine. One is the plain eclipse and one is STS (Spring Source Tool Suite). For some strange reason (which would be too tedious to explain here) I have to use the plain eclipse. However, I want to import, use some of the plugins that already exist in STS.
Is there a way I can go about achieving this?
If you don't want to scan the filesystem for the plugins, the easier solution is to go to Help -> About Eclipse -> Click on "Installation Details". That should provide you all the installed plugins in Eclipse.
It is possible to install the STS-specific bundles into vanilla Eclipse. You need to follow the instructions outlined here:
http://dist.springsource.com/release/STS/doc/STS-installation_instructions.pdf
Look at the section called "Update site installation".

Open eclipse svn project in netbeans

OK my problem is quite simple
Im about to start working with a team of programmers, and we are using a svn repository to store our code, thy files are set up as Eclipse Project as the rest of my team all like eclipse.
However I am die hard netbeans man, I have tried eclipse Iv given it some time but we do not gel as they say.
So my question is there a combination of plugins /hacks that i can use to access a Eclipse Project from an SVN repository inside Netbeans , without corrupting the eclipse project or causing problems for the rest of my team (I would rather suffer eclipse than do this to them)
Many thanks ^_^
In NetBeans 6.8 under File > Import Project there is both Eclipse Project and Resynchronize Eclipse Projects. I'm guessing this can be used to work together with people using Eclipse.
UPDATE: How the eclipse import function works.
As NA pointed out, there is a way to import your Eclipse projects into Netbeans. However, arguably, you shouldn't be checking in IDE-specific files into your repository unless you can guarantee everybody is using the same IDE. Otherwise, I would recommend only checking in the source code, resources, and additional libraries and keep the specific files on ignore and have each individual setup their own environment.
Another alternative, is to check in the IDE-specific files in a different folder in the repository so that an individual can grab them if they need them.

Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files

I'm a Java noob (but have been programming for 25+ years, and have worked with OO languages from day 1).
All of a sudden I started getting this error:
Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files.
Not sure what caused this condition, and not sure what Java's asking me to do. I'm working in the NetBeans IDE. The last thing I attempted to do is add some binary (image) resources to my project.
In my case the JDK setup in Netbeans was fine. It was just one of those strange Netbeans issues that come out of nowhere.
My fix was:
Clear the Netbeans Cache i.e. delete the folder:
C:\Users\\AppData\Local\NetBeans\Cache\
It means you haven't told netbeans where your Java 1.6 installation is. Go into settings, add the JDK (JDK->Add->New), and select the directory above 'bin' for your JDK16.
This error can occur at two scenarios:
Right click your netbean project -> Properties -> Libraries
After select Libraries , right panel on top you can see "Java Platform" combo box. This Jave Platform is missing for your project. You need to add using Manage Platforms bottom beside Jave Platform combo box.
Even thought scenario (1) is correct it can happen. Because your project has reference to another netbean project in your Libraries. This reference project is missing Jave Platform.
I have Linux in my office and Mac in Home and this problem is frequently when I share projects in github, I solve it removing the build directory and doing clean and build.
Right click on project - Properties - Libraries - Select the correct jdk version from the Java Platform combobox.
NetBeans bug
If your project depends on other projects, open and clean build all of them(that fixed it for me).
Most likely cache-related stuff. Clean up NB cache as suggested by someone before
You should remove the files under private folder in the nbproperties folders.
for me any recommended way early didn't helped, but changing in project Properties -> Source/Binary format to JDK 7, Save than change back to JDK 8 fixed this error

Categories