Solved

auto generate java doc for new file in java (eclipse env)

Posted on 2013-10-24
5
662 Views
Last Modified: 2013-10-31
Hi,

I am working in eclipse , i have created a web project in java.

what i need is whenever i create a new java file the information like

copyright
author
datetime
...
...

should come automatically

How to achieve the above in eclipse?
0
Comment
Question by:Rocking
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39599639
Go into Window -> Preferences and then in the tree on the left, drill down into Java -> Code Style -> Code Templates. Then on the right, open up the Comments parent item and configure whatever you need there. More than likely, for the info that you mention above, you would be looking at either the "Files" or the "Types" entries to be setup. Play with that and see how you go, and if you still have issues, post back here and we can help further.
0
 

Author Comment

by:Rocking
ID: 39601085
i am doing the same but the problem is i need to auto generate the header/comments by rights click the java file, wht i need is the header part should be automatically added whenever the new file is created (i.e no need to do it manually).

Secondly if i need to create a template for java doc which i can use in other project is there any way to do it?
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39604737
I am unsure about the two items that you are asking about. It is hard to understand what you have written. I believe the solution that I posted should fulfil everything that you need.
0
 

Author Comment

by:Rocking
ID: 39612126
Just need to confirm the steps you have provided will add comments(say header ) the moment java file is created or need to manually generate the java doc.
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39613098
Just need to confirm the steps you have provided
Yes they will. Hence why I posted them!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question