Thursday, January 3, 2013

Java Web Start Cache Viewer is not showing cached applications!

I have a Windows 7 64-bit with Java installed (no matter what version it is) and my Java Web Start Cache Viewer is not showing cached applications!
With this 64-bit Windows 7, when I go to Start -> Settings -> Control Panel -> Java, then click at General tab, "View" button, no cached applications are seen, but I've just downloaded and run a jnlp file just a minute ago.
There is something wrong in here.

So, I googled it, and found the solution that I wish to share with you.

1. Run the cmd window from C:\Windows\SysWOW64
2. Download and run again the jnlp with the command: javaws <url of the jnlp file>
3. Type the command: javaws -viewer

Now the cached application loaded from the jnlp file is displayed correctly in this Java Cache Viewer window and you are able to add a shortcut to it from your desktop. Just right click the cached application and select "Install Shortcuts" from the context menu.

That's it!


Monday, December 17, 2012

Whizlabs SCJP 6.0 Simulator "Error parsing question"

If you get an error message at the Whizlabs SCJP 6.0 Simulator saying "Error parsing question" at the start of an exame, ignore it and take the exame again.

If at the end of the exam, you have a message box that does not allow you to check you score, ignore it and go to the "Performance History". From there, you are able to check your score and review your questions.

Sunday, December 9, 2012

SCJP 6 Questions - Question 63

 class C {  
   public static void main ( String ka [ ] ) {  
     while ( false ) {  
       System.out.println ( "Value" ) ;  
     }  
   }  
 }  

What is the output?
1. compile time error
2. prints Value infinitely
3. Runtime Exception
4. None of the above

Thursday, September 27, 2012

SCJP/OCP Java 6 Resources

The Oracle Certified Professional (OCP), Java Standard Edition (SE) 6 Programmer certification is an entry-level credential that validates your skills in the Java programming language.

I'm studying for the SCJP 310-065 which stands for Sun Certified Java Programmer, for Java 6.0.
But, as you know, the Sun was bought by Oracle and the exam code has changed. Now, the official Oracle exam code is 1Z0-851: Java Standard Edition 6 Programmer Certified Professional Exam


I'm reading the Kathy Sierra and Bert Bates book SCJP Sun Certified Programmer for Java 6 Exam 310-065, from McGraw Hill,  and until now everything is clear as crystal - unless for some details that I don't work with in my daily job as a Java Programmer. But I'm learning all these details! From this book I recommend the "Two Minute Drill", that comes in the end of each chapter, that has all the details that you need to know from each chapter.

I also have the book OCP Java SE 6 Programmer Practice Exams (Exam 310-065) (Certification Press), also from Kathy Sierra and Bert Bates, for practicing (these are really hard exams!):


But... who are these two guys?
Why should I read and prepare with their books?

Kathy Sierra is a co-developer of the SCJP exam and Sun's practice exam. She is also a Sun Certified Java Instructor and the founder of the world's largest Java certification website, Javaranch.com.
Bert Bates is a Sun Certified Programmer for Java and has participated in the development of the SCJP exam and Sun's practice exam. He is the coauthor, with Kathy Sierra, of the previous editions of this book.

So, now you can see why these two books are very important for studying for the certification.

Besides these books, I intend to have some Mock Tests that are available online, before going to the exam:
Learning sources:
Schedule Exam at:
Other resources:

Books:

Thursday, July 26, 2012

Recuva - Undelete, Unerase, File and Disk Recovery

Recuva screenshot

There is an excellent freeware tool for recovering lost data called Recuva.
With this tool, you can recover accidentally deleted files, from your Windows computer for FREE!

It's simple and easy to use.

Wednesday, July 25, 2012

mvnrepository.com

Are you looking for a Maven Repository? You've found it here!


A good Maven Repository, where artifacts can be searched, is http://mvnrepository.com/.
This site also shows the dependencies and the search also supports searching by description or group.

Thursday, June 7, 2012

Sonar or FindBugs Critical issue: Performance - Method concatenates strings using + in a loop

This issue arises when there is a String being built in a concatenation loop.
For each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.

Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly.

For example:


// This is bad
String s = "";
for (int i = 0; i < field.length; ++i) {
   s = s + field[i];
}


// This is better - StringBuffer is synchronized
StringBuffer buf = new StringBuffer();
for (int i = 0; i < field.length; ++i) {
   buf.append(field[i]);
}
String s = buf.toString();



//Even better - better performance if synchronization is not an issue
StringBuilder builder = new StringBuilder();

for (int i = 0; i < field.length; ++i) {
   builder.append(field[i]);
}
String s = builder.toString();