Java2Script Update v20100601

Java2Script 2.0 update v20100601 has been released. To download latest released files, please visit https://sourceforge.net/projects/j2s/files/

Updates:
1. Added support of Eclipse 3.6.* Helios, and earlier Eclipse
2. Java2Script sources repository moved to Google Code at http://code.google.com/p/java2script/
3. Sebastian Gurin joined Java2Script and opened source YUI4Java project ( http://yui4java.sourceforge.net/ ), which is based on technologies of Java2Script compiler
4. Added SimpleStore API for local storage
5. Added support of Google Chrome browser
6. Added web mail client demo ( http://kexmail.com/ )
7. Improved web instant messenger demo ( http://webuzz.im/ )
8. Added early support of JFace ( http://demo.java2script.org/jface/ )
8. Other improvement and bugfixes

Java2Script Feature List:

Java2Script Core
—————-
1. Object oriented JavaScript simulator is introduced
2. JavaScript ClassLoader is built inside
3. Eclipse JDT based Java to JavaScript compiler, support Java 1.4 and Java 5 features, including generic, enums, static imports, enhanced loops
4. Support incremental building for Java projects
5. Support Hotspot JavaScript swapping for debugging
6. Support most classes in java.lang.*, java.utils.* and others packages
7. Support native JavaScript through @j2s* Javadoc in Java sources
8. Support creating Java2Script projects by wizard, including Servlet project
9. Support Eclipse 3.3.*, 3.4.*, 3.5.* and 3.6.*

Java2Script SWT
—————
1. Eclipse SWT 3.1 API is ported for JavaScript in modern browsers, Firefox, Google Chrome, Internet Explorer, Opera, Safari
2. Desktop and window manager are built inside
3. Support UI blocking fow SWT’s Shell and Dialog
4. Support SWT deffered layout
5. Support detecting font size change in Firefox

Java2Script AJAX
—————-
1. HttpRequest/AJAX is introduced for both Java and JavaScript
2. Simple RPC API is introduced to call back Java server, which supports Cross Site Scripting
3. Simple and Compound Pipe API is introduced to setup Comet connection to server.
4. Support dynamic class loading for both Java and JavaScript
5. Support Java reflection (early implementation)
6. Support Simple Store API for local storage

Java2Script JUnit
—————–
1. Support JUnit tests both Test Case and Test Suite in text mode.

Java2Script Example
——————-
1. Web instant messenger services, support online web Gtalk (Google Talk), MSN (Windows Live Messenger), Yahoo! Messenger, AIM/ICQ, Jabber/XMPP. Please visit http://webuzz.im/ , http://webuzztogether.com/ or http://demo.java2script.org/
2. Web mail client services, support online web mail, including Gmail, Hotmail, Yahoo! Mail, AOL Mail, and other IMAP/POP3 & SMTP providers. Please visit http://kexmail.com/ , http://webuzz.im/mail/ or http://demo.java2script.org/mail/
3. SWT Tetris Game. Please visit http://demo.java2script.org/tetris/
4. SWT Control Examples. Please visit http://demo.java2script.org/controls/
5. Advanced Image Viewer based on YUI4Java. Please visit http://yui4java.sourceforge.net/yui/ImageViewerFrame.html
6. Early JFace demo. Please visit http://demo.java2script.org/jface/

For more demos, please visit: http://demo.java2script.org/

For more detailed feature description, please visit Java2Script homepage: http://j2s.sourceforge.net/ , https://sourceforge.net/projects/j2s/ or http://java2script.org/

Posted in Java2Script News | 10 Comments

Gmail-alike Web Mail Client “WeMail”

Long time no post.

This time, I would like to introduce you Java2Script powered WeMail ( http://webuzz.im/mail/ ), a Gmail-alike web mail client. WeMail is a general web mail client for all POP/IMAP & SMTP mail providers. So it supports Gmail, Hotmail/Live Mail, Yahoo! Mail, AOL/AIM Mail and others.

WeMail currently provides Gmail demo accounts for demo: after the page is loaded, select “java2script.demo” or “java2script.talk” from email drop-down list and then login. You can compose and send new emails (Drafts are auto-saved). You can read and reply emails. Folder Drafts, Sent Mails, All Mails, Spam and Trash are supported. Setting, Search and Contact is not supported yet.

Screenshot of WeMail Web:
wemail-list

Screenshot of WeMail Desktop:
wemail-desktop

You can also visit WeMail development blog for more screenshots

WeMail is based on Java, JavaMail, SWT and Java2Script technologies, designed by Eclipse & WindowBuilder Pro. Here is WeMail development summary:

  • First, design WeMail using WindowsBuilder Pro designer. Designing UI takes a lot of the time.
  • Second, import JavaMail, separate email jobs into several Simple RPC classes and implement them using JavaMail API.
  • Third, run and debug WeMail as a normal desktop Java application. Everything is about native Java development.
  • Then, use Java2Script plugin to compile WeMail Java sources into JavaScript.
  • At last, “Running as Java2Script Application”, customize a few lines of the generated JavaScript.

Why implementing another Gmail-alike web mail client?

  1. People likes to see Google products powered by GWT’s Java to JavaScript technology. But there is no such GWT-powered Gmail by now. Java2Script powered Gmail-alike web mail client proves this concept. And it only takes less than 2 weeks.
  2. WeMail provides the abilities to use Gmail UI for other mail providers besides Gmail, like Hotmail or Yahoo! Mail. Gmail UI may increase people’s daily email processing efficiency.
  3. WeMail provides people another way for accessing to Gmail, Yahoo! Mail or other mail providers, in cases accessing to certain websites is blocked.

BTW: Along with development of WeMail, there are a few Java2Script updates (compiler bug-fixing and SWT library improvements). Please check it out.

Posted in Java, Java2Script News, Simple RPC, SWT, WindowBuilder Pro | Tagged , | 14 Comments

Java2Script 2.0.0 Released!

We are very pleased to announce that Java2Script 2.0.0 release is available now. Please visit http://j2s.sourceforge.net/ for updates.

Comparing to previous version, 1.0.0, Java2Script 2.0.0 now supports both Eclipse 3.3.* and Eclipse 3.4.*. And Java2Script 2.0.0 has a new feature named “SWT Desktop“, providing Tray widget, task bar and shortcut dashboard. And there is Simple and Compound Pipe APIs to setup Comet connection back to server. Besides these new features, we have fixed lots of bugs in Java2Script compiler, Java core library and SWT library. And we add another demo: an SWT Tetris game.

Java2Script 2.0.0 is much more stable and it is ready for product. WeBuzz.IM is one of products using Java2Script 2.0.0. WeBuzz.IM provide services to those users whose Gtalk/MSN/Y!Messenger/AIM being blocked by firewalls. Compound Pipe technology is used to provide multiple IM login using only one connection, and Java2Script’s SWT desktop provides familiar desktop user experience for users.

And developer Sebastian Gurin joined us in Oct 2008.

Please let us know your thought.

Appendix (Java2Script Feature List)

Java2Script Core
—————-
1. Object oriented JavaScript simulator is introduced
2. JavaScript ClassLoader is built inside
3. Eclipse JDT based Java to JavaScript compiler, support Java 1.4 and Java 5
features, including generic, enums, static imports, enhanced loops
4. Support incremental building for Java projects
5. Support Hotspot JavaScript swapping for debugging
6. Support most classes in java.lang.*, java.utils.* and others packages
7. Support native JavaScript through @j2s* Javadoc in Java sources
8. Support creating Java2Script projects by wizard, including Servlet project
9. Support Eclipse 3.3.* and 3.4.*

Java2Script SWT
—————
1. Eclipse SWT 3.1 API is ported for JavaScript in modern browsers, Firefox, Internet Explorer, Opera, Safari, Chrome
2. Desktop and window manager are built inside
3. Support UI blocking fow SWT’s Shell and Dialog
4. Support SWT deffered layout
5. Support detecting font size change in Firefox

Java2Script AJAX
—————-
1. HttpRequest/AJAX is introduced for both Java and JavaScript
2. Simple RPC API is introduced to call back Java server, which supports Cross Site Scripting
3. Simple and Compound Pipe API is introduced to setup Comet connection to server.
4. Support dynamic class loading for both Java and JavaScript
5. Support Java reflection (early implementation)

Java2Script JUnit
—————–
1. Support JUnit tests both Test Case and Test Suite in text mode.

Java2Script Example
——————-
1. Web IM services in Java2Script ( http://demo.java2script.org/ )
2. SWT Tetris Game ( http://demo.java2script.org/tetris/ )
3. SWT Control Examples ( http://demo.java2script.org/controls/ )

For more feature detailed description, please visit:
http://j2s.sourceforge.net/features.html

Posted in Java2Script News | 1 Comment

Java2Script Desktop

You may already know Web OS, like eyeOS. In fact, those web OSs are web desktop + web services. And there are lots of web desktop styles. And here we introduce Java2Script Desktop, basing on Java2Script SWT technology:

Click to view screen shot in full mode

There are four elements on the above screen shot: Tray Bar (left upper corner), Task Bar (left side), Quick Shortcut Bar (bottom), Window.

This is a prototype design for Java2Script Desktop. Please check it out at http://izuz.net/gtalk/ . Hope to hear your feedback.

Posted in Java2Script News, SWT, Uncategorized, User Experience | Tagged , , | 1 Comment

Cappuccino and Objective-J

Today, I came up with 280 Slides, a web presentation design editor. I was shocked by its pretty looking Mac-like UI at the first glance.

From an interview to 280 Sliders developer, I learned to know that Cappuccino is the framework behind the product. And Objective-J language is introduced so they can port Apple’s Cocoa framework. Cocoa is a framework based on Apple’s own language Objective-C. In fact, 280 Slides’ UI looks like Apple’s Keynotes. And the 280 Sliders’ developers are former Apple developers. Cappuccino parses Objective-J files, which are with file extension .j, convert to JavaScript codes and executes them on the fly.

So, another cross compiler, Objective-C to JavaScript. It is quite worthy for further digging.

And digging into sources, I find that it uses lots of images to make up the whole UI, includes button, scrollbar, window borders and other components. And besides *.j and *.js files, there are some *.plist and *.sj files. *.sj use the same syntax as normal JavaScript. But from the sources, I guess they are compiled and mixed from *.j. Besides the core Objective-J.js, AppKit.sj, Foundation.sj and SlideKit.sj are three important files.

And it is great to hear the news that Cappuccino and Objective-J will be open-sourced at http://objective-j.org/ in the near future.

Posted in AJAX, JavaScript | Tagged , | Leave a comment

Java and JavaScript

Today, I came up with the idea of “Orto: Java in JavaScript“. Well, it is not “Java to JavaScript”, it is “Java in JavaScript”. It is said that java.lang.Thread is supported. But as there is no downloads available, and it is not open source, so I could not test it.

Supporting Thread programming in JavaScript would be cool. Once I spent some time trying to figure out how to support Thread in Java2Script project, but I failed. But I managed to program execute codes asynchronously by using SWT’s Display#timerExec(int, Runnable) or Display#asyncExec(Runnable) instead. So even though I can not use Thread#sleep, I still can do lots of thread things.

And Orto seems to be in a different way to support Thread, the codes it generated look like these:

case 117:orto246[orto247-2]={high:(~orto246[orto247-2].high)
&0xffffffff,low:(~orto246[orto247-2].low+1)&0xffffffff};
if(orto246[orto247-2].low==0){orto246[orto247-2].high++;
orto246[orto247-2].high&=0xffffffff;
orto246[orto247-2].low=0;
}break;

Compiling to Java code into byte-code like script, and loading and running these scripts in “JVM” should be a way to support all Java things. In my opinions, all locks and threads are re-implemented. Performance should be a problem. I know that there is another project called XML11, which is also trying to compile Java codes into JavaScript byte-code.

And recently, I also noticed that there was a debate about GWT Ext or Ext GWT. You may already know that GWT is about compiling Java to JavaScript and Ext JS is a HTML/CSS+JavaScript based UI library. It is interesting to see people combine these two technologies together. And it is more interesting that putting GWT before Ext JS and putting Ext JS before GWT is two different things. You may want ot read Didier Girard’s discussion for a clear idea.

About 2 years ago, when I started Java2Script project, I had to think about its programming model. At that time, people began to wrap existed JavaScript library in Java way. I called it “JavaScript for Java (JavaScript4Java)”, which is quite different from my “Java to JavaScript (Java2Script)”. So “2″ and “4″ is totally different, right?

In fact, I do know that Java and JavaScript are two different language. The reason that I chose Java as the source and JavaScript as the target is that Java is most beautiful and most used language while JavaScript is a world wide supported language. And I am familiar and love Java language. So I created Java2Script. I do believe that C#-to-JavaScript, Ruby-to-JavaScript or Other-to-JavaScript is not a big deal for me. But I may not have energy to make a similar compiler.

Java and JavaScript may be hotter and hotter. Good to see that more and more people is linking Java and JavaScript together.

Posted in Java, JavaScript | Tagged , , , | 1 Comment

Eclipse RAP 1.0 Comes

Eclipse RAP team has just released its 1.0.

The RAP project enables developers to build rich, Ajax-enabled Web applications by using the Eclipse development model, plug-ins with the well known Eclipse workbench extenstion points, JFace, and a widget toolkit with SWT API (using qooxdoo for the client-side presentation). The project has graduated from incubation and released its 1.0 release.

In fact, Eclipse RAP and Java2Script have a lot in common. Both are based on SWT API and have goals to provide ways for developers to share the same base of code for products that deploy to the web and the desktop. Here is overview of Eclipse RAP. And you can also read Java2Script’s overview for comparisons.

And you can also check out Eclipse RAP demo to get more details. It’s interesting to see that RAP and Java2Script have 2 very similar demos: RAP’s RWT Control Demo and Java2Script’s SWT Control Examples.

More discussion may be found at ajaxian.com.

Related link: InfoWorld Eclipse offers AJAX server

Posted in AJAX, Java, Sharing, SWT | 2 Comments

Java2Script Gtalk on Opera Mini 4

It’s amazing to see that Java2Script’s Google Talk get run on Opera Mini 4 inside a mobile phone.

Here is Opera Mini 4′s simulator for you to test its CSS/JavaScript/AJAX compatibilities:
http://www.operamini.com/beta/simulator/

Here are screenshots:
opera-mini-j2s-gtalk-small.png

Zoom in to get a clear look:
opera-mini-j2s-gtalk-zoom-in.png

Login and connect:
opera-mini-j2s-gtalk-connecting1.png

Now we are in:
opera-mini-j2s-gtalk-logined-small.png

Zoom in to get a clear look on friend list:
opera-mini-j2s-gtalk-friend-list.png

But Java2Script Gtalk does not get run as totally correct. It fails to maintain normal connection back to Gtalk proxy server. So after a few seconds, the proxy server closes the connection. Maybe Java2Script Gtalk may fix this problem later. And also I think Opera Mini team may improve its AJAX supports in the near future so nothing need to be modified.

Posted in JavaScript, Opera Mini, Screenshot, Sharing | 3 Comments

Java2Script 1.0.0 Final Release

Here comes Java2Script 1.0.0 final release!

Please visit http://j2s.sourceforge.net/ for more information.

Feature List
==========

Java2Script Core
—————-
1. Object oriented JavaScript simulator is introduced
2. JavaScript ClassLoader is built inside
3. Eclipse JDT based Java to JavaScript compiler, support Java 1.4 and Java 5 features, including generic, enums, static imports, enhanced loops
4. Support incremental building for Java projects
5. Support Hotspot JavaScript swapping for debugging
6. Support most classes in java.lang.*, java.utils.* and others packages
7. Support native JavaScript through @j2s* Javadoc in Java sources
8. Support creating Java2Script projects by wizard, including Servlet project
9. Support loading *.js from Firefox Add-on.
10. Support Eclipse 3.1.*, 3.2.* and 3.3.*

Java2Script SWT
—————
1. Eclipse SWT 3.1 API is ported for JavaScript in modern browsers, Firefox, Internet Explorer, Opera, Safari
2. Window manager is built inside
3. Support UI blocking fow SWT’s Shell and Dialog
4. Support SWT deffered layout
5. Support detecting font size change in Firefox

Java2Script AJAX
—————-
1. HttpRequest/AJAX is introduced for both Java and JavaScript
2. Simple RPC API is introduced to call back Java server, which supports Cross Site Scripting
3. Support dynamic class loading for both Java and JavaScript
4. Support Java reflection (early implementation)

Java2Script JUnit
—————–
1. Support JUnit tests both Test Case and Test Suite in text mode.

Java2Script Example
——————-
1. Google Talk in JavaScript ( http://demo.java2script.org/gtalk/ )
2. SWT Control Examples ( http://demo.java2script.org/controls/ )

For more feature detailed description, please visit:
http://j2s.sourceforge.net/features.html

Posted in AJAX, Java, Java2Script News, JavaScript, RPC, Simple RPC, SWT | 5 Comments

Java2Script 1.0.0 RC Released

FYI:
Java2Script 1.0.0 RC Released! Please visit Java2Script’s home page for more updated information.

And Java2Script 1.0.0 Final Release will be available at the end of this September.

New and Noteworthy
==================
Java2Script Core
—————-
1. Eclipse 3.3 supported
2. Replace Java builder with Java2Script builder for Java2Script project
3. Hotspot supports for debugging.
4. Bug fixes.

Java2Script SWT
—————
1. Bug fixes.

Java2Script AJAX
—————-
1. Update Simple RPC from 1.0.0 to 1.0.1
2. Bug fixes

Java2Script Example
——————-
1. Google Talk’s Java2Script copy updated ( http://demo.java2script.org/gtalk/ ).

Posted in Java2Script News | Leave a comment