Whenever I create a new Java file in Eclipse and check off the option to add public static void main(String args[])
, this code is generated:
public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub } }
How do i:
@param args
commentIf you also don't like the TODO comments you can change the templates via: Window -> Preferences -> Java -> Code Style -> Code Templates. In the code tree you have the templates. Select for example Code → Method Body and press “Edit” to edit this template and to remove the todo comment.
Simply go to: Window - Preferences - Java - Code Style - Code Templates - Comments - Types - Edit... and change ${user} to whatever you want. Also go to: Window - Preferences - Java - Editor - Templates - @author - Edit... and change ${user} to whatever you want.
Go to Windows->Preferences->Java->Installed JREs. Select Browse and navigate to the C:\Program Files\Java\jdk1. 6.0_21 directory. Eclipse will automatically find the source and associate it with the JDK classes.
The indention is a formatting issue while the comments is a template issue.
The templates are in Window -> Preferences -> Java -> Code Style -> Code Templates. Browse all of them and look for the things you would like to change.
The Formatter is a little bit more complicated. You find it under Window -> Preferences -> Java -> Code Style -> Formatter. There are tons of options there but I'll just answer your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With