Quantcast

Running Java as part of my web application?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running Java as part of my web application?

Papa
Hello.

Most of the browsers nowadays do not support Java, this has me worried
since I'd like to use Java to access databases and to perform logical
computations behind some web based applications I'm working on. I know
that Oracle and/or Apache are strong and competitive application
development frame works and that a solution has been found to resolve
this issue. So, contrary to what I have read so far, I *know that I am
missing something that would allow me to run my 'jar' files as part of a
web page.

Could someone here, please, point me out to tutorials or books where
running Java as part of my web application would be explained?

Thanks in advance.

--
ArbolOne.
Using FireFox

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [nbj2ee] Running Java as part of my web application?

Simon, Charles
Yes, most browsers for mobile phones and tablets do not support Java, or at least not well if they do.
On the other hand, most browsers for desktop and laptop computers DO support Java, but if you want to be cross platform then you should only have Java on the server side.
There are many JavaScript technologies that can be used for the browser portion of you application.  JSF is one that is well supported in NetBeans, but there are others, some of which have plugins for NetBeans.  Just do a google search for them.

-----Original Message-----
From: Papa [mailto:[hidden email]]
Sent: Friday, March 31, 2017 9:41 AM
To: User NetBeans; NetBeans
Subject: [nbj2ee] Running Java as part of my web application?

Hello.

Most of the browsers nowadays do not support Java, this has me worried since I'd like to use Java to access databases and to perform logical computations behind some web based applications I'm working on. I know that Oracle and/or Apache are strong and competitive application development frame works and that a solution has been found to resolve this issue. So, contrary to what I have read so far, I *know that I am missing something that would allow me to run my 'jar' files as part of a web page.

Could someone here, please, point me out to tutorials or books where running Java as part of my web application would be explained?

Thanks in advance.

--
ArbolOne.
Using FireFox

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Thomas Wolf-7
In reply to this post by Papa
Java in web browsers - i.e. “applets” - is what is on the wane.  But, of course, running java on a web/application server is not.  It’s just that your user interface now needs to be written in HTML/CSS/Javascript...or a framework like Vaadin.  I like Vaadin because of its Swing-like approach to the UI *and* because it allows me to continue writing an entire application in Java.  Knowledge of HTML/CSS/Javascript are, more or less, optional.  If using HTML/CSS/Javascript are not an issue, there are literally dozens of frameworks that you can use in tandem with your Java business logic.  I’m not expert enough on any of them to offer advice.  Be prepared to do a lot of reading, starting with J2EE basics.

Alternatively, you could still pursue a “fat client” approach, where your users would download your Java executable through the web browser and then simply execute that on their desktop.  No web at all.  The main downside to this approach is “distribution” becomes an issue again (i.e. you have to deploy and maintain and/or force users to upgrade executables).  That’s, of course, no issue with a web app.

I know I didn’t point you to any tutorials, but I hope I included some useful info to get you started.
tom

> On Mar 31, 2017, at 9:41 AM, Papa <[hidden email]> wrote:
>
> Hello.
>
> Most of the browsers nowadays do not support Java, this has me worried since I'd like to use Java to access databases and to perform logical computations behind some web based applications I'm working on. I know that Oracle and/or Apache are strong and competitive application development frame works and that a solution has been found to resolve this issue. So, contrary to what I have read so far, I *know that I am missing something that would allow me to run my 'jar' files as part of a web page.
>
> Could someone here, please, point me out to tutorials or books where running Java as part of my web application would be explained?
>
> Thanks in advance.
>
> --
> ArbolOne.
> Using FireFox
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

David Johnson-2
On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:

> The main downside to this approach is “distribution” becomes an issue
> again (i.e. you have to deploy and maintain and/or force users to
> upgrade executables).  

Not if you "distribute" your app with a .jnlp file. The user points
their browser at the jnlp link you provide and if there are updates to
your app the updated jar files on your server are automatically
downloaded by Java Web start. The user doesn't have to do anything
regarding your app.

The user's workstation must have an appropriate version of Java
installed but I think all computers come with Java these days and Oracle
is pretty insistent that users upgrade to the latest version.

The only caveat is that your jar file(s) must be signed with a "trusted"
certificate (Oracle won't let you self-sign anymore) so you have to get
a certificate and modify your Netbeans build.xml to add a <target
name="-post-jar"> section at the end to sign your jar.

David

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Eirik Bakke-2
Many people and IT departments are sceptical of installing Java on desktops these days. In Norway, for example, everyone used to be required to have Java installed to be able to log onto their online banking accounts. This was always a hassle for everyone (and for everyone's grandparents). There was always some problem with the browser plugin, and the Java Updater would pop up constantly, suggesting the user upgrade to the latest version and also install the bundled Ask Toolbar. As a result, all of Norway hates Java.

For thick client applications, a better alternative is to bundle the JRE with the application itself. This avoids all of Java's famed security problems, since no browser plugin is involved. Don't bundle the Oracle JRE, however--it comes with too many legal caveats. Instead, use Zulu, which is a distribution based directly on OpenJDK instead. The Oracle and Zulu distributions of the JDK are mostly identical from a technical perspective--the difference is in the license and in the fact that the Oracle one bundles various proprietary bonus features that you don't need.

Now you still have the problem of keeping the application up to date, of course (including the bundled JRE). For thick client applications, I think this is unavoidable. But you can use frameworks like Sparkle (on MacOS) to help with this.

Also note that if you're bundling your own JRE, there is usually no need to update it constantly to the latest version, since there is no security-sensitive browser plugin involved. In fact, another advantage of the bundled JRE approach is that all your users will run the same version of the JRE, which is nice from a support perspective. IntelliJ on Mac, as an example, came bundled with Java 6 for years, because it used to be the only JRE that supported Retina screens.

-- Eirik

On 3/31/17, 11:50 AM, "David Johnson" <[hidden email]> wrote:

On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:

The main downside to this approach is “distribution” becomes an issue
again (i.e. you have to deploy and maintain and/or force users to
upgrade executables).  

Not if you "distribute" your app with a .jnlp file. The user points
their browser at the jnlp link you provide and if there are updates to
your app the updated jar files on your server are automatically
downloaded by Java Web start. The user doesn't have to do anything
regarding your app.

The user's workstation must have an appropriate version of Java
installed but I think all computers come with Java these days and Oracle
is pretty insistent that users upgrade to the latest version.

The only caveat is that your jar file(s) must be signed with a "trusted"
certificate (Oracle won't let you self-sign anymore) so you have to get
a certificate and modify your Netbeans build.xml to add a <target
name="-post-jar"> section at the end to sign your jar.

David


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Thomas Wolf-7
In reply to this post by David Johnson-2
David,
I just got through moving a recent application from Webstart  (ie. ".jnlp" files) to a regular executable (launch4j wrapper) because the picture with Webstart in browsers isn't much rosier than with applets.

tom

On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]> wrote:
On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:

> The main downside to this approach is “distribution” becomes an issue
> again (i.e. you have to deploy and maintain and/or force users to
> upgrade executables).

Not if you "distribute" your app with a .jnlp file. The user points
their browser at the jnlp link you provide and if there are updates to
your app the updated jar files on your server are automatically
downloaded by Java Web start. The user doesn't have to do anything
regarding your app.

The user's workstation must have an appropriate version of Java
installed but I think all computers come with Java these days and Oracle
is pretty insistent that users upgrade to the latest version.

The only caveat is that your jar file(s) must be signed with a "trusted"
certificate (Oracle won't let you self-sign anymore) so you have to get
a certificate and modify your Netbeans build.xml to add a <target
name="-post-jar"> section at the end to sign your jar.

David




--
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

David Johnson-2
Tom,

Interesting, I almost never use web start from a browser. You actually
don't need a browser to install, load and launch Java apps using Java
Web Start. You could remove all browsers from your system and just use a
command line argument (or a desktop shortcut for users)

javaws http://your_server/<path)_to_your>/app.jnlp

David


On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:

> David,
> I just got through moving a recent application from Webstart  (ie.
> ".jnlp" files) to a regular executable (launch4j wrapper) because the
> picture with Webstart in browsers isn't much rosier than with applets.
>
>
> tom
>
> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
> wrote:
>         On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
>        
>         > The main downside to this approach is “distribution” becomes
>         an issue
>         > again (i.e. you have to deploy and maintain and/or force
>         users to
>         > upgrade executables).
>        
>         Not if you "distribute" your app with a .jnlp file. The user
>         points
>         their browser at the jnlp link you provide and if there are
>         updates to
>         your app the updated jar files on your server are
>         automatically
>         downloaded by Java Web start. The user doesn't have to do
>         anything
>         regarding your app.
>        
>         The user's workstation must have an appropriate version of
>         Java
>         installed but I think all computers come with Java these days
>         and Oracle
>         is pretty insistent that users upgrade to the latest version.
>        
>         The only caveat is that your jar file(s) must be signed with a
>         "trusted"
>         certificate (Oracle won't let you self-sign anymore) so you
>         have to get
>         a certificate and modify your Netbeans build.xml to add a
>         <target
>         name="-post-jar"> section at the end to sign your jar.
>        
>         David
>        
>
>
>
>
> --
> [hidden email]
> http://landofwolf.blogspot.com/


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Thomas Wolf-7
Hi David,
How did the JNLP make it onto your desktop without a browser?  Sure, what you say is certainly doable and, indeed, it's what essentially happens when you serve a jnlp to a browser that knows to handles that mime type.  But as i originally mentioned, it seems like browsers are starting to ignore that mime type.

If you tell your users to download the JNLP to the desktop, how do you provide different sized icons to be used by Windows for that jnlp  - that work both on the desktop and on the task bar?  When I looked into it, I couldn't find a way.

tom


> On Mar 31, 2017, at 1:56 PM, David Johnson <[hidden email]> wrote:
>
> Tom,
>
> Interesting, I almost never use web start from a browser. You actually
> don't need a browser to install, load and launch Java apps using Java
> Web Start. You could remove all browsers from your system and just use a
> command line argument (or a desktop shortcut for users)
>
> javaws http://your_server/<path)_to_your>/app.jnlp
>
> David
>
>
>> On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:
>> David,
>> I just got through moving a recent application from Webstart  (ie.
>> ".jnlp" files) to a regular executable (launch4j wrapper) because the
>> picture with Webstart in browsers isn't much rosier than with applets.
>>
>>
>> tom
>>
>> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
>> wrote:
>>        On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
>>
>>> The main downside to this approach is “distribution” becomes
>>        an issue
>>> again (i.e. you have to deploy and maintain and/or force
>>        users to
>>> upgrade executables).
>>
>>        Not if you "distribute" your app with a .jnlp file. The user
>>        points
>>        their browser at the jnlp link you provide and if there are
>>        updates to
>>        your app the updated jar files on your server are
>>        automatically
>>        downloaded by Java Web start. The user doesn't have to do
>>        anything
>>        regarding your app.
>>
>>        The user's workstation must have an appropriate version of
>>        Java
>>        installed but I think all computers come with Java these days
>>        and Oracle
>>        is pretty insistent that users upgrade to the latest version.
>>
>>        The only caveat is that your jar file(s) must be signed with a
>>        "trusted"
>>        certificate (Oracle won't let you self-sign anymore) so you
>>        have to get
>>        a certificate and modify your Netbeans build.xml to add a
>>        <target
>>        name="-post-jar"> section at the end to sign your jar.
>>
>>        David
>>
>>
>>
>>
>>
>> --
>> [hidden email]
>> http://landofwolf.blogspot.com/
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

David Johnson-2
Hi, Tom,

Just open a terminal window (*nix) or cmd window (windows) and type:

javaws http://your_server/<path)_to_your>/app.jnlp

E.g.

javaws http://www.jcst.com/logbook/logbook.jnlp

Nothing to do with any browser. The creation of shortcuts is a function
of the Java Control Panel (viewer - enter javaws -viewer). Again totally
ignores the existence of any browser.

Certainly it's less fuss for a user to just use the http://... URL  in a
browser and have the browser launch Java Web Start but that's merely a
convenience. The typical problem I have with users accessing a jnlp with
a browser is when the browser caches something and won't let go of it.
Then I advise them to open a cmd window and enter the appropriate javaws
command (the hardest part is getting them to open the cmd window, the
rest is a copy & paste -:)). I don't recall seeing the problem you are
experiencing of a browser not handling the jnlp mime type.

The icon references are in the jnlp file, I don't think the browser has
anything to do with that no matter how you launch the jnlp file.

It's in the <information> section, e.g.
       
        <icon href="lbIcon.jpg"/>
        <icon href="Splash.gif" kind="splash"/>
       
HTH

David

On Fri, 2017-03-31 at 18:38 -0400, Thomas Wolf wrote:

> Hi David,
> How did the JNLP make it onto your desktop without a browser?  Sure, what you say is certainly doable and, indeed, it's what essentially happens when you serve a jnlp to a browser that knows to handles that mime type.  But as i originally mentioned, it seems like browsers are starting to ignore that mime type.
>
> If you tell your users to download the JNLP to the desktop, how do you provide different sized icons to be used by Windows for that jnlp  - that work both on the desktop and on the task bar?  When I looked into it, I couldn't find a way.
>
> tom
>
>
> > On Mar 31, 2017, at 1:56 PM, David Johnson <[hidden email]> wrote:
> >
> > Tom,
> >
> > Interesting, I almost never use web start from a browser. You actually
> > don't need a browser to install, load and launch Java apps using Java
> > Web Start. You could remove all browsers from your system and just use a
> > command line argument (or a desktop shortcut for users)
> >
> > javaws http://your_server/<path)_to_your>/app.jnlp
> >
> > David
> >
> >
> >> On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:
> >> David,
> >> I just got through moving a recent application from Webstart  (ie.
> >> ".jnlp" files) to a regular executable (launch4j wrapper) because the
> >> picture with Webstart in browsers isn't much rosier than with applets.
> >>
> >>
> >> tom
> >>
> >> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
> >> wrote:
> >>        On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
> >>
> >>> The main downside to this approach is “distribution” becomes
> >>        an issue
> >>> again (i.e. you have to deploy and maintain and/or force
> >>        users to
> >>> upgrade executables).
> >>
> >>        Not if you "distribute" your app with a .jnlp file. The user
> >>        points
> >>        their browser at the jnlp link you provide and if there are
> >>        updates to
> >>        your app the updated jar files on your server are
> >>        automatically
> >>        downloaded by Java Web start. The user doesn't have to do
> >>        anything
> >>        regarding your app.
> >>
> >>        The user's workstation must have an appropriate version of
> >>        Java
> >>        installed but I think all computers come with Java these days
> >>        and Oracle
> >>        is pretty insistent that users upgrade to the latest version.
> >>
> >>        The only caveat is that your jar file(s) must be signed with a
> >>        "trusted"
> >>        certificate (Oracle won't let you self-sign anymore) so you
> >>        have to get
> >>        a certificate and modify your Netbeans build.xml to add a
> >>        <target
> >>        name="-post-jar"> section at the end to sign your jar.
> >>
> >>        David
> >>
> >>
> >>
> >>
> >>
> >> --
> >> [hidden email]
> >> http://landofwolf.blogspot.com/
> >
> >


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Thomas Wolf-7
David,
I think you misunderstood my point with regards to icons: an "exe" can have in it images of different sizes (an ".ico" file) the operating system uses to graphically represent the program in the file system and elsewhere - e.g. when creating a shortcut on the desktop.  Windows doesn't know anything about ".jnlp" files other than what program to open and pass that file to - e.g. jawaws - so how can it show a nice, application specific icon on the desktop?  The icon arguments you're pointing to are used by javaws after you invoke the program - e.g. as a splash screen.

What you consider 'merely a convenience' is actually quite important for people who are technically inept.  Asking someone like that to open a command window and copy/paste a program line to run is not a good user experience.

When I said I moved from a Webstart delivered app to an exe built with launch4j, I didn't give you the whole story.  Before I joined the group, the app used to be delivered as an InstallAnywhere exe that the user installed on the desktop like any other Windows software.  The first thing my users complained about when I transitioned to Webstart was "where is the <product name>desktop icon?".   I ran into other problems not easily resolved but can't remember them right now (i vaguely remember certificate issues) but when some browsers stopped supporting webstart by default, i moved to the current launch4j-based solution.

That was a couple years ago.  Now we've decided to rewrite the app using web-based tech.  I chose Vaadin.

Anyway, I'm glad that webstart is working well for you.

tom

> On Apr 1, 2017, at 8:31 PM, David Johnson <[hidden email]> wrote:
>
> Hi, Tom,
>
> Just open a terminal window (*nix) or cmd window (windows) and type:
>
> javaws http://your_server/<path)_to_your>/app.jnlp
>
> E.g.
>
> javaws http://www.jcst.com/logbook/logbook.jnlp
>
> Nothing to do with any browser. The creation of shortcuts is a function
> of the Java Control Panel (viewer - enter javaws -viewer). Again totally
> ignores the existence of any browser.
>
> Certainly it's less fuss for a user to just use the http://... URL  in a
> browser and have the browser launch Java Web Start but that's merely a
> convenience. The typical problem I have with users accessing a jnlp with
> a browser is when the browser caches something and won't let go of it.
> Then I advise them to open a cmd window and enter the appropriate javaws
> command (the hardest part is getting them to open the cmd window, the
> rest is a copy & paste -:)). I don't recall seeing the problem you are
> experiencing of a browser not handling the jnlp mime type.
>
> The icon references are in the jnlp file, I don't think the browser has
> anything to do with that no matter how you launch the jnlp file.
>
> It's in the <information> section, e.g.
>
>        <icon href="lbIcon.jpg"/>
>        <icon href="Splash.gif" kind="splash"/>
>
> HTH
>
> David
>
>> On Fri, 2017-03-31 at 18:38 -0400, Thomas Wolf wrote:
>> Hi David,
>> How did the JNLP make it onto your desktop without a browser?  Sure, what you say is certainly doable and, indeed, it's what essentially happens when you serve a jnlp to a browser that knows to handles that mime type.  But as i originally mentioned, it seems like browsers are starting to ignore that mime type.
>>
>> If you tell your users to download the JNLP to the desktop, how do you provide different sized icons to be used by Windows for that jnlp  - that work both on the desktop and on the task bar?  When I looked into it, I couldn't find a way.
>>
>> tom
>>
>>
>>> On Mar 31, 2017, at 1:56 PM, David Johnson <[hidden email]> wrote:
>>>
>>> Tom,
>>>
>>> Interesting, I almost never use web start from a browser. You actually
>>> don't need a browser to install, load and launch Java apps using Java
>>> Web Start. You could remove all browsers from your system and just use a
>>> command line argument (or a desktop shortcut for users)
>>>
>>> javaws http://your_server/<path)_to_your>/app.jnlp
>>>
>>> David
>>>
>>>
>>>> On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:
>>>> David,
>>>> I just got through moving a recent application from Webstart  (ie.
>>>> ".jnlp" files) to a regular executable (launch4j wrapper) because the
>>>> picture with Webstart in browsers isn't much rosier than with applets.
>>>>
>>>>
>>>> tom
>>>>
>>>> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
>>>> wrote:
>>>>       On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
>>>>
>>>>> The main downside to this approach is “distribution” becomes
>>>>       an issue
>>>>> again (i.e. you have to deploy and maintain and/or force
>>>>       users to
>>>>> upgrade executables).
>>>>
>>>>       Not if you "distribute" your app with a .jnlp file. The user
>>>>       points
>>>>       their browser at the jnlp link you provide and if there are
>>>>       updates to
>>>>       your app the updated jar files on your server are
>>>>       automatically
>>>>       downloaded by Java Web start. The user doesn't have to do
>>>>       anything
>>>>       regarding your app.
>>>>
>>>>       The user's workstation must have an appropriate version of
>>>>       Java
>>>>       installed but I think all computers come with Java these days
>>>>       and Oracle
>>>>       is pretty insistent that users upgrade to the latest version.
>>>>
>>>>       The only caveat is that your jar file(s) must be signed with a
>>>>       "trusted"
>>>>       certificate (Oracle won't let you self-sign anymore) so you
>>>>       have to get
>>>>       a certificate and modify your Netbeans build.xml to add a
>>>>       <target
>>>>       name="-post-jar"> section at the end to sign your jar.
>>>>
>>>>       David
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> [hidden email]
>>>> http://landofwolf.blogspot.com/
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

David Johnson-2
Hi, Tom,

You're right I misunderstood and I confess I still do. If you specify in
the jnlp that Web Start is to create desktop and/or menu short cuts then
it will use the icon configured to represent the desktop shortcut. Not
sure I see the difference between that and other menu/desktop shortcuts.

But as you note Web Start works pretty well for us. We started using it
to distribute apps long before cross platform delivery systems like
launch4j existed so it's kind of baked into our processes. The point I
was trying to make is that Java Web Start can be a viable distribution
method and doesn't require a browser to work (you can distribute a .bat
or .sh file that runs it for the first time and installs the app then
updates are automatic). Like anything else it certainly has its issues
but in general it just so happens that it fits well with our
(multi-platform, globally distributed) user community.

BTW I have a friend who's been labouring away at an app using Vaadin and
the results are impressive - enjoy!

Regards

David

On Sun, 2017-04-02 at 10:15 -0400, Thomas Wolf wrote:

> David,
> I think you misunderstood my point with regards to icons: an "exe" can have in it images of different sizes (an ".ico" file) the operating system uses to graphically represent the program in the file system and elsewhere - e.g. when creating a shortcut on the desktop.  Windows doesn't know anything about ".jnlp" files other than what program to open and pass that file to - e.g. jawaws - so how can it show a nice, application specific icon on the desktop?  The icon arguments you're pointing to are used by javaws after you invoke the program - e.g. as a splash screen.
>
> What you consider 'merely a convenience' is actually quite important for people who are technically inept.  Asking someone like that to open a command window and copy/paste a program line to run is not a good user experience.
>
> When I said I moved from a Webstart delivered app to an exe built with launch4j, I didn't give you the whole story.  Before I joined the group, the app used to be delivered as an InstallAnywhere exe that the user installed on the desktop like any other Windows software.  The first thing my users complained about when I transitioned to Webstart was "where is the <product name>desktop icon?".   I ran into other problems not easily resolved but can't remember them right now (i vaguely remember certificate issues) but when some browsers stopped supporting webstart by default, i moved to the current launch4j-based solution.
>
> That was a couple years ago.  Now we've decided to rewrite the app using web-based tech.  I chose Vaadin.
>
> Anyway, I'm glad that webstart is working well for you.
>
> tom
>
> > On Apr 1, 2017, at 8:31 PM, David Johnson <[hidden email]> wrote:
> >
> > Hi, Tom,
> >
> > Just open a terminal window (*nix) or cmd window (windows) and type:
> >
> > javaws http://your_server/<path)_to_your>/app.jnlp
> >
> > E.g.
> >
> > javaws http://www.jcst.com/logbook/logbook.jnlp
> >
> > Nothing to do with any browser. The creation of shortcuts is a function
> > of the Java Control Panel (viewer - enter javaws -viewer). Again totally
> > ignores the existence of any browser.
> >
> > Certainly it's less fuss for a user to just use the http://... URL  in a
> > browser and have the browser launch Java Web Start but that's merely a
> > convenience. The typical problem I have with users accessing a jnlp with
> > a browser is when the browser caches something and won't let go of it.
> > Then I advise them to open a cmd window and enter the appropriate javaws
> > command (the hardest part is getting them to open the cmd window, the
> > rest is a copy & paste -:)). I don't recall seeing the problem you are
> > experiencing of a browser not handling the jnlp mime type.
> >
> > The icon references are in the jnlp file, I don't think the browser has
> > anything to do with that no matter how you launch the jnlp file.
> >
> > It's in the <information> section, e.g.
> >
> >        <icon href="lbIcon.jpg"/>
> >        <icon href="Splash.gif" kind="splash"/>
> >
> > HTH
> >
> > David
> >
> >> On Fri, 2017-03-31 at 18:38 -0400, Thomas Wolf wrote:
> >> Hi David,
> >> How did the JNLP make it onto your desktop without a browser?  Sure, what you say is certainly doable and, indeed, it's what essentially happens when you serve a jnlp to a browser that knows to handles that mime type.  But as i originally mentioned, it seems like browsers are starting to ignore that mime type.
> >>
> >> If you tell your users to download the JNLP to the desktop, how do you provide different sized icons to be used by Windows for that jnlp  - that work both on the desktop and on the task bar?  When I looked into it, I couldn't find a way.
> >>
> >> tom
> >>
> >>
> >>> On Mar 31, 2017, at 1:56 PM, David Johnson <[hidden email]> wrote:
> >>>
> >>> Tom,
> >>>
> >>> Interesting, I almost never use web start from a browser. You actually
> >>> don't need a browser to install, load and launch Java apps using Java
> >>> Web Start. You could remove all browsers from your system and just use a
> >>> command line argument (or a desktop shortcut for users)
> >>>
> >>> javaws http://your_server/<path)_to_your>/app.jnlp
> >>>
> >>> David
> >>>
> >>>
> >>>> On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:
> >>>> David,
> >>>> I just got through moving a recent application from Webstart  (ie.
> >>>> ".jnlp" files) to a regular executable (launch4j wrapper) because the
> >>>> picture with Webstart in browsers isn't much rosier than with applets.
> >>>>
> >>>>
> >>>> tom
> >>>>
> >>>> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
> >>>> wrote:
> >>>>       On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
> >>>>
> >>>>> The main downside to this approach is “distribution” becomes
> >>>>       an issue
> >>>>> again (i.e. you have to deploy and maintain and/or force
> >>>>       users to
> >>>>> upgrade executables).
> >>>>
> >>>>       Not if you "distribute" your app with a .jnlp file. The user
> >>>>       points
> >>>>       their browser at the jnlp link you provide and if there are
> >>>>       updates to
> >>>>       your app the updated jar files on your server are
> >>>>       automatically
> >>>>       downloaded by Java Web start. The user doesn't have to do
> >>>>       anything
> >>>>       regarding your app.
> >>>>
> >>>>       The user's workstation must have an appropriate version of
> >>>>       Java
> >>>>       installed but I think all computers come with Java these days
> >>>>       and Oracle
> >>>>       is pretty insistent that users upgrade to the latest version.
> >>>>
> >>>>       The only caveat is that your jar file(s) must be signed with a
> >>>>       "trusted"
> >>>>       certificate (Oracle won't let you self-sign anymore) so you
> >>>>       have to get
> >>>>       a certificate and modify your Netbeans build.xml to add a
> >>>>       <target
> >>>>       name="-post-jar"> section at the end to sign your jar.
> >>>>
> >>>>       David
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> [hidden email]
> >>>> http://landofwolf.blogspot.com/
> >>>
> >>>
> >
> >


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Java as part of my web application?

Steve Hannah
Any discussion of running Java in the web browser should include the option of using TeaVM to compile java into Javascript so that it can be run inside the browser "natively" without using any plugins.

We currently use TeaVM in our Javascript port of Codename One, and have been very happy with it.  It have very good performance, and also supports Java threads.

TeaVM website:  http://teavm.org/

If you're looking for a UI toolkit and data binding, I also recommend checking out the companion project TeaVM flavour that is similar to Javascript frameworks like VUE.js and React, but is designed for Java apps, so you gain nice things like type-checking in templates, etc...

Steve

On Mon, Apr 3, 2017 at 6:40 AM, David Johnson <[hidden email]> wrote:
Hi, Tom,

You're right I misunderstood and I confess I still do. If you specify in
the jnlp that Web Start is to create desktop and/or menu short cuts then
it will use the icon configured to represent the desktop shortcut. Not
sure I see the difference between that and other menu/desktop shortcuts.

But as you note Web Start works pretty well for us. We started using it
to distribute apps long before cross platform delivery systems like
launch4j existed so it's kind of baked into our processes. The point I
was trying to make is that Java Web Start can be a viable distribution
method and doesn't require a browser to work (you can distribute a .bat
or .sh file that runs it for the first time and installs the app then
updates are automatic). Like anything else it certainly has its issues
but in general it just so happens that it fits well with our
(multi-platform, globally distributed) user community.

BTW I have a friend who's been labouring away at an app using Vaadin and
the results are impressive - enjoy!

Regards

David

On Sun, 2017-04-02 at 10:15 -0400, Thomas Wolf wrote:
> David,
> I think you misunderstood my point with regards to icons: an "exe" can have in it images of different sizes (an ".ico" file) the operating system uses to graphically represent the program in the file system and elsewhere - e.g. when creating a shortcut on the desktop.  Windows doesn't know anything about ".jnlp" files other than what program to open and pass that file to - e.g. jawaws - so how can it show a nice, application specific icon on the desktop?  The icon arguments you're pointing to are used by javaws after you invoke the program - e.g. as a splash screen.
>
> What you consider 'merely a convenience' is actually quite important for people who are technically inept.  Asking someone like that to open a command window and copy/paste a program line to run is not a good user experience.
>
> When I said I moved from a Webstart delivered app to an exe built with launch4j, I didn't give you the whole story.  Before I joined the group, the app used to be delivered as an InstallAnywhere exe that the user installed on the desktop like any other Windows software.  The first thing my users complained about when I transitioned to Webstart was "where is the <product name>desktop icon?".   I ran into other problems not easily resolved but can't remember them right now (i vaguely remember certificate issues) but when some browsers stopped supporting webstart by default, i moved to the current launch4j-based solution.
>
> That was a couple years ago.  Now we've decided to rewrite the app using web-based tech.  I chose Vaadin.
>
> Anyway, I'm glad that webstart is working well for you.
>
> tom
>
> > On Apr 1, 2017, at 8:31 PM, David Johnson <[hidden email]> wrote:
> >
> > Hi, Tom,
> >
> > Just open a terminal window (*nix) or cmd window (windows) and type:
> >
> > javaws http://your_server/<path)_to_your>/app.jnlp
> >
> > E.g.
> >
> > javaws http://www.jcst.com/logbook/logbook.jnlp
> >
> > Nothing to do with any browser. The creation of shortcuts is a function
> > of the Java Control Panel (viewer - enter javaws -viewer). Again totally
> > ignores the existence of any browser.
> >
> > Certainly it's less fuss for a user to just use the http://... URL  in a
> > browser and have the browser launch Java Web Start but that's merely a
> > convenience. The typical problem I have with users accessing a jnlp with
> > a browser is when the browser caches something and won't let go of it.
> > Then I advise them to open a cmd window and enter the appropriate javaws
> > command (the hardest part is getting them to open the cmd window, the
> > rest is a copy & paste -:)). I don't recall seeing the problem you are
> > experiencing of a browser not handling the jnlp mime type.
> >
> > The icon references are in the jnlp file, I don't think the browser has
> > anything to do with that no matter how you launch the jnlp file.
> >
> > It's in the <information> section, e.g.
> >
> >        <icon href="lbIcon.jpg"/>
> >        <icon href="Splash.gif" kind="splash"/>
> >
> > HTH
> >
> > David
> >
> >> On Fri, 2017-03-31 at 18:38 -0400, Thomas Wolf wrote:
> >> Hi David,
> >> How did the JNLP make it onto your desktop without a browser?  Sure, what you say is certainly doable and, indeed, it's what essentially happens when you serve a jnlp to a browser that knows to handles that mime type.  But as i originally mentioned, it seems like browsers are starting to ignore that mime type.
> >>
> >> If you tell your users to download the JNLP to the desktop, how do you provide different sized icons to be used by Windows for that jnlp  - that work both on the desktop and on the task bar?  When I looked into it, I couldn't find a way.
> >>
> >> tom
> >>
> >>
> >>> On Mar 31, 2017, at 1:56 PM, David Johnson <[hidden email]> wrote:
> >>>
> >>> Tom,
> >>>
> >>> Interesting, I almost never use web start from a browser. You actually
> >>> don't need a browser to install, load and launch Java apps using Java
> >>> Web Start. You could remove all browsers from your system and just use a
> >>> command line argument (or a desktop shortcut for users)
> >>>
> >>> javaws http://your_server/<path)_to_your>/app.jnlp
> >>>
> >>> David
> >>>
> >>>
> >>>> On Fri, 2017-03-31 at 13:32 -0400, Thomas Wolf wrote:
> >>>> David,
> >>>> I just got through moving a recent application from Webstart  (ie.
> >>>> ".jnlp" files) to a regular executable (launch4j wrapper) because the
> >>>> picture with Webstart in browsers isn't much rosier than with applets.
> >>>>
> >>>>
> >>>> tom
> >>>>
> >>>> On Fri, Mar 31, 2017 at 11:50 AM, David Johnson <[hidden email]>
> >>>> wrote:
> >>>>       On Fri, 2017-03-31 at 11:05 -0400, Thomas Wolf wrote:
> >>>>
> >>>>> The main downside to this approach is “distribution” becomes
> >>>>       an issue
> >>>>> again (i.e. you have to deploy and maintain and/or force
> >>>>       users to
> >>>>> upgrade executables).
> >>>>
> >>>>       Not if you "distribute" your app with a .jnlp file. The user
> >>>>       points
> >>>>       their browser at the jnlp link you provide and if there are
> >>>>       updates to
> >>>>       your app the updated jar files on your server are
> >>>>       automatically
> >>>>       downloaded by Java Web start. The user doesn't have to do
> >>>>       anything
> >>>>       regarding your app.
> >>>>
> >>>>       The user's workstation must have an appropriate version of
> >>>>       Java
> >>>>       installed but I think all computers come with Java these days
> >>>>       and Oracle
> >>>>       is pretty insistent that users upgrade to the latest version.
> >>>>
> >>>>       The only caveat is that your jar file(s) must be signed with a
> >>>>       "trusted"
> >>>>       certificate (Oracle won't let you self-sign anymore) so you
> >>>>       have to get
> >>>>       a certificate and modify your Netbeans build.xml to add a
> >>>>       <target
> >>>>       name="-post-jar"> section at the end to sign your jar.
> >>>>
> >>>>       David
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> [hidden email]
> >>>> http://landofwolf.blogspot.com/
> >>>
> >>>
> >
> >





--
Steve Hannah
Web Lite Solutions Corp.
Loading...