Solved

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

Posted on 2013-10-24
5
660 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference between sorce folder and folder in eclipise 3 40
printf performancy 11 83
intellij error 2 27
Tomcat 9 + java 8 error while trying to deploy a war file 2 681
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

685 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