• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating and building Standalone application

 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a need to develop a Standalone software. i am planning to develop it using servlets and jsps. i want to know how to export and install it to the client machine. Its a Stand-alone software, which is a simple data-show up from database kind of work. can anyone suggest me on how to export and install it. i know i should bundle entire application into a JAR file. But i am not familiar on how to install at client's system and make it work. Thanking you in advance.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say its an application built using- servlets and jsps. For this you need to create a war file. You need to install Application server- like tomcat on the client machine (which the client may not like) and then deploy the war there.
OR
Better way is to host your application on some Servlet hosting provider and then your client can access the application via the internet.
OR
You can create a standalone desktop application and package the application into a jar and give it to the client. The client should have JRE installed (I think Most of the OS would come with the JRE installed)
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of three i suppose, the last option makes more sense to me. Could you explain it more. i have database scripts also. so does that mean, i need to have a Oracle/MySql installed on client machine.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashwin Sridhar wrote:Of three i suppose, the last option makes more sense to me. Could you explain it more. i have database scripts also. so does that mean, i need to have a Oracle/MySql installed on client machine.


There was a discussion sometime back regarding using of embedded database - Apache Derby. (May be you can search in Javaranch for that discussion).
You can embed this database along with your application jar.
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your Quick Respose.

Using derby would be an excellent idea.

Even if i package my application as a JAR, i would have to unbundle it and deploy it in the tomcat server at client place.

i want the client to unbundle-deploy the application on a single click from the setup.

i am looking for such a kind of approach. any suggestions on this.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that you will be using the wrong technology if you are installing a web server such as Tomcat on your client's machine. Nothing you have written makes this sound like the right approach. Just the opposite - I think you need a standard Java Swing application.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are building a Desktop applications- which runs outside the browser- you make use of Swing of JavaFX 2.0 (still in beta) to build the GUI. Then you create a jar for this application which would include your apache derby jar as well. And you would not need a Application server for this.
Either you can write a OS specific script to run the jar and give it to the client or give just the jar.
Also you can have a look at- Java Web Start- Thats another way of distributing/launching the applications.

Dont expect client to install extra tools to run your application- the bare minimum would be the JRE and if you use Java Web Start it will download the JRE if it detects that the system has no JRE installed.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought this might be of some help: http://izpack.org/
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestions.
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The derby database is connecting fine. But when i try to launch the application from a jar file, i am unable to access it.

Should i have to bundle the database on to the jar.

i register driver and create connection in following way

Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();

con = DriverManager.getConnection("jdbc:derby:E:/Mydatabase");

This is not working when launching using a JAR. Any idea
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As mentioned in the other thread here: http://www.coderanch.com/t/545378/java/java/build-derby-database-jar#2474446
You need to have the Derby jar along with your application jar. Just like you package other 3rd party jars with your application.
I havent used Derby myself, but I am sure there would be how-tos on the internet that will guide you through the process.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic