How to have a Java application get the latest version of itself? - java

I would like to make an update finder, so to speak. The client application would send a request to the server, get the latest version, and return it to the user in the form of a prompt:
There is a new update, X.x. Would you like to update?
Something of that nature. How would I go about doing this?
Also, if possible, please don't suggest API's unless it is either really necessary or it would be really hard for a beginner to understand. I would like to keep my project working with core Java packages.

Have you looked at Java Web Start?
Updates to a Java Web Start application are automatically downloaded when the application is run standalone from the user's desktop.
http://docs.oracle.com/javase/tutorial/deployment/webstart/

One way to do this easily in Java is to use Java Web Start.

Related

Applet/JNLP on Java 11 migration

I have an application that runs under Java/JNLP applet and I would like to migrate to Java 11.
As you know the applets and JNLP will disappear from Java 11.
The goal is to keep my old code and remove the packages that contain the applets, is it possible to do this migration without switching to a new technology?
Finally, I chose Swing with Getdown which resembles JNLP.
A migration to a JEE/Spring solution would have completely modified the operation of my application and still take a lot of time. Tip: try it for yourself Getdown.
Yes and No.
Yes you can keep your java business logic and data handling code (presumed you did a clean separation of your application layers). E.g. just convert to a standalone java app and you're fine.
No, if you look for something to run in the webbrowser then you have to migrate to JavaScript/HTML/JSF/GWT... on the frontend and your java code running on the backend (JEE or Servlets ...).
Regarding the "No", it depends on what kind of application you have. A web application or a standalone application?
(1) For a web application you have to recreate the front end part (UI, communication with the server) but you can reuse parts of your logic.
(2) For a standalone application (using Swing/AWT/JavaFX ...) you can keep your code, just create a standalone app out of it. For distribution e.g. JavaFX offers an application packaging mechanism.
PS: The quickest way could be the conversion to the webstart technology however it was also deprecated and will be also be removed in future. So I would not use it.
One solution might be the WebStart replacement that Karakun is currently working on: https://dev.karakun.com/webstart/
Currently it is not clear when and how this will come since it is based on a kind of crowd-founding but since everyone can get involved (even with low cost) this is a very good possibility.

How can I deploy deploy my local Java "Web Application"

all!
I'm currently working on a project for a friend of mine. I'm using a WebView for the GUI so that I can use web technologies instead of Swing or JavaFX (I know that WebView is part of JavaFX).
I'm also using JSP, so I'm using jetty (will change to gretty soon) as the servlet container/web server. My friend needs to store data somewhere, so I'm using SQLite as the database.
Currently I just build the project through gradle, but I'm unsure how I can deploy this (as an executable jar for example) for my friend. I need to somehow execute jetty and SQLite before the actual front-end, but I'm unsure of how to do that.
I imagine I should make a driver file and execute those programs from main, but I'm unsure of how I would go about doing that. If this is the case, could someone go into detail as to how to approach it this way?
I'm also not turned off by out of the ordinary solutions! If it works, that's good enough for me!
Any help at all would be immensely appreciated! Thank you all very much!

While in development in Xpages Libraries, changes are not picked up

I work with multiple XPages Libraries that contain all of our Java code outside Domino Designer. I'm using Eclipse Mars and have setup the Xpages SDK to make this work. Most of the Java code is called from Xpages (or managed bean inside a nsf). But everytime when I make a change in our Java code, the change is not picked up. I need to "restart task http" on my Domino development server everytime.
When I turn on debugging and change Java code, all changes are picked up immediately but it will crash my server when I change a return type or add a new function or move classes between packages.
Is there an easier way to develop in Java without restarting the HTTP task everytime I make change (or prevent those server crashes)?
When debugging from Eclipse, if you use the Stop option, it crashes the server. If you use Continue, it works fine.
In terms of hot-swapping code, there isn't a way currently. JRebel can be used with some servers, but I don't know of anyone who has got it working with Domino.
It's not specific to plugins though. The same is true of any shared Java code, presumably because it's compiled to byte code and cached. See this blog post where I had issues with SCXD http://www.intec.co.uk/single-copy-xpage-design-some-learning-and-why-its-not-for-me/. There are various tell http osgi commands including ones for bundles etc, but I haven't found one that successfully reload plugins. I think Cameron Gregor did some investigations as well, but also couldn't find a way. It's one of the issues I highlighted with OSGi development on Domino on my blog http://www.intec.co.uk/from-xpages-to-web-app-part-seven-osgi-application-development-introduction/.

Apache MINA Vysper documentation?

I plan on making an instant messaging app on Android and iOS, where you can chat to other people with the app, along with some custom features.
I’m going to use the XMPP protocol, and make a custom extension for it. I plan on making a Java application running on Amazon Web Services (AWS) so it's scalable.
After researching server options I’ve decided to use Apache Vysper.
However, I’ve never made a proper Java application before, and have never used XMPP, AWS or Vysper – so I’m rather reliant on good documentation :-)
The Apache Vysper project is very new and so the docs are a bit sparse. I was wondering if I was missing something, should I be using the general MINA docs as well? Are there other resources
elsewhere I don’t know about?
“Apache Vysper can run stand-alone or embedded into another
application.”
To be honest I’m just as lost when it comes to working out what to use to make a Java application anyway. Do you know if the AWS Java SDK has everything I need to make an application to use on AWS? And then is it a simple matter of integrating Vysper into this? Or do I need to make a Java application using something such as the Spring framework?
Thanks for taking the time to help me. If you know anything that could clarify the situation I would really appreciate it :-) --and sorry be being a bit useless, but hey, we've all got to start somewhere right ;)
First of all, as the founder of Vysper I apologize that the documentation is lacking completeness.
To answer your question(s).
Most Java applications bring their own ready-to-go start scripts with them.
Vysper is no exception. You get the pre-packaged download here:
http://mina.apache.org/vysper-project/downloads.html
Ok, before running it, you need to have Java installed, whether you're on your own machine, AWS, a server or a virtual machine anywhere else. Get it from Oracle, or use the package management of your Linux distribution. Make sure that after installing Java, you can execute "java -version" on the command line and you are all set.
Then, unpack the Vysper download, change to the bin/ directory and execute "run.sh" or "run.bat", depending on your OS.
Please note that support for Vysper - besides here on StackOverflow - is available on the MINA user mailing list here:
http://mina.apache.org/vysper-project/mailing_lists.html

How to make a browser based IDE to code in the cloud?

I have read a bit about cloud and browser based IDE's.
I am planning to make a Java based bare bones IDE by integrating a compiler to code in the cloud. This is for educational purpose as I am just determined to learn to develop cloud based IDE.
I want it to be something like eclipse Orion but i want it to allow for coding in java. It should allow users to code, compile and run java programs by directly writing .java files and not by converting the .js files into java files.
Can someone please suggest me an existing cloud that I should use for this. And also, I am just a beginner and I have no clue about how to proceed and the articles that I am required to read.
Please do let me know what I should begin with and the cloud that suits my needs the best.
Thank you very much in advance.
You should look at projects like Mozilla SkyWriter, which implement the bare bones editing functionality
(There have been a lot of change lately. There seems to have been migrated to Ace)
You can use Codenvy and put your code on a Git repository. Then, you could build automatically once you have done the push using a CI tool like Jenkins. Now, I have an environment in which I use a Jenkins instance as a Service and also a runtime environment so I can get a continuous deployment pipeline. This video will show you, in a graphical way, what I am talking about.
Koding provides you with a full Ubuntu machine, with root, so it's able to run and do what you want, programming wise.
The reason i'm suggesting Koding though, is that they have a Framework to develop your IDE for the Koding VMs themselves.
The logic here, is that making IDEs is challenging, but the biggest challenges is ensuring security between your IDE users. Using another VM platform would mean that you don't have to manage the security of your VM, and focus entirely on your IDE.
Let me know what you think :)
For virtual/cloud hosting try one of the following:
Rackspace
VPS Farm
I like vpsfarm because it is cheap and pretty bare bones.
For the IDE itself, I would first create a webapp that can upload and compile and run arbitrary java code, without adding libraries or J2EE. That alone will be a good undertaking for one dev.

Categories