How to make a default Java project in Eclipse

Recently, I have been making small prototypes, and I have to set up a project every time. I need to import all the libraries, copy on top of the same main class, and then write a lot of code that I already wrote earlier. Is there a way to save the project in Eclipse as a template, so that depending on which programs I use for the template, they will have the same class classes and source classes?

Thanks in advance.

+4
source share
3 answers

You can copy (and paste) the project. Right-click on the project (in the project navigator), and then paste. (CTRL + C, then CTRL + V - or adjust if enabled on mac)

I understand that this is not as good as the default, but it is much easier than switching to maven.

+1
source

I think you need the same logic as the maven archetypes. Therefore, you need to create your own archetype as a template for new programs and start with it.

Take a look here - http://maven.apache.org/guides/mini/guide-creating-archetypes.html is a guide to implement this.

+1
source

Maven is the most reliable answer (and I would recommend it as well). However, a more direct approach is to support the Eclipse workspace as a template. You can put the workspace folder (.metadata) in the same place as your template projects. Then copy this folder structure to any new projects, including the .metadata folder. Switch workspaces to work in different projects.

0
source

Source: https://habr.com/ru/post/1482590/


All Articles