WWDC2004 Session 614

Transcript

Kind: captions
Language: en
I'll sue
so good a morning afternoon evening
depending on where you are in the world
welcome to session 614 deploying java
applications for mac OS 10 as introduced
on Carlos ooh i'm one of the session
engineers or i'm starting some one of
the java runtime engineers and I'll be
your tour guide this afternoon alright
so what are we going to talk about today
well we're going to talk about the
various ways that you can deploy Java on
Mac OS 10 mostly will be talking about
client-side java will touch briefly on
server side but that's actually in a
different session we'll talk about tools
on how you can make that deployment
easier development tools and you might
think that's a little bit weird to be
talking about that in a deployment
session but it's not we feel that your
job as an application developer is to
write applications it's your job to make
the code that people will run it's our
job to make it as easy as possible for
you to get that code to your customers
that isn't anything that you should have
to really worry about you shouldn't have
to work on it we're going to try to make
that a little bit easier for you we'll
talk about which one of those deployment
options the best one for your customers
its best way for you to get your
application to them and finally we'll
take a little bit of a look into the
future and see what's coming in the year
ahead with Java one point five point
zero I think it might have actually been
renamed five-point oh but we'll have to
see so this is the graphical overview
where Apple we have to have a nice UI on
everything one thing when you look at
this you have to realize is that the job
of VM is underneath it all and this
actually is a little bit different from
other platforms on other platform the
JDK isn't always there you have to
download it users have to find it or you
have to bundle it with your own
application that users end up with 15
copies of the runtime in their system ja
apple provides the Java VM in the JDK as
a system framework right it means you
don't have to worry about it every mac
OS 10 installation has a Java VM and a
JD
if the user has access to software
update and is used it they have the most
recent version this is a big relief on
your part your applications can be small
and they can depend on the jdk being
there so what kind of applications can
you have we start and the most obvious
one the one that most users hit most
users use and see our app works applets
running in WebKit and applets running in
Safari Safari of course is using app kit
but Steve Jobs love Safari so it gets
its own little box web start the next
step it's a little bit beyond applets
it's basically an application that's
deployed as over the network all right
it gives you a lot of the benefits being
an applet and it gives you a lot of the
benefits of being an application the
next step past said of course is to be a
bundled application I'm sure you've all
seen them there are tons of them out
there they look and they act pretty much
like every other Mac os10 application
the end user doesn't know any difference
and yet they're in Java it's very nice
all the way on the end it's the poster
child for things we don't want to think
about shell scripts and raw jars and
class files you can run shell scripts
all of these can be run from the finder
all of these can be run from the
terminal but you can't do anything with
them really right they require either a
remarkable amount of technical savvy on
the part of the developer or I'm sorry
on the part of the customer or they
require that you need no configuration
at all so generally we don't like that
right we like things to look nice to
behave nice for the end user so let's
start by talking about applets applets
on Mac OS 10 it's based on our plugin is
basically based on sun's java plug-in
like a lot of other things in java we
try to maintain compatibility by frankly
using as much of their code as we can
get right 142 is available on any
webkit-based application Safari uses it
but if you happen to use WebKit then you
can also use applets and we'll see a
really interesting demo of that later
our applets are cross-platform
compatible anything that you can do in
an applet on another platform you should
be able to do on ours you know you
shouldn't need to treat the Mac
differently or if you're already on the
Mac you shouldn't have to treat Windows
any differently the bonus of that is
that there's no download or installation
it's totally clean right from the users
point of view all they need is a browser
they don't need anything else they don't
need to download anything they don't
need to install anything it's all there
for you this isn't to say that applix
don't have any mac OS 10 specific
technology because they do they do take
advantage of mac OS 10 technology when
they can write they use the keychain to
store certificates HTTP QPS client
certificates and when you sign a jar all
right they also take advantage of WebKit
to do cookie management so a lot of this
stuff is in there and it's done a little
bit nicer we just released 14 to update
1 Developer Preview three and if you
haven't tried it we would really
appreciate it if you would try it and
give us feedback we've greatly improved
stability and performance and
correctness and a large variety of
applet in the update proxy support is
greatly improved and by greatly improved
I mean it works now all right and for
those of you who are really picky you
have your applets well organized into
your site and bordered by things we now
have support for dynamic resizing of
applet that means when you set with
equal to a percentage and you resize
your page the applet will now resize
your page won't suddenly look like a
total disaster as soon as the developer
decide where the user tries to resize
the Safari window and new from last year
life connect live Connect is the ability
for Java and JavaScript to talk to each
other this opens up a lot of things
there were a lot of legacy sites that
didn't work with Safari before that do
now but it is a legacy technology and
that means that there are a couple of
limitations we don't talk to anything
except for Java there's no talking
between
javascript and flash for instance
there's no creation of new java objects
in JavaScript on the other hand it means
that because it's built in WebKit again
any WebKit application should be able to
use should be able to use live connect
once again I have to plug our update it
improves things dramatically in all
areas so to talk about a little bit more
about applet deployment and how you can
use the dev tools to your best advantage
Scott Co batch all right all right let's
start off in demo one please and over
here i'm running tiger and what we want
to show you here is basically what the
applets are going to look like on tiger
now you're going to say well that's not
very exciting you know they're just
applets but what we want to show you is
the improvements I'm actually mostly
that the teaching folks have made but
they're actually enhancements that
you're in users are going to appreciate
so here's my first example of an athlete
pretty boring applet actually but as you
can see you know it's Carl mentioned we
work across platform all these are now
the color of the text and the progress
bar and all those things are all things
that you sat in the HTML we pick those
up they just work so here I have a
security dialogue because I've signed
this applet all right i'm sorry i find
the jar in this applet and as you can
see it's a self-signed applet now I did
this myself you know through it together
using a key tool and you know the alert
is telling us that the company is not
trusted well Apple wrote it it sounds
like I'm making fun of our own company
that you shouldn't trust us but the
truth is that I'm over an applet
pretending that Apple issued it well you
know it's important that that's why we
have this here is that so you can verify
the contents of the certificate so your
end users you know contrast of what
you're deploying is actually from who
who it says it's from all right let's
close that and I'm going to always trust
this applet as you can see when I did
that my certificate just showed up here
in the keychain I'm going to look at
that certificate and we see up yep it's
a self-signed certificate valid I can
double click on it click on it and get a
lot more useful information you're going
to see an expansion of us using more of
the public key infrastructure that's
available on tiger and in the future but
for right now you know this gives you an
idea of what we support where we're and
we're going to be taking this further
let's also go back here and what's nice
about this is that now the user can you
know not only take a look at it they can
delete the keep the certificate from the
key chain as well if that's what they
need to do and I'll click safari and
launch it again and now even though I
said all these we have to we have to
trust it we have to try to trust it
again all right and just for comparison
sake i'm going to show you install
anywhere and they also signed their
installer they have a web-based
web-based installer it was issued by
thought day or thought rather and i'm
going to always trust that and you'll
see the difference over here as well
expire but that's alright you know it's
just put in 1 and 1 dot 5 this will be
less of an issue because you'll be able
to get around these problems but you
know just what is the important thing
here showing you what certificates going
to look like in the keychain and leave
now there's not much information there
ok i thought was going to be able to
show you a certificate chain but no
alright so that's basically what you're
looking at for applets as far as Tiger
goes and Panther it's not a whole lot
different but you know you were making
it easier to manage certificates for the
end user ok let's go to slide please
all right now you've seen how easy it is
for a sign applet to run on mac OS 10
how many out how many of you actually
have had to write a signed applet at
some point all right if you want to do
an Xcode would you agree that it's
somewhat of a pain I mean you have to
get a shell script set up you have to do
a shell script phase you have to get
everything all set up and do mostly work
outside of Xcode what would it be nice
if I could have a basic Xcode I'm sorry
I basic HTML file just created for me I
could sign it as part of my build phase
and build and deployment process and
just do everything in Xcode once don't
have to go back jump out the terminal
you know set anything up for myself
other than what Xcode will do for me
well today we want to introduce a new
project template we've been talking
about an a lot this week and what we're
going to introduce here is a new signed
applet it's based on the ant application
template and that it you know I started
with that and built this bill out that
build up the template we're going to
take advantage of ant to do a lot of the
automation for us we're going to start
with an applet you know that you that
we've got boilerplate code in here we're
going to start with the applicants
you've written and we also have a Java
keystore that's got your certificate in
it already and when we're all done we're
going to produce final each tml sign jar
and we're going to put it in a place
where we can test it and try it out and
we've also got provisions for deploying
that to a final location won't actually
show that but you'll be able to see how
it's done in the in the build script I
mention an we've talked about this a
little bit aunt 161 is now part of the
core java tools if you install the
Developer Preview 3 developer tools you
will get aunt 161 that version of aunt
does work and it will run J unit and all
external tools it's been installed a
developer Java aunt completely separate
from the j2ee tools that are out that we
install it as an optional tool this is
not meant to be a session to teach you
how to learn to use aunt go to see a
patch and apache org
give you all the information you need on
external tools tasks how to link all the
stuff together what I am going to spend
some time showing you is the important
parts when you want to write your own
ant script that links into Xcode the
important parts that you need to to make
sure that you do have so there'll
everything work right all right so in
this particular script i'm using aunt 4
in some of its deployment features aunt
will do the jar you know the jar step
for me but the it's got a nice feature
called sign jar and it basically wraps
up the the jar signer command line item
pretty well what the signs are tap and
we're also going to use it for its
deployment features I've written into
the script and ftp task and i'll be
showing you how to use that and what
extra what extra things you need to get
that to work and as i said as i
mentioned here it needs to third party
jars we've got links on where you can
get those very easy to do this yourself
all right let's go to demo number two
machine number two gritty oh wow okay
okay here I've got Xcode and just to
show you that I'm not making this up i'm
going to show you that we've got an aunt
based signed applet ready to go here in
the assistant but i've already got one
ready to go for you because I got the
properties also set up so you can
actually see this so here we can see
that i made a new project called aunt
signed applet and it filled in the
archives so that i can filled in the
archive item for me the code is the same
as a project name and that's pretty
boilerplate but the interesting thing
here is the build.xml a file let's see
here got a lot of setup you know you can
look through this will have this
available a sample code available for
you by the end of the by the end of the
week here's murdered i want to look here
here's the jar step that puts everything
together down here is the sign jar cask
that's the interesting part for what I'm
talking about right now we're going to
we're going to sign the jar file that we
created in a previous step and the way
I've written it is that it uses my
username as the alias into the default
key store that's creative when you when
you work with key tool so what you'll
need to do before you do this is you'll
need to make a key tool making you just
to get up and running out of the box
you'll need to do you need to do a
one-time setup of setting up a key store
for yourself but then you can change
this in and do what ever you know use
whatever certificate use to sign your
jar files normally and it's going to
dump it out and defined out jar file
which puts it into the disc the disc
folder and one step here that's
interesting I have an install target
actually before I show you this I want
to I want to back up here and show you
some of these targets that we've set up
so we have a target name and install and
a target name jar and a compiled target
when you're integrating aunt with Xcode
you need at least three targets in your
aunt in your build that XML file to get
it all to work together so you need a
clean task and we have that down here
which basically blows away my
intermediate build in the distribution
direct directories I also need a compile
phase which is where I indicate you know
what am I going to do to what do I need
to build with this with this task and
you also need for job you need a jar
face and the jar phases is going to take
care of well really you can have it do
what you want but ultimately it should
be doing a jar at some point along the
way
oh and the last one is the install phase
if you go out to terminal and you do
Xcode build install it will run this
install target oh this install target
not this one over this one and what i've
done here is i've set up an ftp ftp task
to get that to run you'll need to go to
those locations that you see up there
and the girls you'll need a 22
supporting jars to get the ftp to work
and you know instead of writing it down
just want to let you know that so you'll
have to do this other piece of setup
because we can't distribute these and
I'll just build it here actually
remember that so there we go we did a
compile and we did a jar phase which
should find my find my jar and did
everything for me all at once and I'm
going to do a run in the run task is
going to open up safari because I use
user been open and there we go I have my
signed applet ready to go there's my
security dialogue and just to prove to
you that at the signing actually work I
probably should have had it print out my
username just for the heck of it but
there you go so here we have a task for
built for a I'm sorry an ant base
template for building assigned applet
you'll be able to get this is sample
code and I believe that it's going to do
it let's take it back to Carl thank you
so that was a brief foray into the light
vegetarian world of applets but now
let's talk about something a little bit
more meeting let's talk about java web
start so java web start is basically a
web-based deployment technique for
applications and applets applets run
inside of a browser or any WebKit app
but they're running inside of another
process sometimes it is and what you
want right there inside of a sandbox
even with the signing there's some
limits and they can't they don't really
look like real applications to the user
so what java web start does is the user
can go to a web page click on a link and
that will essentially download and run
an application onto their desktop you
can it picks up where applets left off
there are kind of halfway between
applets and applications the second time
you run it it will actually attempt to
build a bundled application so to the
user the second time they run it now
they have this nice little application
on their desktop or wherever that looks
just like a regular application okay the
nice thing about this is that it's still
updates it still knows that it's a web
start application so it will still go
back out onto the web and check have I
been updated do I need to download any
new files this is perfect from an
enterprise deployment scenario right you
have users who can download these apps
and they look like real apps so they
feel comfortable with them they each run
in a separate vm so if something freaks
out Safari you don't lose everything and
they're still talking across the network
this means you can be sure that all of
your users are running the same version
of your application you don't have to
run around badgering your users to
upgrade to make sure that they're not
talking to the database with the you
know the version that corrupted it right
the next time they run the app it'll
come it'll grab the next version of the
of the jars it's beautiful what's even
better about java web start is that even
though its platform neutral you can run
this on any platform you want it's not
totally platform ignorant you can you
can customize what actually gets
downloaded and run based on what
operating system
you are and what vm actually that it
will be eventually run on and we'll talk
a little bit more about that later
before we talk about all this stuff in
depth I just want to give you a quick
update it's actually pretty sure right
once again java web start we try to base
it as much as possible on sons code it's
just so we have to do less work because
we're lazy engineers and 142 is
available it's both available on Panther
and Tiger same as applets it's all good
and once again I'm going to have to kind
of preach about the update one we'd love
you to try it it should make everything
better really there's a couple more
updates they're basically marrying what
son has done so let's talk a little bit
more in depth about java web start okay
some things that you can do you can use
jni libraries that means that you can
have your native code integration you
can do things that are only possible on
certain platforms and that means that
you can customize your Java Web Store
app for mac OS 10 or windows or whatever
other platform you like the ability to
create desktop shortcut applications in
the bundled applications I talked about
earlier looks great to an end user it
makes them more comfortable with what's
happening they don't have to keep going
to a web page you know they only do it
one and the next time it's all good we
use your icons for the dock and the
desktop will actually look in the jnlp
file the file that you use to determine
what actually happens what's downloaded
and how its run and we can present it
that way we don't have the generic Java
icon from the users point of view it's
starting to look more and more like an
application and you can download custom
jars just for Mac OS 10 and we'll take a
quick look at how so the web star jnlp
file this is the file that you use to
basically say what's going to run when I
click on this what's going to come down
what's going to get downloaded what's
actually going to run on the customers
computer so the general p file specifies
a couple of things it specifies
resources resources can be jars for code
or images or whatever you want or they
can ramp native lips right this is what
I was talking about earlier the neat
thing about these resources is that
there
you can actually download them based on
what architecture or what operating
system that you're running on you can
also make them lazy and this is really
useful if you have a huge application
you for right of reason you've decided
to build your application this giant
monolithic thing with a lot of different
areas and particular users only use
little bits at a time you can specify
all of the ancillary jars to be lazy and
they won't get downloads they won't eat
bandwidth unless the user actually tries
to use that functionality you can have
multiple job of versions if you find
that your application behaves
differently on 13 verses 14 verses 15
you can actually in the journal p file
you can specify particular settings you
can say some resources are only
downloaded on this version of the vm and
a different resources downloaded on a
different version of the vm you can
specify heap settings if you find under
one version the vm you need more or less
memory than the other you can even have
an installer if you have to install
native libraries you can have something
that the first time they run the web
start app you'll run off and this
another application will be run just
that one time and you can finally have
their their equivalent of shared
libraries or whatever which is the
component extensions if you have a bunch
of jars and a lot of setup that shared
between multiple applications you can
pull that out into a separate jane LP
file that's referenced and then you can
do just less maintenance work you don't
have to keep changing jam LP files
across 20 different applications so to
do another web start deployment demo
back to Scott thank you again Carl okay
let's say with demo to this time and
right here i'm going to show you java
web start and you know if you run web
start on other platforms you know this
should look pretty familiar to you don't
get used to it will be talking about
that in a little bit but the first thing
i want to show you is actually a game
that was deployed with java web start
and if you've ever looked at this it's
called puzzle pirates and what's
interesting about it is that puzzle
pirates is a believe over a 20 megabyte
download and we're going to get it
started up here
and I hope I don't scare anybody in the
back because it's changing the
resolution because puzzle pirates runs
in full screen mode and what we're
showing off here is that full screen
mode finally works works beautifully in
DP three and you just show you what you
can do with this have my own little
pirate yes I taps with this application
quite frequently and it's a massively
multiplayer online game so I can wander
over here and we can scroll into a
different part of the village and we can
head over here and see what's going on
full screen mode very smooth it's you
know a lot of good works gone on in
improving the graphics of the graphics
rendering in full screen and regular
mode you know so I'm not going to spend
too much time here you don't want to
watch me play any games so I'll quit
that and we take care of zipping back to
what we had before now this is a more
traditional application it's called
oxygen which is an XML editor and again
this thing is about 17 or 18 megabytes
and here we got and I've already
downloaded once but as you can see sorry
in the cache it's ready to go actually a
little story about this is that the
first time I ran this had said Mac os10
is fully integrated with it with oxygen
so I thought it was this I was hoping
that would come up for you it couldn't
control which one yeah hello anyway so
what's interesting about this and the
reason I pulled it out is that if you
look at this this is a application that
would look look pretty good looks right
at home on Mac OS 10 I mean me they
might want to have a you know look at
the match the session on building great
applications for the toolbar but overall
it's pretty good and because it was it
was fine for full permissions I can go
on the desktop and I can just open a
file here
and I've got a great xml editor i've
actually played with this is a very nice
application this is a just to build out
xml that i was playing with in doing
some my development of the template you
know cut copy paste work I mean this is
a full application this is a great a
great way to get this down to an end
user and that's all I need to show here
so the point of this demo know the whole
reason I show this to you is that if
you're writing a java application this
is a great way to get it to an end user
whether your in-house this came across
the internet publicly available but you
can easily make a full application that
you can deploy to your end users in your
organization if that's what you need to
do okay so now for the demo so let's go
through some code how many here have
tried to write a java web start
application we're using web start right
would you agree it's a pain in the neck
in general okay if you want to you want
to start with usually what I ended up
doing what I need to test this I have to
go steal another jnlp file copy and yank
out all the parts that I don't need fix
all the bugs that occur from doing the
copy in the pace and you know I got to
deploy it somewhere because it's you you
webstart will try to download it from
someplace doesn't really have a good
notion of running locally but so in
order to you know make life easier for
you as a developer we came up with this
an Xcode template that is built on ant
and let me check one thing sorry
ok has it slides for one second please
running thing than this week seems to be
wouldn't it be great so wouldn't it be
great if I could get a basic GOP file
created for me it's a lot of it's a
drudgery tasks you don't want to be
bothering with it every time you need to
do some work what would be great if I
could deploy everything in my server to
test it so I can do them all of my
testing and you know where Apple we want
you to use xcode wouldn't be great if we
can just do this all on xcode well we've
created another new project template
which I was just getting ready to show
you but I got ahead of myself the java
web start application template the
product much like the last the template
i gave you is an HTML file a jnlp in a
jar and we're going to deploy it's where
you need it to be deployed for for your
testing or your final development sort
of the boilerplate set up we'll just put
it in your home directory in your site
that's that's probably going to be fine
for your development all right now let's
go back to mo to ok and once again just
to show you that we're not pretending
here actually I think you probably saw
this before we have the web start
application template they're ready to go
I'm going to open up 1 i've already made
for you and we've made a an HTML file
that's going to download the jnlp for
you we've got a basic jnlp where most of
the information filled in for you you
want to put a better title it'll put
your organization name using the macro
fill in at Xcode users for templates the
HTML file that where it came from and
you know all the standard things that
you see in the jnlp file and one thing I
want to call out here is that I've set
this up to use 1 dot 4 plus which means
we're going to use any vm at least 14 or
better which means that if you know once
we get 15 need to be up and running
it'll pick 15 in this case Carl we'll
talk about that in a little bit all
right
click on the build.xml actually is not a
whole lot different than the sign Apple
accomplice I'm not going to spend a
whole lot of time on it but here we have
the clean and the install phase a couple
of gotchas I found while developing this
so that you need to chmod all the
everything that you actually deploy
because if you don't it's going to set
it up as read-only on for the user that
put it there and nobody able to download
it this depends flag is actually a very
cool feature of the ftp test it'll look
at what's on the server and it'll say oh
that's newer than what I've got already
or newer are the same so I won't upload
anything or you built something newer I
need to put that up on the server so
it's very a very useful way to make sure
you've only got what's the latest stuff
on you on your server for testing and
I'm going to run it because every
template should be able to run and do
something up what happened there
ok
seems to be a running theme today
it's going to build it sign it and put
it in the fight and I've set up my run
phase to open it up with web start okay
you know what let's do this
so today is not a good day for demos
around here what was supposed to happen
is that the Apple would start up the
application would start up in web start
it would be signed so would ask for full
permission and it was going to open up
www com this will be cleaned up and you
will be able to use it before too long
thank you very much and let's go back to
Carl thanks so I hope you missed me I'm
back and I say hi these are applications
so this is a really short slide because
really applications have been changed
that much use the bundler jar bundler
and you make a little application is
sort of the traditional way to deploy
your application developers are sort of
used to it and users are sort of used to
it to it it's the thing to do the only
thing I'm going to do is take a deep
reef foray into the Java dictionary of
the info.plist because people have asked
so the Java dictionary is a dictionary
that's embedded in the info.plist of
your bundled application and what it is
is basically a whole stack of
information that we pass to the
applicant to the running java app to the
started java app you remain class that's
sort of self-explanatory and obviously
it's mandatory you have the Java VM
version you have to specify which
version of the vm but we prefer that you
not be too specific about it Scott
talked about it very briefly when he
said 1.4 plus so what we'd like to do is
we'd like to get people away from saying
all I'm going to run on Java version 1.4
point2 because one point four point two
may not be there later if we come out
with say there's a monster security
breach or a massive you know missing
chunk of functionality or whatever and
we put out one point four point three
one point four point two won't be there
anymore and your app will stop working
right so we would much prefer that you
use one point four star which means any
one point for vm any minor version or
1.4 plus which means i'd like to run on
any vm that
least one point for these are good
things try to do that this is the same
thing that java web start uses in the
jnlp file to specify which vm version to
use ok specific Java properties these
are the same properties that you access
with system get and set properties so on
and so forth arguments these are
arguments passed directly the main you
don't usually want to use these but it
can be useful if you're wrapping
somebody else's command line app if you
have a Java program that you kind of
that expects to have all this stuff
passed to it as arguments you can pass
them here the class path path the files
obviously this is probably going to
include at least one file that would be
the one with your main class and vm
options so there is a bit of a
difference if you notice that the vm two
options are all the options that you can
have java web start doesn't have that
option you can specify multiple vm but
you can really only change the heat
settings so the applications a little
bit more flexible in that regard so i'm
not going to go in depth about building
applications that won't force Scott to
come back up here and the reason is
because there's an entire session on
this or there was an entire session on
this xcode for java development this
morning you should be able to see it
later at some point either on a DC TV or
whatever we use if you have access to
last year's DVDs there's also ship
session 608 from back then so now we're
on to the the sort of the part that we
don't talk about the java deployment
that will not be named and that's shell
scripts and j2ee shell scripts you only
if you really have to I mean if you're
really really sure of who your
deployment audience is go ahead you
shell scripts it'll be ok but in a
general sense we would prefer that you
not use shell scripts to launch your app
there are a couple reasons obviously
they don't look familiar to users there
aren't something that you know most
users you can't tell them Oh to run my
java app go to terminal and do this or
that or this or when you double-click my
java app this giant terminal window is
going to open and do all this stuff
they're not going to be happy with that
but there's actually another reason the
reason it's because there's no launch
architecture surrounding him right you
notice in java web start and in the
application bundled application case you
can give us hints as to what version of
the vm you'd like to use when you run
any terminal when you run with the shell
script there's no way to do that unless
you do it manually you either say java
blah blah blah and we pick whatever we
think is the most current version or you
have to mark a full path use the system
library frameworks java vm for emmerich
versions blah blah blah you pick like
131 you know slash bin slash java and if
that ever goes away your application
just completely stops working even minor
changes to that path if we move the
framework or rename something your
application stops working so try to
avoid that if you can so j boston calm
cat j2ee deployment isn't actually you
know it's not bad it's just not what
we're talking about today and there's a
whole session on it so I wouldn't want
to steal somebody else's Thunder Friday
9am how to deploy j-bot on jboss on Mac
OS 10 server this is only available on
server so unfortunately you can't count
on it being in the client version so
before we talk about which of these
deployment options you might want to use
let's talk about a couple of deployment
gotchas things that aren't always
readily apparent particularly if you're
coming from another platform okay so
where is Java home java home is library
java home and you know the lib directory
your sorcerer are all the stuff do you
expect to be in Java home the in
directory it's all there and it's
sibling to the appropriate location so
the obvious question is well where do
extensions go extensions go into library
Java extensions or the user's home
directory library job expansions there
is a something there's a little bit of a
catch here which is that while Java home
is symlink to the appropriate version so
when you run Java one point four point
two you get the job at one point four
point two home all of the library java
extensions are used by this all the
different versions of the vm
if you drop aunt jar and the library
java extensions and jar is going to be
available no matter what version of the
vm you're running under okay so that's a
little bit something to keeping track of
its confused some people before one
thing to keep in mind and I've talked
about how web start and Apple bundled
applications can try to pick which
version of the vm applets don't have
that luxury applets launch in whatever
version of the vm their container has
decided to use right so microsoft IE
internet explorer uses 131 applets
launch their use 131 they don't have a
choice WebKit uses 142 applets lunched
in their use 142 they don't have a
choice so applets are limited not
necessarily by the technology but with
the knowledge that your deployment may
have to be the lowest common denominator
of what you think your users will be
using so I'm going to harp again sorry
about this but I've been asked to harp
on it so I will don't use one point four
point one and one point four point two
is your jvm version when you write web
start apps when you write bundled apps
right it is Apple's policy that minor
version updates will out right over
right older previous older minor updates
one point four point three if one if and
when it comes out depending will totally
crush one point for point to it will
smoosh it out of existence okay so don't
say one point for point to say one point
four star or 1.4 plus please I'm begging
you no really look thanks all right so
at this point we've gone over all these
options applets signed applets java web
start bundled applications and you got
to be wondering well why which one of
these should i be using so applet
applets are the lightest weight all
right they have nice things they have
built an SSL support they don't require
downloads or install but they're the
kind of limit is you can't choose the vm
version and they're floating in somebody
else's process and they're in a complete
sandbox if all you need is to walk
outside the sandbox
pick a signed applet assigned out but
you can get local disk you can get some
restricted property access the next step
up if you need native code but you still
want that ability to talk over the
network the ability to get frequent
updates or you need control over the vm
which vm you're using which resources
get downloaded think about java web
start you still get the ability to to to
be dynamic in terms of what's running
but you get a little bit more control
over what's actually going to happen
finally you have bundled applications
this is if your apps really huge if you
want to distribute it on a CD some way
or you don't have the network bandwidth
you know you you want to distribute it
and you want to be done with it then you
use a bundled application or if you're
bundling an existing an existing tool
that needs arguments Java VM options
that are very specific all of those
things have to be bundled apps okay
let's look into the future we've talked
about what's happened and let's talk
about what's going to happen so we have
the 1.5 point 0 Developer Preview one
and we just released did it runs on
tiger so sadly since I've just been
talking about it there's no website or
applic support in the developer preview
it's an enterprise preview it will be
coming and in the end result you have
all the web start applet deployment
goodness that you've come to love and
expect from Apple okay so let's talk a
little bit about what will be coming
what's new well the applet plug-in and
website have been combined think they
just decided they're so similar why have
them be separate there's a number of
enterprise enhancements you can set a
security model across an organization
you can have deployment property
specified in a URL and you can mark
properties is either / idle or not over
I dab'll by specific deployment HTTPS
client authentication rears its
wonderful head and then a set of things
which are really interesting to me
personally there's pack 200 compression
for jars it's a new jar compression and
it has the capability of
hang your arse up to eight times smaller
than they are compressed now this is
great from a user's point of view it
means when they hit your web page and
they download an applet or when they
click on the web start length and they
start downloading your app it might it
launches just like that it's much nicer
and it starts bringing things like web
start into the realm of being real
desktop app replacement the next thing
the fact that web start desktop apps can
now have document types you can actually
bind you can say I claim this particular
document doc jln STW whatever you know
your own personal little initials but
now you can associate when they use your
double clicks on that document you're
bundled app is going to launch and
that's awesome and finally an import
facility one more step in the ability to
make web start apps more and more like
real desktop apps it with an import
facility you can pre-populate the cash
it's basically like an installer that
sets a web startup app as if the user
had already downloaded all the jars and
built the app so you get all the
niceness without that initial niggling
startup you know the first couple times
that the user has to click on things
they can treat it like it was always a
desktop application that just knows how
to update itself all right part deux so
let's go in a little bit more depth
about what's changed so in particular
the applet plug-in and Web Start have
merged that means that they share a cash
this is good it means that you're not
likely that you're more likely to have
whatever it is you're trying to run in
cash it simplifies things considerably
this means there's no more web start
application there's a couple of new
applications that take it place there's
a plug-in settings and a cash viewer the
rest of that functionality I think they
rightly decided was to be pushed off
into the browser so what's already there
these are new to java 1.5 but frankly
they're not new to the mac as always
we've been on the leading edge so we've
had these for a while java 1.5 has
integration with keychain but even on
one forum for one point four point two
scott download it for you and we have
auto detection of all installed vm this
is a lot more important on platforms
that don't provide the vm
as a supported system framework which we
do so we've talked about Java 1.5 in the
future and actually we were going to end
the session at this point but they
announced tiger earlier this week and I
was thinking about dashboard and I
thought wow that's pretty cool i can
write little widget but then I thought
you know what I really hate JavaScript I
don't like writing things in JavaScript
yeah but if it's a real and then I went
to the dashboard gadget session and they
said you know what this is a real
webview it's not just a JavaScript
engine you know putting up custom
graphics and then I thought way that
could be really interesting so if I
could switch to demo one please all
right so and I thought to myself hey
that's kind of funky look what I can do
I can run java applet inside of
dashboard so this is a completely
different way for you to deploy your
java applications you can write little
desktop widgets for people to use at the
touch of a finger tip and we'll leave
you with that that's deploying java
application on Mac OS 10 thank you and
have a good evening
[Applause]
so we're going to do Q&A but first I get
to do this whole thing look it's the
reference library we have a ton of
documentation some of it's ours some of
it is son it's all very exciting it's
gripping text you should read it it will
enrich your life now if you have any
complaints you can complain to him so if
you have people to talk to you have
questions comments feature requests bugs
anything talk to allen samuels he's our
java evangelist his email is up there
Rob Fraser is our marketing person if
you feel that we're not I don't know
we're not marketing Java talk to Bob not
actually sure and the java developer
mailing list java developer mainland
lease is great it's a place where people
of all kinds of occupations and creeds
can come together and well really flame
each other about java know it's good it
talk you know it talks about things and
people hash out problems and they you
know where a lot of the web i'm sorry a
lot of the java engineers are on the
java dev list so actually if you have
issues you've questions how do i do this
thing on the mac how do I make this app
look better you know why does this
behave differently on the max and other
platforms join java dev and ask and
somebody from the java team will try to
answer your question but of course if
you really think it's a problem you
should file a bug always file bugs bugs
are our friends because they keep us in
business I mean that's my job I fix bugs