How to make laravel executable using Java? - java

Any Idea/Suggestion how to wrap laravel so it becomes executable with Java Program?
So the idea is I'd like to create a GUI using Java for doing laravel command like serve, queue:work, migrate, etc. Thus the threads/processes are handled GUI-ly by Java.
But as we know, laravel requires so many prerequisites to be installed first, for instance, PHP and mySQL.
Wouldn't it be great to provide a GUI to control all of that? So all the administrators need to do, just extract my app, open the java GUI app, click start button, and voila! it's served.
Thank you in advance!
RESOLUTION:
Developing another app to run a standalone webserver is almost impossible if not impossible. So I decided to create a VM to run everything.

Related

deploying a java SE application in Netbeans8

I have built a GUI application in Java using Netbeans 8.0 and have linked it to a MySQL database on my system using JDBC.
This application provides login functionality to its users and lets them take a survey.
My problem is to host this application on the internet and collect the data filled by users in MySQL database.
Can someone please suggest how to go about this??
I am a newbie and have tried using java web start to make this work.But no success yet.Please suggest how should I go about this.I'm saturated with all the googling.
I don't get what your problem is. Normally a GUI application is a program which can run on a desktop machine. If I understood well, you want to create something which connects to a remote database. You can do this with your application but you need to distribuite it along the users. If you want to run a java code on host so that people can use it in internet like a webpage you need one of these:
applets
a webserver capable which can run java and jsp/jsf or whatever
If you can be more specific I can help you in a better way.
Cheers

From a web appn, how to run an exe on client machine without user interaction

I am developing a web application using HTML5, AngularJS, REST Webservices, Java etc. I will be hosting it over company's intranet. I have a peculiar requirement where I need to run exes which are already copied to client machine. The 'run' should be triggered from backend java code and user need not click on any UI link.
I am exploring Java Web Start, but I guess some user interaction in mandatory in it. If some signed content, certificates are required I can do that.
Is this feasible?
What you want is exactly what any virus builder dreams of. Therefor, it has been made VERY difficult. There are only 2 ways in which I think you could do this:
Use a java applet. It needs to be signed perfectly and the security settings in the users browsers need to be lowered. Even then I'm not entirely sure they don't have to click 'accept' somewhere.
Create a browser plugin. You could write a browser plugin, which would allow you to do basically anything you want. You would need to install it everywhere though.
If there is any way of getting around the requirement of running an exe from a web browser, I suggest you take it.

Using a Java program I made on a Web Server

I created a small application that, when run, creates or updates some tables in a database by extracting data from some PDF files. Everything works fine in this desktop application, but the next step for me would be to make it possible for an administrator on a website to upload a PDF file and my Java program would then run and update the tables accordingly.
The problem is I have no idea where to start with this (the site isn't done yet, but I'm running some tests and it is going to be coded in PHP). I'd like to know what kind of technologies I need to let the server run the program and update everything as it would in the offline version. Sometimes it takes a while to update everything, so ideally, the user uploading the PDF could continue browsing other pages while the server does its job. (I'll probably implement something that when the server is done processing the file, it says if the program ended successfully or not in a log file)
Can someone tell me what terms to search for on Google or give me some pointers? I haven't chosen where my website is going to be hosted either, so if someone could tell me what to look for to know if they support running applications like this, I'd really appreciate it as well!
This could also apply to other programming languages as I know a bit of Python and C++ as well, so in the future I might have some applications in those languages I'll want to use on the web.
If I'm not approaching this the right way, I'm open to other suggestions, but the best solution would be to keep my Java program intact as I know it works exactly like I want it to and I'd rather not have to start it all over again.
If your host is *NIX based you can use crontab (Automatic Task Scheduler) to run your program at set intervals. Make it check if a "new" PDF exists, and run the program if there is. There may be a way to use Windows Task Scheduler type programs to do it on Windows. This is probably the easiest way.
Alternately you can use You can use shell_exec() in your php to execute a command on your *NIX system directly to run your java program.

How to start a local port on user's computer (Edited question)

sorry in the past I have not been able to formulate my question coherently. This will be my last try. =|
Basically, I want to do something like this website is doing: http://www.ninjavideo.net/video/56388. They are rendering an iframe that points to a port on localhost. You will see nothing in the iframe if you dont have their applet running (which can be found here: ninjavideo.net/applet.php ). I want to write a script that does something like what applet.php is doing, but I don't think they are using only php code as it won't run on computers that don't have php installed. Do you suppose they are using Java/C to do this?
Thanks for all your suggestions.
An Applet is basically a piece of Java code which is served by a webpage and is supposed to run at the client machine. You can learn more about Applets at Sun's own Applet tutorial. If you're green to Java as well, then I recommend to go through Trials Covering the Basics first. Opening sockets (ports) using Java code is covered here.
That PHP script is just serving the applet code from the server, so that the client can download it.
You could do this in PHP using a ready-to-run Apache setup (there are some that are ready to run from a USB key, should be possible to make into something that a client can install, but is complicated, see e.g. this tutorial) or a product like NuSphere Dock:
PhpDock is a deployment platform for PHP applications.
PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.
PhpDock combines NuSphere's powerful embeded Srv webserver and browser components.
I would usually say that if you are looking to build a Windows application, you should go with a tool that is aimed at just that, i.e. C++, C#, Java, the .NET platform, Delphi, and the likes. But if you need some kind of daemon or local web server, you may actually be well off with a product bringing a web server to the desktop.

How to setup Connectivity between the web component and java app

I am confused about the approach for application that am writing. I have developed the application jar and will be distributing via java webstart.
Now i need to putup a website supporting my app.
doubts i have
1)Can i pass this username and password to the jar that i will be launching?
2)Can the webcomponent calculate the time for which the app was launched.
Basically i need to understand how will the webcomponents and my java app interact with each other in terms of any data required to pass to the app and any info retreaving from the app and putting on the web.
Thanks
Krisp
I want to pass arguments like username to the JNLP and then want to pass it to the main class.
Is there any direct way to do so rather than use database?
since JNLP is just an xml file. I could not find a direct way to do so.
Can i anybody refer me some working code example.
Database is probably your best bet for sharing data between both apps. Other options are web services, sockets, RMI, etc.. You will probably need to look into all, on the surface initially, to know what suits you best.
As for the Calculation of the time in my java app i can use currentTimeMillis() to calculate the time for which my app is running.
But senarios like app getting crashed or forced termination of the app it will not get saved.
Any Hints for communication in terms of data between the web and Application jar?
Thanks
Krisp

Categories