Friday, November 27, 2009

Eclipse GWT_EXTERNAL_BROWSER

Problem :


When you compile in hosted mode, you have the following error :
[ERROR] Unable to find a default external web browser

[WARN] Try setting the environment variable GWT_EXTERNAL_BROWSER to your web browser executable before launching the GWT shell



Solution :


In eclipse, Go on Run -> Run Configurations.Then, choose your google's project and click on Environment.The last thing, you have to do is to add the variable GWT_EXTERNAL_BROWSER with the value firefox.





Tuesday, November 24, 2009

Java 7 Closures news

Since Devoxx09, there are many proposition and talk about closures.
I you want a summary about this, go on : Summary about closure proposals

Friday, November 20, 2009

GWT : static ressources and public directory


Problem


I've just began GWT's learning and I met a problem with static resources.Where can I put my image, css or js file.On the web, I found that you have to put it on public directory.But where create this public directory ?

Solution

You have to create a public directory at the same level of the *.gwt.xml file.In my example, it's in src/com/google/gwt/sample/stockwatcher(see image below).
Then when you will run run the app, files will be copy in the war directory automatically.
The last thing you have to do is to put the path of the resources in the html file similar to that :

"<"link type="text/css" href="stockwatcher/css/start/jquery-ui-1.7.2.custom.css rel="Stylesheet"">"
"<"script type="text/javascript" language="javascript" src="stockwatcher/js/jquery-1.3.2.min.js""/" "<"script type="text/javascript" language="javascript" src="stockwatcher/js/jquery-ui-1.7.2.custom.min.js""/>"

Here is a real example (click on the picture to enlarge) :



Google OS is available ! Chrome OS

Here is a fresh news : Google announced that its OS is available.
This is an Operating System based entirely on Internet and so on Chrome browser.


- Every software are on internet

- Startup instantly when you push the power button.
- Security : Data are crypted.


Source code is available and you can build it.
Note : The source code is open source.


More infos on
:
Youtube
Chrome Project

Thursday, November 19, 2009

Java 7 : Closures will be in jdk7 !


A big surprise today at the Devoxx.Closures will be on jdk7 (Some time before Sun says that closure will be not at the jdk7).
We don't know yet witch syntax will be choose.There is several proposals
(list ).But one seems to be prefer (Neal Gafter).

Friday, November 13, 2009

Go : a new Google programming langage system

Google has announced a new system programming langage. See GO on blog.
The goal of this programming langage is modernize system langage (like C) with library dependencies, with thread management, with garbage collector, with native multithread management, with better syntax...
In the FAQ, Google say that it use Go internaly but not in production.

So we can see that Goole make many langage and news (see also
SPDY).
Note, it's just before the arrival of the Google OS ...


Annonce Google
Site web Langage Go

Maven : Advantages and drawbacks

Yesterday, I went to the Marseille JUG.The subject was "About Maven" presented by Arnaud Héritier.I didn't know a lot Maven So here is the summary, i can do :

Advantages:



- Manage library version.
It's a major advantage ! Maven manage library version whereas Ant didn't.Before, all the library was in the lib dirctory.Now Maven can tell for a version, the library it used.

Note : Ant can do that with Ivy

- Maven Conventions.
- It exists plugins on IDE like Eclipse, Netbeans, intellij idea


Drawbacks :



- Library repositories are not always safe.
In maven, you can define one or severeal repositories of library on the net.However, sometimes if the management of library are bad, you can have compile error or differences between jar on different repositories.
- Maven Conventions.
- Learning Maven is long in comparaison of Ant.
- http://blog.codeeg.com/2008/06/28/25-things-i-hate-about-maven/

To conclude, Maven is became the build tool.Enterprise use it more and more.
The major drawback is that you need to learn it but, at the end you will have benefit with maintenance and use.That's not the case of Ant.



Tuesday, November 10, 2009

Test Google Web Toolkit

Today, I make a web site for my association.I decide to make this web site with GWT.It permits me to know GWT.
First things we can say is that Google give you all you needs :
- Good doucmentation.
I've begin to read it.I can say that the documentation is easy to understand and it has no error : GettingStarted.
- An eclipse plugin.
- You can deploy your web app free whit Google (GoogleAppEngine)

An other important point and that you use java !



Sunday, November 8, 2009

Java Certification SCJP : String

Here is common question about String.


Exercise :

public class test {

public static void main(String args) {
String s = "toto";
System.out.println("Size of s:" + s.length);
}
}


What is the result ? (choose one)

A Size of s:4
B Size of s:3
C Compilation fails
D An exception is thrown at runtime














Solution :

The answer is C because String have a method that's call length() but it has no attribute length.
Note that it's really easy to be a mistake here !