Navigation |

November 19, 2008

Java vs. JavaScript

Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems. JavaScript was created by the fine people at Netscape. JavaScript is a distant cousin of Java. It is also an OOP language. Many of their programming structures are similar. However, JavaScript contains a much smaller and simpler set of commands [...]

Filed by Paul Gu at November 19th, 2008 under Programming
No comments on this post yet

September 3, 2008

Difference between a Java interface and a Java abstract class

Methods of a Java interface are implicitly abstract and cannot have implementations. A Java abstract class can have instance methods that implements a default behavior. Variables declared in a Java interface is by default final. A Java abstract class may contain non-final variables. Memebers of a Java interface are public by default. A Java abstract [...]

Filed by Paul Gu at September 3rd, 2008 under Java
2 persons have commented this post

July 19, 2008

6 Common Errors in Setting Java Heap Size

Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them:     * Missing m, M, g or G at the end (they are case insensitive). For example,       java -Xmx128 BigApp      java.lang.OutOfMemoryError: [...]

Filed by Paul Gu at July 19th, 2008 under Java
No comments on this post yet

Increase Java heap size

If Java runs out of memory, the following error occurs: Exception in thread “main” java.lang.OutOfMemoryError: Java heap space This can have two reasons:     * Your Java application has a memory leak. There are tools like YourKit Java Profiler that help you to identify such leaks.    * Your Java application really needs a lot of [...]

Filed by Paul Gu at July 19th, 2008 under Java
No comments on this post yet

July 18, 2008

Debugging Tomcat as an External Tool from Eclipse

You can also configure Eclipse to be able to start and stop tomcat as a program (this approach also seems to work well on Windows). To configure Eclipse to be able to start and stop tomcat: If you have not already done so, set a breakpoint somewhere in your code (preferably something not associated with [...]

Filed by Paul Gu at July 18th, 2008 under Java
No comments on this post yet

Setting Up Tomcat For Remote Debugging

To configure tomcat to allow remote debugging, start tomcat using the catalina startup script (from your tomcat home) instead of the normal startup script like so (tomcat must be stopped before you can change over): WIN: set JPDA_ADDRESS=8000set JPDA_TRANSPORT=dt_socketbin/catalina.bat jpda start UNIX: export JPDA_ADDRESS=8000export JPDA_TRANSPORT=dt_socketbin/catalina.sh jpda start We recommend adding this stuff to your startup [...]

Filed by Paul Gu at July 18th, 2008 under Java
No comments on this post yet

January 8, 2007

The easy way to install and configure Java SE and Java EE.

Today, we had a professional class called Java EE Architecture and Enterprise JavaBeans, and we learned how to install both JaveSE and JaveEE, and configure them. It’s a little bit complicated from professior’s notes. After I did the installation, I summarized the following three steps and make the installation easy. Download both package which are [...]

Filed by Paul Gu at January 8th, 2007 under Windows
No comments on this post yet