Swing app installation [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've made Java Swing application using hibernate (it automatically creates tables etc. when it is run). I need to make some installation version to my application, is it enough to just upload my jar file? What should I do when I want to publish my application? Just prepare link to jar and some readme which contains info that for example:
install newest version of java ( http://www.java.com/download )
make msyql database user 'user' with password 'password'
create database "application".
run application.jar
Edit
I want to simulate process of selling my application to some company. For example my application is hmm to manage some store, u can put there some notes, bills etc. This application works on some database, which ll be placed somewhere in this store, I don't want to make this application accessible from internet. So how should i install it? Readme file example was kinda bad, now we can assume that i need to go there and install for them database and configure it. So at the moment I need only to make possibility for company to install my software without me help, in cases for example hiring 100 new people.

If you want your app been redistributable. I'd use Java web start. Read the tutorial
Java Web Start software provides Java developers and users with many deployment advantages:
With Java Web Start software, you can place a single Java application
on a web server for deployment to a wide variety of platforms,
including Windows, Linux, and Solaris. Java Web Start software
supports multiple, simultaneous versions of the Java platform. An
application can request a specific version of the Java Runtime
Environment (JRE) software without conflicting with the needs of other
applications. Users can create a desktop shortcut to launch a Java Web
Start application outside a browser. Java Web Start software takes
advantage of the inherent security of the Java platform. By default,
applications have restricted access to local disk and network
resources. Applications launched with Java Web Start software are
cached locally for improved performance. Updates to a Java Web Start
application are automatically downloaded when the application is run
standalone from the user's desktop.
See also stackoverflow's info page Java web start info

In addition to the fine answer of #nachokk, I'll expand on points 1-3.
The best way to deploy a JWS app. or applet is to use the Deployment Toolkit Script.
(& 3.) Look to using the ExtensionInstallerService. That is what you'd used to install/configure the DB itself. Here is a demo. of the service.

You can create an installer with IzPack.
It can also be combined with Launch4J to download the JRE.

Related

Java Weblogic application in eclipse using tomcat [duplicate]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
What are the recommended plugins for eclipse to work with weblogic? Specifically I would need to work with older version of weblogic, 8.1, however I could use any version of Ecplise. I would like to debug the application and set breakpoints etc.
My bigger task is to move the project over to Jboss, can I deploy the same app on both app servers within Eclipse with presumably 2 sets of config files etc, any advice? 2 separate projects?
If you are using Eclipse with the WTP, then Weblogic Integration is available through an additional server adapter. To get it, right-click the Servers view then select New > Server and click on Download additional server adapters. Select the Oracle extension from the list and proceed with the install. Once installed, you'll be able to add a new server for WebLogic from version 8.1 to 11g (for BEA WebLogic Server v8.1, look under BEA System, Inc.).
alt text http://blogs.oracle.com/gstachni/WindowsLiveWriter/DevelopingApplicationsforWeblogicServer1_C379/image_thumb.png
If you have WTP servers created for JBoss and WebLogic, it's definitely possible to deploy and run the same project on both of them, there is nothing particular to do (the proprietary deployment descriptors can coexist if you want to use them, you don't have to create 2 projects for this).
In order to debug your code running on Weblogic (or any other java server for that matter) you don't need anything but Eclipse itself. Search Google for java remote debugging.
As for deploying to Weblogic and Jboss - as long as your code is not using proprietary stuff from J2EE containers vendors you should be fine with one project. Standard configuration files will be common, container specific files will be separate and often won't even have to be removed in build time as container would just ignore them. This way the same artifact (e.g. War) could be deployed to both containers.
This concerns the JBoss part of the question: If there are real product-specific differences in the code, they should hopefully be localized to one or few classes. Apart from this hygienic measure, it would be unhelpfully painful to separate your project into two.
Most of the configuration files should be the same for the two environments too; if not, you may consider doing what we do at my job site: We have a conf_XXX and a conf_YYY directory for separate configuration files.
The problem of including/not including the correct files per deployment environment should be delegated to one or two ant build scripts. If there are indeed file differences, you can create a proj_Weblogic.war and a proj_jboss.war and deploy those to the appropriate servers. If you can't find specific deployment ant tasks, you can still use straight file copy tasks or scp to move your WAR files into the server's appropriate deployment directories.
This is easy with IntelliJ. No plugins needed - it's built in. I'd recommend junking Eclipse and trying a better IDE.

How do I make an "automatic updater" for my desktop java application? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
“Automatic updates” of java (desktop) application
Nowadays it's common for applications to check online if there is a more recent version of the application, and download that.
But how does one create such a solution for a java desktop application?
Where do I begin? How does it work?
Can you deploy using Java Web Start ?
Using Java Web Start technology,
standalone Java software applications
can be deployed with a single click
over the network. Java Web Start
ensures the most current version of
the application will be deployed, as
well as the correct version of the
Java Runtime Environment (JRE).
The way something like this works is generally you have your application split into multiple modules. Each module would be an updatable unit (you probably wouldn't update specific classes within that module) and would be assigned a version number. You would also need to have an updater module that is completely separate from the rest of the application. It needs to be separate because it's going to modify the binaries of the application. When the application starts, the updater will run and check some website for the most recent version numbers of each module. If any version number on the site is greater than the version currently installed, the updater should download and replace the current one with the new one. As #Brian Agnew points out, there are frameworks that will do this for you in Java. I would suggest working with one of those rather than attempting to roll your own.

Is it possible to create Desktop Application using Java backend & Web Technologies UI [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 months ago.
Improve this question
I would like to create a desktop application in Java & web technologies. The main reason for selecting Java is that it is free, open source, and hence our investment would be minimal and we would save lots of investment with respect to licensing costs, etc. Also, the main reason for selecting web technologies is because our current programmers are well versed with web technologies like HTMl, css, Ajax, and we have good experience in creating amazing UI in web technologies.
I will give you some idea about the software that we would like to create. It would be a desktop based software, namely something like an ERP software.
The key requirements are that there should be a great UI and it should be fast and not very resource intensive.
I have heard that implementing a great GUI is possible, but difficult in Java. It can be done but is complex, whereas it is pretty simple to do the same in Visual Studio, Microsoft products.
I have also checked Adobe Air, Nokia QT, etc but they all are pretty expensive for us and we are looking for front-end browser UI and backend embedded server/database using java technologies.
Is it possible to create a desktop software in which the UI is created using the web technologies and there is an embedded server (like jetty or tomcat) and database and the backend programming would be in Java. How does JavaFX fit into this?
So basically, the desktop application would have an embedded browser (mozilla or some java browser which can packaged with the software), but the end user should never realize this.
I look forward to getting feedback about the same. Can you please provide some examples of software created in a similar combination of java + web technologies.
I did study some softwares like PulpTunes & Zimbra which were along similar lines, but they seem to be connecting to internet to display data. Our software would be totally an offline desktop application.
First of all, it is possible. If you are looking for example, check http://wiki.eclipse.org/Hudson-ci/Meet_Hudson.
You can get basic architecture if you dig into their code. It does not use any embedded db.
You are saying your application will always be offline, in that case I suggest you to go for pure desktop application using technologies like Eclipse plugin development.
If you already made up your mind, here are some points that can help you based on my experience with similar application,
Although your application is offline(I assume, your application need not connect to any server for any use case but the user machine can access internet ), you need to deliver changes(for example, change in html or jsp page )/bug fixes transparently to end user. JNLP/Java web start is a good fit for this.
If you are going for JNLP way of installing, you launcher should take care of embedded db installation and ports at the end user machine(this is big problem than it appears).
Also if you are launching server(in my case, Jetty) through JNLP, you will come across Class loading errors due to permission issues. Be prepared to dig through server code. I have done it long time ago and I do not have code now to point exact issues.
Show progress bars during installation process and during your application startup. Your war deployment takes some time and user needs some of knowing that application is startup is in progress. You will end up writing some swing UI.
Launch URL of the application automatically in default browser of the user system, after application startup. You do not need embedded browser.Check http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/.
I used MySql as embedded data base. Check Embedding mysql in java desktop application. It worked for me, I did not come across any problems.
Yes, it is possible. See https://github.com/jreznot/electron-java-app demo. There you will find an easy way to build Electron based application on Java, without compilation to JS, just Java application inside of embedded Jetty instance with Vaadin UI.
You are truly right, java is great if you are developing a project by self.
Server side coding can be done using Spring (For MVC, Database etc...Very rich and ligthweight framework, easy to learn and understand) with hibernate(ORM framework for Database handling, provides dialects for any Database server).
For UI, you can use Spring MVC OR JSF OR GWT OR javaFX. JavaFX provides JNLP download, which runs on java and without browser. check the link for more JavaFX samples. http://javafx.com/samples/
So its on you, what you want to use for UI side. If you prefer web UI (Not javaFX i mean) then you can have many options.
For Ajax, you will have libraries which support easy ajax. like DWR (Easy Ajax, JS to JAVA) and many other JS libraries like yahoo, jQuery etc.. can be used.
hope this helps.
IMHO the whole idea of running a web-server just to create a desktop app with js and ajax and stuff is horrible... I heard about Apple-creator Titanium which is allows to create crossplatform apps using web techniques. There are couple other similar programs as well.
I think you'll end up better buying a good wyswing Swing design tool for java ui which will cost you couple hundred bucks but will save you lots and lots development trouble. It is very hard to believe that laying out a nice desktop app is more complicated than laying out a web page.
I didn't get the embedded jetty/tomcat part. You want the desktop app to run an embedded server that talks to the database? So each desktop app would open a DB connection?
Why not have a Java desktop app that sends HTTP requests to a JavaEE server that connects to the DB and processes the requests? So basically, a Java client (which could be as rich as your developers can make it) replacing a browser. This gives you a lot more scalability, etc.
We have a similar (albeit much more complex) product developed using
- Swing + Apache Commons HttpClient on the desktop. This makes an HTTP POST request with serialized binary data to the server.
- A dispatcher servlet running in a web container that recreates the Java object on the server and executes the request.
I will probably get stoned for this, but I suggest JavaFX for this. We have successfully implemented a JavaFX-application for internal use in a larger company. The advantages are that the software is "controlled" on the server side (thus, nobody will have an "old" version). Installation effort is minimal (Java Web Start fixes this for you, it will even trigger a minimal JRE-installation if none exist) and last but not least, JavaFX can be run in the browser and as a pure desktop application alike without having to change the code.
Adobe FLEX is another contender, but it lacks the "Web Start" bit and is not quite as flexible when it comes to easy migration between browser and desktop.
Anyway, JavaFX is not quite feature complete as FLEX but version 1.3 can be considered battle-ready and you can create neat stuff with the free JavaFX plugins for Adobe Creative Suite (if your app will contain any graphics, that is).

How to distribute a Java desktop application?

What is the alternative to distributing Java?
I don't want to add JRE in my extracted files.
I don't want to give away my .jar file to the user.
The end user just install and use application.
Which database to use so that the user don't need to configure like SQL Server.
How to decrease execution time of my application? It takes more time to execute.
Edit
It is an application without a database.
There should be a setup file which installs in Program Files and shortcut on the desktop and some registry entry to start it with start up application.
You can deliver Java desktop apps as Applets and (more recently) Java Web Start apps. Using these technologies means that users don't need to manually handle files.
As for RDBMS, there is a pure Java RDBMS going by the names JavaDB and Derby which might meet your needs.
There are many ways to improve the execution time of a program, it depends on what you've coded and what it does, for a start. I think you'll need to ask a specific question on that to get a useful answer.
Java Web Start works well as a distribution mechanism. Host the .jar on your site and your clients can download (provided they have a JRE). It'll select the appropriate JRE to use and allow you to update the application at your end with automatic downloads.
If you want a database, check out JavaDB. It's pure Java and comes as standard with Java 6. Your application can check for an existing db on start-up, and initialise/configure if not present. That will then remain for future invocations.

How to work with Weblogic in Eclipse? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
What are the recommended plugins for eclipse to work with weblogic? Specifically I would need to work with older version of weblogic, 8.1, however I could use any version of Ecplise. I would like to debug the application and set breakpoints etc.
My bigger task is to move the project over to Jboss, can I deploy the same app on both app servers within Eclipse with presumably 2 sets of config files etc, any advice? 2 separate projects?
If you are using Eclipse with the WTP, then Weblogic Integration is available through an additional server adapter. To get it, right-click the Servers view then select New > Server and click on Download additional server adapters. Select the Oracle extension from the list and proceed with the install. Once installed, you'll be able to add a new server for WebLogic from version 8.1 to 11g (for BEA WebLogic Server v8.1, look under BEA System, Inc.).
alt text http://blogs.oracle.com/gstachni/WindowsLiveWriter/DevelopingApplicationsforWeblogicServer1_C379/image_thumb.png
If you have WTP servers created for JBoss and WebLogic, it's definitely possible to deploy and run the same project on both of them, there is nothing particular to do (the proprietary deployment descriptors can coexist if you want to use them, you don't have to create 2 projects for this).
In order to debug your code running on Weblogic (or any other java server for that matter) you don't need anything but Eclipse itself. Search Google for java remote debugging.
As for deploying to Weblogic and Jboss - as long as your code is not using proprietary stuff from J2EE containers vendors you should be fine with one project. Standard configuration files will be common, container specific files will be separate and often won't even have to be removed in build time as container would just ignore them. This way the same artifact (e.g. War) could be deployed to both containers.
This concerns the JBoss part of the question: If there are real product-specific differences in the code, they should hopefully be localized to one or few classes. Apart from this hygienic measure, it would be unhelpfully painful to separate your project into two.
Most of the configuration files should be the same for the two environments too; if not, you may consider doing what we do at my job site: We have a conf_XXX and a conf_YYY directory for separate configuration files.
The problem of including/not including the correct files per deployment environment should be delegated to one or two ant build scripts. If there are indeed file differences, you can create a proj_Weblogic.war and a proj_jboss.war and deploy those to the appropriate servers. If you can't find specific deployment ant tasks, you can still use straight file copy tasks or scp to move your WAR files into the server's appropriate deployment directories.
This is easy with IntelliJ. No plugins needed - it's built in. I'd recommend junking Eclipse and trying a better IDE.

Categories

Resources