Sunday, 7 March 2010

Hello World module with Jigsaw

Following my building Jigsaw post, here are the instructions for a Hello World module:

1. Create the project structure

mkdir -p ~/dev/hello/src/hello/lh/hello
mkdir -p ~/dev/hello/build

2. Create the Main class
use: gedit ~/dev/hello/src/hello/lh/hello/Main.java & 
package lh.hello;

public class Main
{
  public static void main(String[] args)
  {
    System.out.println("Hello Jigsaw!!");
  }
}

3. Create the module descriptor
use gedit ~/dev/hello/src/hello/module-info.java &
module hello @ 1.0
{
  class lh.hello.Main;
}

4. Compile
In ~/dev/hello :
$JIG/bin/javac -source 7 -d build src/hello/module-info.java src/hello/lh/hello/Main.java

5. Create a private modules library
Create a private library so that the module can be removed easily. The private library parent defaults to the JDK library.
In ~/dev/hello :
 $JIG/bin/jmod create -L modules

6. Install the hello module
In ~/dev/hello :
 $JIG/bin/jmod install -L modules build hello

7. Run
In ~/dev/hello :
$JIG/bin/java -L modules -m hello
prints:
Hello Jigsaw!!

Sunday, 7 February 2010

Devoxx 09 Summary

(somehow I forgot about this post, time has passed and my comments are mostly lost in memory)

Devoxx 09 Summary


Conference Day 1

Wednesday November 18th


9:30-11:30      Keynote
12:00-13:00    JDK7 Update
13:30-13:45    Swing & OSGi - please play nice
14:00-15:00    James Gosling on the JavaStore
15:10-16:10    JavaFX
16:40-17:40   
17:50-18:50    Project Coin
19:00-20:00    Java User Group BOF
20:00-             (mostly) French evening

Conference Day 2

Thursday November 19th


9:30-11:30     Keynote (both interresting: fashion and say no)
12:00-13:00   Do you really get class loaders? (should watch)
14:00-15:00   Pro JavaFX - Developing Enterprise Applications (thanks Steven)
15:10-16:10   The JavaPosse.com Live
16:40-17:40   Detecting and preventing bugs with pluggable type-checking (useful, but not exiting)
17:50-18:50   The Modular Java Platform & Project Jigsaw
19:00-20:00   JavaFX Future (next time, review JavaFX and practice a little again before going)
20:00-            (mostly) JavaFX evening

Conference Day 3

Friday November 20th


9:30-10:30     Gaming JavaFX
10:30-11:30   Tapestry 5
11:30-12:30   Project Lombok: Bye Bye Boilerplate

Sunday, 15 November 2009

Building Jigsaw

Last updated: 2013-07-27

In preparation for Devoxx 09, I wanted to play a little with Jigsaw.
Thereafter are the few steps I have followed to build it (based on the build readme for Jigsaw but revised each time I build Jigsaw):


1. Create a new Ubuntu VM in VirtualBox
To download VirtualBox go here and to download Ubuntu (12.04 LTS or 13.04) go there.
I used 2Gb of RAM and 16 Gb of disk. (don't forget to install the guest additions and get the updates for Ubuntu)


2. Get and setup Mercurial
Open a console (Applications|Accessories|Terminal), type:
sudo apt-get install mercurial

3. Download and install the current build dependencies for OpenJDK7

sudo apt-get build-dep  openjdk-7

4. Download and install the current JDK7

sudo apt-get install openjdk-7-jdk

5. Download and install ccache
 This will speed up the build of native parts
sudo apt-get install ccache

6. Get Jigsaw sources
mkdir ~/dev
cd ~/dev/
hg clone http://hg.openjdk.java.net/jigsaw/jigsaw/ jigsaw
cd ~/dev/jigsaw/
chmod u+x get_source.sh
./get_source.sh

7. Set up the environement variablesSource encoding:

export LANG=C

8. Adjustments
2013-07-27, none.

9.  Configure
make sure to be in ~/dev/jigsaw and run:
cd ~/dev/jigsaw
bash configure

10.  make
time for cooking:
make images

11. post-build
Export a JIG enviroment variable to prefix your java commands and so use Jigsaw rather than the default openjdk:
64 bits vm:
export JIG=~/dev/jigsaw/build/linux-x86_64-normal-server-release/images/jdk-module-image/
or
32 bits vm:
 export JIG=~/dev/jigsaw/build/linux-x86-normal-server-release/images/jdk-module-image/
12. running Jigsaw?

$JIG/bin/java -version
should return something like:
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-ludovic_2013_07_27_19_55-b00)
OpenJDK 64-Bit Server VM (build 25.0-b30, mixed mode)
and
$JIG/bin/jmod list -v
should return something like:
jdk@8-ea
  requires jdk.base@=8-ea
  requires public jdk.jre@=8-ea
  requires public jdk.tools@=8-ea

...

jdk.base@8-ea
  requires local optional jdk.desktop.internal@=8-ea
  requires optional jdk.jaxp@=8-ea
  requires local optional jdk.tls.internal@=8-ea
  requires local optional sun.charsets@=8-ea
  requires local optional sun.localedata@=8-ea
  requires local optional sun.resources@=8-ea
  provides java.base@8
  exports
    com.sun.nio.file
    com.sun.security.auth
    com.sun.security.auth.login
    java.beans
    java.io
    java.lang
    java.lang.annotation
    java.lang.invoke
    java.lang.module

...
running Jigsaw modules:

JPS:
$JIG/bin/java -m jdk.jps
or JConsole:
$JIG/bin/java -m jdk.jconsole
 Now is time to play...

Friday, 13 November 2009

Devoxx 09

Devoxx 09

forseen schedule

Conference Day 1

Wednesday November 18th


9:30-11:30      Keynote
12:00-13:00    JDK7 Update
13:30-13:45    quickie OSGi Testing Pax Exam or Swing & OSGi - please play nice
14:00-15:00     James Gosling
15:10-16:10     JavaFX or The Java EE 6 Platform
16:40-17:40    ?
17:50-18:50    Project Coin or Animation Rules!
19:00-20:00    Java User Group BOF ?
20:00-21:00    Update JDK7

Conference Day 2

Thursday November 19th


9:30-11:30     Keynote
12:00-13:00   Using XML with Java: Spoilt for Choice? or Spring Framework 3.0
13:30-13:45   ?
14:00-15:00   Pro JavaFX - Developing Enterprise Applications
15:10-16:10   The JavaPosse.com Live
16:40-17:40   Detecting and preventing bugs with pluggable type-checking or Funky Java, Objective Scala or Deep dive on the Java EE 6 platform with GlassFish V3
17:50-18:50   The Modular Java Platform & Project Jigsaw or Maven Reloaded
19:00-20:00   JavaFX Futures
20:00-21:00   The Modular Java Platform and Project JigSaw ?
21:00-22:00   Maven3 BOF
or 2012 ?

Conference Day 3

Friday November 20th


9:30-10:30     Gaming JavaFX or Java and JavaFX Technology and the Nintendo Wiimote: Just How Much Fun Can You Have?
10:30-11:30   Towards A Universal VM or Modular Web Applications with OSGi
11:30-12:30    Project Lombok: Bye Bye Boilerplate

Sunday, 11 January 2009

Worldclock 0.3 widget for WidgetFX 1.0

After a few issues upgrading to JavaFX 1.0 / WidgetFX 1.0 (the SwingComponent.wrap() does not quite do exactly the same thing as the old Component.fromJComponent(), at least for me the resize does not work exactly the same), I've released version 0.3 of the Worldclock widget.
Also in this release the possibility to enforce the aspect ratio of the world image(s).

Web page: https://worldclock-application.dev.java.net/#Widget
Direct launch: http://widgetfx.org/dock/launch.jnlp?arg=https://worldclock-application.dev.java.net/widget-webstart/launch.jnlp

Enjoy,

Monday, 22 December 2008

Devoxx 08

Devoxx 08

A week at Devoxx (Antwerp, Belgium)

2008-12-08 Day 1 (University Day 1, BOF Day 1)

4:30 Wake up time

6:25 Thalys

8:50 Arrival at the Metropolis (the cinema complex where the Devoxx conference is located [http://www.flickr.com/photos/lhochet/3125426046/ ])

9:30-12:30
JavaFX in Practice
by Richard Bair, Jasper Potts and Martin Brehovsky
[Abstract: http://devoxx.com/display/JV08/JavaFX+in+Practice
Slides: http://www.devoxx.com/download/attachments/1705916/D8_U_08_05_01-PART_1.pdf, http://www.devoxx.com/download/attachments/1705916/D8_U_08_05_01-PART_2.pdf ]
After fighting to get some wifi, I start to listen to the indepth JavaFX presentation,
interesting as it sets the basics of the language,
and it clarify some of my reading on this subject (for the worldclock widget FX [https://worldclock-application.dev.java.net/#Widget ]).
After 3 hours of it, the break is welcomed though!

13:30-16:30
Java Power Tools
by John Ferguson Smart
[Abstract: http://devoxx.com/display/JV08/Java+Power+Tools
Slides: http://www.devoxx.com/download/attachments/1705916/D8_U_08_04_02_R.pdf ]
Actually it was limited to Maven, Hudson and JUnit, this later tools being the one I learnt a few
interresting features of (assertThat and the Hamcrest library), to investigate further, sometime...

16:45-17:15
VisualVM - new extensible monitoring platform
by Kirk Pepperdine
[Abstract: http://devoxx.com/display/JV08/VisualVM+-+new+extensible+monitoring+platform ]
A presentation of VisualVM, nothing new appart from the news that version 1.1 is out

17:15-20:00 walked to the hotel (a bit of an expedition as I got tricked into a wrong path),
initial thoughts this hotel is disapointing and does not warrant its expensive price,
then quick dinner after walking back to the Metropolis via another way

20:00-21:00
SwingX - Alive and Kicking
by Jeanette Winzenburg
[Abstract: http://devoxx.com/display/JV08/SwingX+-+Alive+and+Kicking ]
An overview of the state of SwingX from a technical point of view (politics lefts to the following BOF said Jeanette), particularly of the search and highlight on lists.

21:00-22:00
SwingLabs - further developent
by Richard Bair and Jan Haderka
[Abstract: http://devoxx.com/display/JV08/SwingLabs+-+further+developent ]
JavaFX is Swing 2.0, however it isn't ready for prime time yet, still missing the enterprise components, so for now it is mostly for the 'creative application' (aka flash like apps).
Regarding SwingX some components may be integrated in Java 7.
Also Sun will continue to support Swing.

2008-12-09 Day 2 (University Day 2, Quickies Day 1, BOF Day 2)

9:30-12:30
Java Performance
by Kirk Pepperdine, Holly Cummins
[Abstract: http://devoxx.com/display/JV08/Java+Performance
Slides: http://www.devoxx.com/download/attachments/1705916/D8_U_09_08_01.pdf ]
Kirk Pepperdine and Holly Cummins went to diagnose a non working application using Sun's stack for Kirk and IBM's for Holly,
explaining along the way the different concepts.
Diagnosing:
_ 100% CPU:
* if it is application time: try CPU profiling to see what methods are taking the CPU time
* if it is system time (ie GC time): try profiling the memory
_ Memory leaks:
1. check what objects are surviving
2. check what are the trails
Holly demonstrated the IBM Montioring and Diagnostic tool for Java Heath, however that tool is specific to the IBM's VM.

13:05-13:20
How to JavaFX with Java DB in less than 10 minutes
by Francois Orsini
[Abstract: http://devoxx.com/display/JV08/How+to+JavaFX+with+Java+DB+in+less+than+10+minutes ]
Short introduction on how to get Derby working within JavaFX

13:30-15:00
Advanced OSGi
by Peter Kriens
[Abstract: http://devoxx.com/display/JV08/Advanced+OSGi
Slides: http://www.devoxx.com/download/attachments/1705916/D8_U_09_07_02.pdf ]
A presentation of OSGi services and how to deal with them, including via the whiteboard pattern.
Left the talk at half time, as it was going into excercises which I was not prepared for (no practical experience with OSGi yet),
also it was a good opportunity to go and see the Filthy Rich talk

15:30-16:30
Filthy Rich Clients: beyond Java
by Romain Guy and Chet Haase
[Abstract: http://devoxx.com/display/JV08/Filthy+Rich+Clients%2C+beyond+Java ]
As expected an interesting and enjoyable talk describing how to make cool UI effects for both Android and Flex.

16:30-17:25
Sharding in Hibernate
by Andrew Glover
[Abstract: http://devoxx.com/display/JV08/Sharding+in+Hibernate ]
An introduction to sharding in Hibernate and its inducted issues... (how to indicate on which shard data should go, and how to handle the consequences of it)

17:25-17:55
Profiler, the better debugger?
by Heiko Rupp
[Abstract: http://devoxx.com/pages/viewpage.action?pageId=1377607
Slides: http://www.devoxx.com/download/attachments/1705916/D8_T_09_09_01.pdf ]
The talk showed how to use a profiler to identify the methods used by a program to then go and read the associated code.
Useful when dealing with unknown code to quickly identify the main methods or when the debugger can cause issues (time outs)
However the profiler cannot replace a debugger.

19:15-20:00
Meet JSR Spec. Leads
by Corina Ulescu and JSR Spec. Leads
[Abstract: http://devoxx.com/display/JV08/Meet+JSR+Spec.+Leads ]
A debate by JSR leads and members as to how the JCP could be made more open. For instance how to handle mailing lists, and proposals on those mailing lists, also how to say to no to such proposals.
(blog post by Dalibor Topic [http://robilad.livejournal.com/42289.html ]

20:00-21:00
Building converged VoIP+Web applications
by Vladimir Ralev
[Abstract: http://devoxx.com/pages/viewpage.action?pageId=1377666 ]
A presentation of the SIP servlet and the JAIN SLEE stack, with an emphase on the Mobicent solution which is what the speakers work on.

21:00-21:35
The magic of JXLayer component
by Alexander Potochkin
[Abstract: http://devoxx.com/display/JV08/The+magic+of+JXLayer+component ]
A presentation of the JXLayer component, how easy it is to use it and what extention points it has.
That is a SwingX (well ex-SwingX) component that I should investigate further...

2008-12-10 Day 3 (Conference Day 1, Quickies Day 2, BOF Day 3)

9:30-11:30
Keynote
Welcome by Stephan Janssen
Beatboxer Roxorloops (www.beatbox.be)
JavaFX: The Platform for Rich Internet Applications with Danny Coward (Sun Microsystems) and Co.
[Abstract: http://devoxx.com/display/JV08/JavaFX+The+Platform+for+Rich+Internet+Applications ]
IBM Devoxx RFID experiment Keynote
The first keynote was preceeded by a short show by beatboxer Roxorloops (funnily I came across beatboxing in a Police Academy movie on one of the dutch speaking channels that evening...). The keynote itself was a top 10 of the Java FX features (slides [http://blogs.sun.com/theplanetarium/resource/devoxx/JavaFX_Devoxx08_Keynote_Final.pdf ] -- the versions on the roadmap seem to have changed since the keynote) with for most points a demo by the JavaFX team, in particular of a particularly well done Devoxx version of Swish (better than the original demo IMO).
An interlude by Roxorloops, then the IBM keynote on the Devoxx RFID experiment (our badges had a passive RFID chip and each theater had devices to track who was coming in/out, also the partners could [short] scan the badges). Interresting machinery, though compared to the JavaFX presentation it felt less orchestrated and a bit commercial, which resulted in a live count of the people leaving the theatre...

12:00-13:00
Fingers in the air: a gentle introduction to software estimation
by Giovanni Asproni
[Abstract: http://devoxx.com/display/JV08/Fingers+in+the+air%2C+a+gentle+introduction+to+software+estimation
Slides: http://www.devoxx.com/download/attachments/1705921/D8_C_10_04_01.pdf ]
A very interesting talk from which there is (at least) one thing to take away: "your estimates will be wrong"
(also "estimates are non negociable" or "estimates are an ongoing activity")

14:00-15:00
Introduction to the SpringSource dm Server
by Sam Brannen
[Abstract: http://devoxx.com/display/JV08/Introduction+to+the+SpringSource+dm+Server
Slides: http://www.devoxx.com/download/attachments/1705921/D8_C_10_08_02.pdf ]
As it says on the tin. Its notion of 'library' for OSGi bundles sounds like a good thing.

15:10-16:10
What's New and Exciting in JPA 2.0
by Mike Keith
[Abstract: http://devoxx.com/display/JV08/What%27s+New+and+Exciting+in+JPA+2.0
Slides: http://www.devoxx.com/download/attachments/1705921/D8_C_10_04_03.pdf ]
Introduced the forthcoming features of JPA 2.0 (including some that make it easier to do non standard things with it).

16:40-17:40
Filthy Rich Android Clients
by Romain Guy
[Abstract: http://devoxx.com/display/JV08/Filthy+Rich+Android+Clients
Slides: http://www.devoxx.com/download/attachments/1705921/D8_C_10_09_04.pdf ]
Romain showed a few of the effects that are in the GPhone UI. First time I really had a look at the android code,
it's not bad looking overall, though I don't understand why they force people to have coulours coded via their Hex values...
(and it uses XML for declaratively creating UI... [like Flex])

17:50-18:50
Modularity in Java using OSGi
by Peter Kriens
[Abstract: http://devoxx.com/display/JV08/Modularity+in+Java+using+OSGi ]
Peter Kriens this time went through the history of OSGi, ending with new development on the JDK modularity
(summarised here: http://www.osgi.org/blog/2008/12/project-jigsaw.html )
OSGi has good features, but it certainly could do with annotations and service injection (HK2 I think is a good wrapper for that part).

19:00
chips and beer

19:30-20:00
European JUG Gathering
by JUG Leaders
[Abstract: http://devoxx.com/display/JV08/European+JUG+Gathering ]
JUG leaders talk about how they could get organise themselves to get speakers.
(Peter Pilgrim has a video of the BOF there http://www.vimeo.com/2549534 )

Later, out with some French speaking attendees

2008-12-11 Day 4 (Conference Day 2, Quickies Day 3, BOF Day 4)

9:30-11:30
Keynote
Effective Java Reloaded by Joshua Bloch
The Modular Java Platform by Mark Reinhold
The first keynote by Josh Bloch showed a few items (28, 31, 32, 33, 77, 34, 71) from the second edition of his "Effective Java, Second Edition" book (Now on my bookshelf, with the author's signature).
The second keynote was probably one of the most awaited talk of Devoxx (certainly was for me) as it was about modularity and Java 7.
Mark Reinhold introduced project Jigsaw, actually he introduced it a week before in http://blogs.sun.com/mr/entry/jigsaw, though the live version of the blog entry containted slightly more details, like the requirements:
_ integrate with the VM
_ integrate with the language
_ integrate with native packaging
_ support "friend" modules
_ support for multimodule plugs (something like the 'libraries' of Spring DM server?)
Then he described the current intent for Java 7 (now expected in early 2010):
_ modularisation
_ JSR292: VM dynamic languages
_ JSR203: more new IO
_ JSRTDD: small languages changes (considered)
* safe retrhow
* null dereference expression
* better type inference
* multicatch
_ JSR296: Swing Application Framework
_ port of the Java 6u10 features (kernel [though improved by the modularity work I guess], quick start and plugin)
_ upgrade of the classloarder architecture [a side effect of the modularity work I think]
_ a method to close a URLClassloader [wished I had that 2 years ago...]
_ Unicode 5.0 support
_ XRender pipeline for Java2D
_ Swing updates considered (JXLayer, DatePicker, CSS styling - may be)
_ G1 garbage collector
_ compressed pointers on 64 VMs
_ JSR308: annotation on Java types
_ JSR166y: more concurrency
Features not in Java 7:
_ closures
_ reified generics
_ properties
_ operator overloading
_ BigDecimal syntax [pity that would make using them easier]
_ JSR295
Non mentioned:
_ JSR310: Date and Time API, it is late apparently so it may not make it (https://jsr-310.dev.java.net/servlets/ReadMsg?list=dev&msgNo=1389 ) [a real pity if it doesn't!]
A preview for JavaOne 2009 was mentioned, we'll see...

12:00-13:00
Efficient Enterprise Builds
by Jason van Zyl
[Abstract: http://devoxx.com/display/JV08/Efficient+Enterprise+Builds ]
A presentation of m2Eclipse and Nexus, with a pinch of Maven 3.0 (used in m2Eclipse and Netbeans) as well as a mention of the potential use of Nexus for OSGi.

14:00-15:00
Introduction to NIO.2
by Jean-Francois Arcand
[Abstract: http://devoxx.com/display/JV08/Introduction+to+NIO.2 ]
Next time I'll read about the subject before going to the presentation...

15:10-16:10
JavaPosse.com LIVE
by Dick Wall and Carl Quinn
[Abstract: http://devoxx.com/display/JV08/JavaPosse.com+LIVE
Audio: http://javaposse.com/index.php?post_id=412440
Video: http://video.google.com/videoplay?docid=-2713178512447741319&hl=en (by Peter Pilgrim) ]
The Javaposse LIVE! It was well worth missing the session on modularity in Java (Alex Buckley [http://devoxx.com/display/JV08/Modularity+in+Java , slides there: http://blogs.sun.com/abuckley/resource/Devoxx2008-ModularityInJava.pdf ], Peter Kriens view on it http://www.osgi.org/blog/2008/12/project-jigsaw-ii.html ),
despite the technical glitch with Tor.


16:40-17:40
Preventing bugs with pluggable type-checking for Java
by Mahmood Ali
[Abstract: http://devoxx.com/display/JV08/Preventing+bugs+with+pluggable+type-checking+for+Java ]
Showed how to use JSR308 to make the code safer. I wonder if the code won't be too overloaded with this though.

17:50-18:50
The next versions of Parleys.com
by Stephan Janssen and friends
[Abstract: http://devoxx.com/display/JV08/The+next+versions+of+Parleys.com ]
Stephan Janssen and his friends showed a few alternative clients for Parleys (a JavaFX one, that should be used a the demo for JavaFX IMHO, a GWT/JavaScript version, an iPhone version), as well as the impressive publishing client (a Flex application capable of merging videos with slides, of detecting demos to include them in high quality, all without much human effort). Along the talk Stephan also talked about his plans for Parleys.

19:00-22:00
Movie
[http://devoxx.com/display/JV08/Movie ]
The end of Devoxx for me, so time to relax with the movie... then out with the ToursJUG leaders.

2008-12-12 L'Aquarium a Paris

After a short night (bed time arround 2:00, wake up arround 4:30 in order to catch the train [http://www.flickr.com/photos/lhochet/3125432134/ ]),
I'm back to Paris for the Aquarium in Paris, a micro Devoxx organised by Sun in its parisian offices.
(the presentations slides are online at http://blogs.sun.com/alexismp/resource/AquariumParis08.html )

9:30
Temoignage SFR Developer Zone

10:00
Java EE 6 Overview
Roberto Chinicci
I couldn't see it at Devoxx so the "repeat" was welcomed

11:00
Jersey / JAX-RS
Paul Sandoz
Mostly demos, I should have closer look at this at some point
(link to the Devoxx slides http://blogs.sun.com/sandoz/entry/devoxx_slides_and_examples_for )

11:30
Open SSO, Single Sign-on et federation d'identite
Alain Barnier
Introduction to Open SSO.

13:30
Glassfish V3 Prelude
Alexis MP
An update on the status of Glassfish.

14:15
Java FX Overview
Richard Blair, Jasper Pott, Martin Brehovsky
A condensed version of the JavaFX presentation at Devoxx, seemed that I missed a couple of points when fighting with the Wifi during the first session at Devoxx.

16:00
XWiki
Thomas Mortagne

16:30
Integration continue avec Hudson
Romain Linsolas

17:00
Fin.

Other views of Devoxx:
_ other blogs posts aggregrated on the Devoxx 08 home page: http://www.devoxx.com/display/JV08/Home
_ French blogs posts: http://blog.developpez.com/recap/java?cat=1771 and http://docs.google.com/View?docid=dhgwkxdz_49db8qb9hg

Slides:
Univertity: http://www.devoxx.com/display/JV08/University+Slides
Conference: http://www.devoxx.com/display/JV08/Conference+slides

Videos:
will be at http://parleys.com/ spread over 2009