How to increase Tomcat heap size
To adjust the tomcat heap size, edit $CATALINAHOME/bin/catalina.sh and add this line near the top:
export CATALINA_OPTS=”-Xms512m -Xmx512m”
then restart tomcat. You can verify that it worked by running:
ps -ef | grep java
and looking for the -Xms line in the output
Java IO: Writing to a File
To write to a file:
BufferedWriter outputStream =
new BufferedWriter(new FileWriter("filename.txt"));
outputStream.write("hello");
Java IO: Reading a File
To read a file from disk:
BufferedReader in = new BufferedReader(new FileReader("foo.in"));
while ((strLine = in.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
}
Eclipse: UML Diagram Generator
Soyatec eUML2
Not sure yet if this does anything useful, but it can make basic class diagrams showing dependencies.
Install following these directions
Eclipse: install SVN plugin
- Go to help->software updates
- Install Collaboration -> Subversive SVN Team Provider
- Then go to Polarion website to find URL for SVN Connector Update site
- Add this as a new update site and add a connector (I used SVNKit 1.3)
Eclipse: Enable assert statements
To enable assertions, you need to modify the run configuration:
To enable (make active) assert statements, you must set a flag to the compiler. Go to Run -> Run… -> Arguments, and in the box labeled VM arguments:, enter either -enableassertions or just -ea. Accept the changes and close the dialog.