
Java is preparing to co-bundling and native binaries - Mitt
https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_for_javafx
======
bni
The Java way has always been: To run this, click on the .bat file or type java
-jar myapp.jar. And some people wonder why Java has been such a failure on the
desktop.

This should have been in Java from the beginning, instead of outsourcing this
functionality to third parties (Mainly Windows only installer applications
that sucks, and also isnt used that much).

That said, I think it is misguided to include a JRE in the bundle. The correct
way would be something like OS X Lion has, promt the user if Java is not
installed. and then do a more or less automatic install of Java, in the
system.

~~~
densh
IMO the correct way is to include subset of JRE that's actually required for
given application. This can lead to relatively small total application size
and deployments that do not require any knowledge of java and java world from
end user. Having one JRE for all apps on the system is nice but it's usually
not needed.

~~~
bni
Yes, but still parts of the JVM would be duplicated between apps and updated
on app developer X's own schedule.

~~~
regularfry
Part of what this seems to be there to solve is the situation where the user
doesn't have access rights to install a JRE.

~~~
mgkimsal
Why "installing" almost anything requires "access rights" is still confusing
to me. I don't understand why there's not been a movement to 'install' things
in to my own home directory structured, vs "c:\program files" on windows
"/usr/bin" and such on linux. - Fall back to c:\mystuff or ~/bin.

~~~
finnw
ClickOnce[1] does this.

Some other apps have their own mechanisms to do the same, e.g. Google Chrome.

I don't think it's a good idea though, as it makes those apps more susceptible
to being modified by malware.

[1]: <http://en.wikipedia.org/wiki/ClickOnce>

------
sgt
Finally - why did this come now, and not 4-5 years ago? I apologize for asking
such a question, but it's the first thing that comes to mind. Principally I do
like JavaFX, and this approach will work - given that these binary bundles
don't end up like 80MB monsters.

~~~
Uchikoma
(Disclaimer: I'm a Java developer since 1.0)

For the same reasons that Sun had no nice theme and no nice icons for 15 years
for Swing applications (do they now?)

They are horrible thinking about desktop deployments, end users, marketing
etc.

~~~
mibbitier
Surely that's just because the money is in backend business processes, rather
than desktop stuff?

~~~
Uchikoma
Then why even bother with Swing and desktop? Why then add JavaFX?

~~~
Kototama
For mobile applications?

~~~
sgt
Maybe they're a bit late to the party if JavaFX is meant specifically for
mobile applications. There are lots, literally tons of solutions out there,
e.g. Appcelerator Titanium, PhoneGap, and others.

------
malkia
One thing that makes managing .NET easier compared to Java, is that there is
always executable produced (.exe). So the transition between C/C++ to .NET or
(vice-versa) is transparent to the user (or a more complicated process
launching the executables).

With Java, it seems wrapping (at least on Windows) is done only through batch
files, which among other thing have terrible Ctrl+C handling (asking for
prompt and such).

Maybe I'm naive, but if I was to solve this, I would've done it the way many
self-extracting tools work - a small .exe with your stuff at the end (or look
at the same directory at the wrapped executable, same name, different
extension), and run it like this. And then java itself would've be a dll
itself, loaded by this process.

This way migration between languges/runtimes would be easier if Java is to
play some part of it.

~~~
werpon
It's easier when your target is just one OS.

~~~
TazeTSchnitzel
Funny.

I use Mono, other people use Mono, it works fine. It means I can target Linux
and Mac OS X, and even develop on those platforms.

------
wiradikusuma
Anyone using JavaFX? I remember it came out as a Flash/Flex contender, but
didn't make the cut (which is too bad, I kinda like the language). Considering
Adobe pushing HTML5, I find it weird Oracle still pushing Java for Rich
Internet Applications.

~~~
4as198sGxV
Because HTML5 is not adequate for complex UI development. It seems Oracle is
the only company to see that the current "every app should be HTML5" trend
will end in overhype and failure.

~~~
TazeTSchnitzel
Not adequate? Perhaps not on its own, but there are libraries.

Or am I missing something?

~~~
soup10
When you are used to the fine grained control you get with a lower level
language, html5 will always seem inadequate.

~~~
TazeTSchnitzel
What kind of fine grained control?

~~~
soup10
Html5 is a heavily sandboxed abstraction layer from hardware. It's designed to
sacrifice performance and hardware access to provide a safe way for websites
to display rich content. Additionally for non-canvas apps, you must interact
with the convoluted mess that is the DOM.

Lower level languages are generally designed for maximum performance, and
full-access to hardware. The assumption is that only trusted applications will
be run.

In summary, html5 is a school playground where all the kids run in slow motion
and the toys are made of plastic. You can sort of make new toys out of sand,
but they are fragile and not that fun.

~~~
TazeTSchnitzel
You said complex UI development. HTML5 doesn't prevent that.

~~~
soup10
That wasn't me, but I agree. Especially for touch based and small screen
devices like iPhones and iPads where HTML5 apps compete with native apps. It's
much easier to create a fast and responsiveness non-standard UI natively than
with HTML5. I haven't seen html5 app on mobile that has impressed me. Usually
you can tell right away because they have unresponsive, laggy input.

~~~
TazeTSchnitzel
I think the unresponsiveness is largely because of too much JS and poor event
handling by browsers, myself. I refuse to believe JS execution can actually be
that slow.

------
KevinEldon
I write internal corporate IT systems using Java. This announcement is good
news because it should be easier to deploy to servers and a I can guarantee
that I know what JRE I'm working with in production. I can now move to Java 7
without having to worry about breaking other systems or adding an extra
deployment step for my apps.

~~~
brown9-2
1\. Couldn't you always have guaranteed this by being aware of which JAVA_HOME
was on your path or which _java_ executable your startup script ran? Having
multiple java installations on a server you manage has always been trivial.

2\. Isn't this announcement only for JavaFX?

------
voidr
It's funny that they are not supporting .deb packages, this shows that they
still don't get it.

~~~
karianna
Actually this is coming with Java 8 via project Jigsaw (new modularity for
Java).

------
thebluesky
Interestingly javafx seems to be 70% faster than WebGL:
[http://weblogs.java.net/blog/opinali/archive/2011/11/25/java...](http://weblogs.java.net/blog/opinali/archive/2011/11/25/javafx-
balls-30)

~~~
nl
That's _dreadful_ for Java.

OpenGL support has been in Java for 6 or 7 years. WebGL has been in browsers
less than 12 months and Java isn't even twice as fast?

(I'm a long time Java programmer, but I think JavaFX is the most stupid thing
I've ever seen)

~~~
thebluesky
From the blog: "JavaFX (Hotspot Client) is 70% faster than WebGL, a great
performance, considering the competition is a dedicated game engine built on
top of a low-level 3D API."

------
X-Istence
One of the biggest problems Java faces for real adoption amongst tech people
is still the perception (and I am not sure it is entirely flawed either) that
it is insecure. Yes Flash is just as bad if not worse, but we are stuck with
them because they are so ingrained within the Internet. Java never caught on,
and I know that when I see a Java application I let out a huge sigh and go
download and install Java again.

I've gone so far, and so have many of my friends, to remove Java completely
and it is not like I am missing out on anything important! I just don't trust
Java. I don't trust Flash either, but that is nicely sandboxed in Chrome, sure
exploits may exist there, but at least it will be a lot less likely, and Click
to Flash helps as well!

~~~
bad_user
The biggest problem Java Applets had and still have is that it's so much pain
to update the Java plugin that most users are left with old versions that have
documented exploits.

I don't get why it doesn't auto-update itself - if browsers like Chrome or
Firefox can auto-update themselves automatically, why can't the Java plugin?

~~~
Ygg2
> I don't get why it doesn't auto-update itself - if browsers like Chrome or
> Firefox can auto-update themselves automatically, why can't the Java plugin?

It's better that they don't. There are often subtle differences between
versions. Sometimes it causes some JDBC drivers to fail. Sometimes it can
cripple entire platforms like 1.7 did with Solr for instance.

~~~
bad_user
Even between minor versions / security updates?

~~~
Ygg2
I don't remember which exactly version I think 1.6_10 and 1.6_21 had some
differences in way Hibernate communicates with JDBC, so basically app worked
on my colleagues computer but not mine. It took quite some time to figure out
this problem.

------
Zarkonnen
This is really, really good news for me. It (hopefully) means that you can now
easily provide a download of a Java executable without the user going "oh, I
don't like Java" or the computer going "you need to install this whole other
thing to try this program".

------
oconnor0
This doesn't seem to mention Java just JavaFX. Those aren't the same, and it
would be nice if this was going to eventually be supported for Java
applications.

~~~
densh
They dropped JavaFX Script in 2.0 release. So now JavaFX is just another
library for java that is going to be part of JRE/JDK after Java 8 release.
It's also bundled in recent releases of JRE for windows.

------
sunyc
does anyone know what size it is now?

~~~
naitbit
50MB zipped, 148MB unzipped

------
CirstoiuRadu
f@#ing finally?

------
Mitt
The posting is about JavaFX, but in reality it will be a general mechanism for
JVM apps. Oracle is doing this preparation, so that your JVM apps (Java,
Clojure, Scala, etc.) can run under Android and iOS.

~~~
densh
Nothing has been said about packaging for Android or iOS. From the info that's
actually in the article -- currently it targets desktop applications.

From my point of view, iOS is extremely improbable target unless Apple changes
their application requirements. Currently they do not allow use of any 3rd
party JIT on iOS and Java is all about JIT.

Moreover JavaFX doesn't even run on Android or iOS at the moment (even without
this new kind of packaging).

~~~
4as198sGxV
Mono apps are allowed on iOS (eg games based on the Unity3d engine) so it is
likely there is way to make Java apps acceptable as well. Oracle seems
confident it is going to happen ([http://www.infoworld.com/d/application-
development/javafx-io...](http://www.infoworld.com/d/application-
development/javafx-ios-dead-arrival-175907))

~~~
densh
As far as I know MonoTouch uses Ahead Of Compilation [1] on iOS. So there is
no JIT in compiled binaries.

[1] <http://docs.xamarin.com/ios/about/limitations>

