Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, 18 May 2012

Great Cross Platform Programmer's Editor

I am always looking for good tools. When I just need a text editor, I typically use JEdit. It is free, open source, and since it is written in Java, works well on Mac, Linux or Windows. However, JEdit is not always the simplest tool to configure and use.



Recently I ran across Sublime Text. For $60, you get a really nice editor, with an easy to use interface. Plus, the editor is skinnable so you have a number of options on how the editor and your code actually look. It has nice code completion features with customization options. Top that off with the fact it runs on Windows, Mac OS X, Linux. It is definitely worth a look.

Friday, 2 March 2012

Really cool features added to Java Tutorial

Duke WavingHey Java fans! There are two really great features that have just been added to the Java Tutorial.



First, a guide to content that will help you student for the Java Certification example: Java Certification Prep



But wait there is more! The Java Tutorial is now available in ePub format. Time to load it up on your iPad people! Java Tutorial in ePub format



Enjoy!

Tuesday, 1 June 2010

Java Wrong Name Error when Running a class

Duke Waving

Problem: You have compiled a class from a source file in a package. For example:

javac mypackage\MyClass.java



The class compiles fine. But when you go to run it you get an error.

java mypackage\Myclass



results in:

Exception in thread "main" java.lang.NoClassDefFoundError: Myclass(wrong name: mypackage/MyClass)



Solution: You can not use a backslash in a Java class path. Instead you need to use a forward slash.

java mypackage/Myclass



Better yet, as a best practice, always use a dot to specify the class name. This avoids the slash issue altogether.

java mypackage.Myclass



That should solve any future runtime errors for classes in a package.

Tuesday, 1 December 2009

Static Factory Methods vs Constructors

Duke WavingI was looking for a good explanation for the advantages of using static factory methods instead of constructors. The Redemption in a Blog site has a very good explanation. It just goes to should that old blog posts don't fade away, they just get better with time. :)