Java Development Toolkit App Not Launching - javascript

I have designed a JavaFX application I would like to make accessible from my web server. It is coded in Java, uses JavaFX, and I have attempted to make it accessible here: bencitrin.com.
I tried embedding it into the homepage with the Java Development Toolkit. However, I get an error: "JavaFX Application could not launch due to system configuration."
I am unsure how to go about this--I have tried running it both unsigned and self-signed. Does it need to be "trusted"? The .jar works fine on my computer even though it is self-signed.
Thanks!

Related

How To Run a Flutter Web Application Offline?

I got a problematic assignment from my employers.
I was given the task of developing simple software that will run strictly on Google Chrome,
without attempting to connect to the web (Security reasons).
I know flutter development and I feel comfortable with the sdk.
How should I develop a web app that can be deployed using a usb stick?
Looks like PWA can be an option, but the documentation is lacking in detail.
The system does not have the ability to run a local web server.
The Flutter app must be able to work with JS libraries, I intend to use jsQR.
service workers and indexedDB could help you for develop offline route app and offline api.
mdn docs for service workers
I'm not sure that this will fit your particular case: you say that the system can't run a local webserver, but what if you provide the webserver along with your software?
I just discovered get_server: you can find it here. It aims to allow developers to host their own HTTP server by using only flutter, without resorting to external tools or other coding/scripting languages. It allows also (and that's the relevant part) to wrap your flutter web app and make it run on local network.
For now I only tried with a very simple example, but it seems to be working. These are the steps I took:
create a new flutter project: since I needed the webserver to run on Windows, I had to get flutter ready for that (see here for help)
add get_server to the new pubspec.yaml
run flutter build web on your flutter web project, and copy the build/web output
folder in the root folder of the new project (I renamed the folder while copying since flutter might change the content of the web folder)
delete all the content of lib/main.dart
paste this (this the actual content of main.dart)
import 'package:get_server/get_server.dart' as gs;
void main() {
gs.runApp(
gs.GetServerApp(home: gs.FolderWidget('folderName')),
);
}
folderName is the name of the renamed folder containing the flutter web app build.
I ran this on Windows 'device' from AndroidStudio, and my original flutter web app was reachable at localhost:8080 (for now I just used the default options of get_server). I also got the webserver (empty) GUI as a white window: I guess that can be useful for some information regarding the server itself, although, if that windows closes, localhost:8080 becomes unavailable.
But, once released, you should be able to just run the executable from the USB stick, and then connect to it with Chrome.
PS: after some time using GetServer, I had to switch to other packages because of not-so-good docs and support. Now I'm using shelf, but also Alfred is a notable mention.

Is it possible to build a standalone HTML5 App *without* bundling a browser?

Solutions such as Electron require bundling an entire browser with the resulting .app build, which causes it to have several gigabytes even for a single hello world app. Most users already have Chrome installed on their computers, though. Is it possible to create a standalone .app application which uses the existing browser to open itself, hiding the frames / URL bar of the browser, and has access to system resources (fs, child processes, etc.)?
Edit: I'm thinking something on the lines of "bundle node.js + an HTML into a .app which opens an existing browser (pointing to that HTML) without the URL bar". Node.js can then access the filesystem and communicate with the App via HTTP, WS, etc. The only real problem here is opening Chrome without the URL bar, I guess.
I saw nodekit which is an attempt to use the JavaScript engine already available on each platform.
So for example on Mac it'll probably use WKWebView and on Windows 10 it'll run on the JavaScript Universal apps platform.
For most though, only having to test on electron makes developing apps much simpler and you can have a fully functional app in an installer under 40MB.

javascript source files are being loaded very slowly in browser context in an application with Java8 and Tomcat8

we have created an application using Extjs(UI side) and Java(serverside) with either Tomcat or Jetty as an application server.
Whenever we are trying to run our application with Java8 and Jetty its working fine but if we try to run it with java8 and Tomcat8, the loading activity of javascript files in browser context becomes very very slow.
I am not getting the reason. is there any issue in Tomcat8 as my application with java8 and jetty is working fine.
I have tested it on latest chrome.
If anybody has faced such issue, please suggest a way out of this problem.

android app with apache cordova

I'm developing a web app using HTML5,CSS3 and JavaScript.
Then I want to use the Apache ordova platform to generate a native android app from my web app but I still don't understand what do I need for this,specially do I need a server-side development with php for example??
First off i suggest you read this
Pretty much your app will be able to accomplish a little bit more than what you would be able to do in a browser if all you had available was the ability to write html/js*.
*by this i mean that you have access to device-specific hardware which is not available in a browser and a few more things but pretty much that's it.
You will need to install node.js (or io.js), then install cordova through npm, and make sure you have the Android SDK installed. Once you create your project, your html/css/js will be wrapped into a native webview component, you do not need any server to render it, effectively your app is a native app that can be installed from google play.
You will need a server, typically a RESTful API, if your app needs to query data remotely or persist to some third party. If you are thinking through a classic MVC mindset (render a page through some php code) then you probably need to read about cordova and how it works. A cordova app is a client-side only app, no server-side processing is possible unless through a network communication to a server you have access to on the internet. You can do persistence locally (to the android device) and even use a local database, but remember that this db exists on the device, so you won't be able to share information between users unless you somehow coordinate that through your app (and most likely a server-side app / rest api).
It is unlikely that your existing web app can be wrapped into a cordova app straight away, cordova apps are single page apps mostly.

How to use the browser as the GUI for an offline application?

I want to be able to create an offline program that can use the browser as GUI. I'm not particularly good at GUI programming in general, and overall it seems that using HTML and CSS to structure a GUI would be the easiest.
Cross browser method is preferred, but I will most likely use Google Chrome
I need to be able to open an external program, possibly with command line arguments
Javascript seems like the best language for this, however as far as I know it isn't possible to launch programs with it.
This is on Windows 7.
That's a good idea and is done by a several popular softwares.
The best way is to make your offline program run a web server that the browser will be able to access.
ie: Your program starts a web server on localhost:5555 and then you'll be able to request http://localhost:5555/users in Javascript, from your browser.
Another approach could be using a UI framework like AngularJS + local storage. I'm working on an app right now that will be used online (connected to the web), online locally (connected to a local server that is not connected to the web), and offline.
You could build a single-page web app and let Angular manage all the "urls".

Categories