I was just testing a Java Applet on Firefox and noticed that either I had to reload the page a thousand times or restart the browser, obviously this results in wasting a big amount of precious time but fortunately there is an easy way to clear your browser's JRE cache:
1. Open the Java console -> Tools -> Web Developer -> Tools -> Java Console
2. Click on "x" to clear the classloader cache and you will get the following message:
"Clear classloader cache ... completed."
Wednesday, January 27, 2010
Thursday, January 21, 2010
JavaFX Eclipse plugin error
If you decided to give it a try to JavaFX using Eclipse you may run into your first problem right after installing the JavaFX plugin for Eclipse and it may look like these errors:
Cannot access java.lang.Object class file for java.lang.Object not found
Invalid assignment
Package javafx.scene does not exist
Package javafx.stage does not exist
First of all make sure that you added correctly the JavaFX SDK to your libraries:
If this is correct then take a look at your ".classpath" file and make sure that the JavaFX entry looks like this:
And not like this:
That fixed it for me ;)
Cannot access java.lang.Object class file for java.lang.Object not found
Invalid assignment
Package javafx.scene does not exist
Package javafx.stage does not exist
First of all make sure that you added correctly the JavaFX SDK to your libraries:
If this is correct then take a look at your ".classpath" file and make sure that the JavaFX entry looks like this:
<classpathentry kind="con" path="com.sun.javafx.eclipse.core.classpath.SDKClasspathContainer"/>
And not like this:
<classpathentry kind="con" path="com.sun.javafx.eclipse.core.classpath.SDKClasspathContainer/reserved/desktop"/>
That fixed it for me ;)
Tuesday, January 12, 2010
Simple Spring 3 tutorial
Here goes a tutorial to get your feet wet with a (really) simple Java Application using the latest version of Spring.
1- Create a simple Java project named "SimpleSpring3"
2- Create a "lib" in your project right under your "src" folder, then download the latest Spring version and copy the jars to "lib". Also copy "commons-logging.jar" located in the following location "projects/spring-build/lib/ivy" in the unzipped Spring file. Your library should look like this
3- Create a "SimpleSpring3" java class in the "com.greensoft" package, this class will contain one simple "sayHola" method that prints "Hola Spring 3.0!!" in the console
4- Create the Spring config "SimpleSpring3.xml" file located in the "src" folder
5- Add the following code to the Spring config file
The code in the config file defines a bean that can be accessed later on from our test file using the bean factory
6- Create the test file "SimpleSpring3Test" and the following code
In the above code we use XmlBeanFactory to get access to our config file "SimpleSpring3.xml" in order to get our "SimpleSpring3Bean" object.
7- The final project structure should look like this
8- Execute the code by right clicking on the test file "SimpleSpring3Test" then --> Run As --> Java Application" and you should get the following output in the console
simple, right? I hope it was useful for someone out there, that's it for now ;)
1- Create a simple Java project named "SimpleSpring3"
2- Create a "lib" in your project right under your "src" folder, then download the latest Spring version and copy the jars to "lib". Also copy "commons-logging.jar" located in the following location "projects/spring-build/lib/ivy" in the unzipped Spring file. Your library should look like this
3- Create a "SimpleSpring3" java class in the "com.greensoft" package, this class will contain one simple "sayHola" method that prints "Hola Spring 3.0!!" in the console
4- Create the Spring config "SimpleSpring3.xml" file located in the "src" folder
5- Add the following code to the Spring config file
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="SimpleSpring3Bean" class="com.greensoft.SimpleSpring3" />
</beans>
The code in the config file defines a bean that can be accessed later on from our test file using the bean factory
6- Create the test file "SimpleSpring3Test" and the following code
package com.greensoft;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
public class SimpleSpring3Test {
public static void main(String[] args) {
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
"SimpleSpring3.xml"));
SimpleSpring3 simpleSpringBean = (SimpleSpring3) beanFactory
.getBean("SimpleSpring3Bean");
simpleSpringBean.sayHola();
}
}
In the above code we use XmlBeanFactory to get access to our config file "SimpleSpring3.xml" in order to get our "SimpleSpring3Bean" object.
7- The final project structure should look like this
8- Execute the code by right clicking on the test file "SimpleSpring3Test" then --> Run As --> Java Application" and you should get the following output in the console
simple, right? I hope it was useful for someone out there, that's it for now ;)
Sunday, January 10, 2010
Windows Movie Maker app on Linux
I was about to upload a video on YouTube for the first time (ever!) and I noticed that I was missing Movie Maker type of application in Linux, After searching for a few minutes I found this post about "Top 10 Free Video Editors for Ubuntu Linux", well I decided to try some of them.
if you want a quick recommendation for a simple app, go for Avidemux, in case you are looking for more advanced features go for Cinelarra. Finally Kino maybe somewhere in between.
if you want a quick recommendation for a simple app, go for Avidemux, in case you are looking for more advanced features go for Cinelarra. Finally Kino maybe somewhere in between.
Sunday, December 13, 2009
Smb4k "org.freedesktop.DBus.Error.NoReply" problem in Kubuntu Karmic Koala
I was trying to start Sbm4k today and after running the command I noticed that the application was doing nothing besides creating an entry in the task bar that disappears in a while. After executing Smb4k from the console I got the following error:
Error message was: "org.freedesktop.DBus.Error.NoReply" : " "Message did not receive a reply (timeout by message bus)" "
Well it seems that there is a bug related to this problem in launchpad that has been fixed but obviously doesn't work in my system and after reading for a while I found the following suggestion:
"remove the ~/.kde4/share/apps/smb4k/custom_options.xml"
Smb4k is running on an infinite loop mounting things on startup. In my system I couldn't find such file and I noticed that I have the fixed version of this application as described in the launchpad bug, but since this is the first time I run Smb4k since the update, the old setting that was causing the bug was still being used and it was trying to remount old bookmarked locations on startup hence falling in the infinite loop.
The solution in my case was to rename the bookmark file before starting smb4k:
"/.kde/share/apps/smb4k$ mv bookmarks.xml bookmarks.xmlBAK"
Then changing it back to its previous name, I hope it helps ;)
Saturday, November 28, 2009
Eclipse button problem with Kubuntu 9.10 (Karmic Koala)
I ran into this issue while installing the Google App Engine... a quick description of the problem is that some buttons in Eclipse were not responding (doing nothing) after I upgraded to Karmic Koala, after checking the log file, network connection settings and some other things that didn't work I decided to ask the oracle (Google) about it and after a while I found a simple and quick solution here.
Just create an executable file with the following content:
#!/bin/sh
export GDK_NATIVE_WINDOWS=1
/opt/eclipse-3.5/eclipse
Now back to coding ;)
Eclipse Galielo and Google App Engine Plugin
I just installed Galileo and I went straight to the update site to install Google App Engine plugin but for some reason after adding the site (
http://dl.google.com/eclipse/plugin/3.5) and following the instructions, Galileo simply didn't do ANYTHING after I clicked on the "Next" button, anyway I found the zip files here and it is just as simple as any other plugin.
Download the zip file here for you version.
Unzip it at the "
dropins" folder in your Eclipse (Galileo) directory.
Restart Eclipse
That's it ;)