How To Install Sun JVM (JDK 1.5.x) on Linux / Fedora Core in 5 Simple StepsDecember 26th, 2006 Install Sun's Java Virtual Machine ( J2SE(TM) Development Kit 5.0 Update 9 ) on Fedora Core / Linux platform in 5 simple steps. The procedure is geared for users having access to Linux box from ssh / telnet only as in a vpn / dedicated web hosting.
Java Software: 1-Line Sort & Uniq UtilityOctober 18th, 2005 I had to sort and uniq (create a unique set of strings) a large list with lots of duplicate. My options were to write it in Java or download cygwin and run: cat file | sort | uniq > result
Cygwin download never works for me.
How to Compile Java Source within Java ProgramMarch 26th, 2009 This small trick will tell you how you can compile a java source file from another java file on the go. You do not need to run it on a different page and compile it there and then get back to this program.
Program (Source Code) to Trim Whitespaces from Files...April 20th, 2008 PHP is not only a very competent web development language (and part of LAMP stack). It is also a very capable language for writing (command line) scripts.
How To Connect To CVS Via Proxy ServerFebruary 10th, 2007 CVS is commonly used by open source project to provide access to their source code. Here is a simple way how you can connect to CVS server from behind a proxy server.
How To Install JDK 6 / Java SE 6 (+ Tomcat) in Fedora Core 6 / Fedora 7 in 5 MinutesAugust 7th, 2007 Fedora Core developers make it rather hard to install and properly configure Sun's JVM. All said and done Sun's JVM (comes with JDK) is the best JVM implementation out there; not to mention that it is the reference implementation.
Copy to and Paste from Clipboard: A cross-platform solution in JavaNovember 1st, 2004 Copy to and paste from clipboard on command line using these nifty java utlities.
Sun Open Sources Java (April Fool)April 1st, 2006 In a significant (read earth shattering for Java community worldwide) move Sun has announced their decision to open source Java technologies. The JCP will be disbanded in favor of open source bazaar model.
How To Change Java Compiler in Ant on Fedora Core / LinuxJune 22nd, 2007 Fedora Core team, in its infinite wisdom, decided to ship a so-called "free" (but essentially useless and crappy; pardon my French) JVM (read gcj) with its installation. Not only that this "free" JVM is integrated with java softwares from Fedora repositories making them pretty hard to use too.
9 Important Tips for Selenium Remote Control (Java client) - Test ToolApril 16th, 2008 Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in many programming languages against any HTTP website using any mainstream JavaScript-enabled browser. Selenium RC is a powerful and simple framework for running (scheduled or manually) automated UI centric regression tests for web applications / services.
The Power of Ant (Build System)August 27th, 2008 I am using Ant (Java based build system) for our project. Ant is an exceptionally powerful build system and should be the only build system you will ever need.
Update On Super Simple Java ORM Replacement in 80 LinesSeptember 13th, 2006 I have been inundated with emails after my article Java Database Framework (ORM Replacement) in 80 Lines of Code, asking for the source code of the framework or if I could release it as open source. I haven't been yet able to individually reply to all of them, sorry.
How To Simulate Telnet Session in JavaFebruary 16th, 2006 Often we come across procedures which need to be performed by issuing commands in a telnet session. It is relatively easy to do it manually but is definitely not suitable for automation.
Guide To Simplified Java Logging using Java Core APIJanuary 17th, 2006 Java comes in with a handy logging package (java.util.logging) which eliminates the need to use external logging packages like Log4J. However it still requires some configuration which makes it cumbersome and repetitive to include in every class.
Code: FIFO List in JavaFebruary 25th, 2006 One of the common questions I hear from Java newcomers is - where is a FIFO list in Java?
Java does have a FIFO list capability built-in with LinkedList and ArrayList, but they are not well advertized. A FIFO interface should at least have:
public interface FIFO {
/** Add an object to the end of the FIFO queue */
boolean add(Object o);
/** Remove an object from the front of the FIFO queue */
Object remove();
/** Return the number of elements in the FIFO queue */
int size();
}
A FIFOList class implementing the above would simply be:
public class FIFOList extends LinkedList implements FIFO {
public Object remove() {
return remove(0);
}
}
I prefer this setup instead of using a LinkedList.remove(0) directly.
September 8th, 2008 at 7:46 am
If you’re coding in Eclipse, you can use “systrace” to print out the Class.Method().
September 9th, 2008 at 4:42 am
Java is still alive ?
September 9th, 2008 at 7:42 am
Is trolling still alive?
September 15th, 2008 at 3:25 am
Probably first is the Main calling class itself and other is the other which we want to debug …
I am not sure
September 15th, 2008 at 7:34 am
Enabling debug when compiling the Java code will also help to understand where an exception is being thrown from in a java stack trace/
The following is the ANT “javac” task:
September 15th, 2008 at 1:34 pm
This is what I understood
Java Doc for ‘getStackTrace’
‘If the returned array is of non-zero length then the first element of the array represents the top of the stack, which is the most recent method invocation in the sequence.’
when I print class name and method name for all the stackTraceElements for current thread
java.lang.Thread
dumpThreads
java.lang.Thread
getStackTrace
com.bharat.SimpleTest
main
Third element is where ‘Thread.currentThread().getStackTrace()’ is called.
so we are using the number 2
I believe by using the above statement we are accessing the Exception stack trace which would have been thrown if an exception would had occurred.
September 15th, 2008 at 9:15 pm
That is correct. As the code is within a method we need to use the stacktrace element of the calling code.
March 2nd, 2009 at 6:05 am
write program to convert number to name?
ex:
input: 7
output: seven
June 11th, 2009 at 9:53 am
I would like to know about following given code
import java.*.*
Is there any statement in core java.
please explain me.
June 29th, 2009 at 12:59 am
Thanks for this wonderful addition. Really enjoyed your article. Appreciate people taking the time to write quality work. The
internet is full of bad articles,