aspose file tools*
The moose likes JSP and the fly likes how to run a jar file in serverbased application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to run a jar file in serverbased application" Watch "how to run a jar file in serverbased application" New topic
Author

how to run a jar file in serverbased application

Naveenzion Kumar
Greenhorn

Joined: Aug 02, 2010
Posts: 24
hi friends,
this is naveen .i created a jar file in net beans .its working in stand alone application and also when i am using in tomcat 7 calling through Jsp file its working properly.but when i posted this in to the server or access through client server architecture its not working. i.e when i am calling my jar through jsp file my application is not opening in my client machine instead of that it is opening in server itself .please help me to fix this problem how can i access my jar file.



regards,
naveen
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

You can't. Java code in a web app executes on the server. If you want to run code on the client you need an Applet or use Java Web Start.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

JSP's and servlets always run on server inside a container. So if you are trying to execute a jar file using jsp it will always be executed on Server not on the client machine. You have to do alternative Can you please elaborate your requirement?
Naveenzion Kumar
Greenhorn

Joined: Aug 02, 2010
Posts: 24
Bear Bibeault wrote:You can't. Java code in a web app executes on the server. If you want to run code on the client you need an Applet or use Java Web Start.



then how can i run jar file in server based application .
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Bear already told you:
If you want to run code on the client you need an Applet or use Java Web Start.
Naveenzion Kumar
Greenhorn

Joined: Aug 02, 2010
Posts: 24
Harpreet Singh janda wrote:JSP's and servlets always run on server inside a container. So if you are trying to execute a jar file using jsp it will always be executed on Server not on the client machine. You have to do alternative Can you please elaborate your requirement?


actually i am game project i created scrambled game in swing using Net Beans .my jar file is working in stand alone system by using tomcat 7.0 server.But i posted my jar file in server .i called my jar file from my client system through jsp using "Runtime.getRuntime().exec("/home/ubuntu02/Desktop/NaveenBackup/JavaApplication1.jar");" this code .my application is running in server itself instead of in my client system .how can i fix this problem .what is the alternative solution to fix this problem .please help me to fix this problem . i have to post this in ot the server. waiting for your reply .


regards ,
naveen.



Harpreet Singh janda
Ranch Hand

Joined: Jan 14, 2010
Posts: 317

If your game is in swings than you can convert it to an applet and post the same on the server. An applet will be loaded and executed on client side.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
.my application is running in server itself instead of in my client system .how can i fix this problem .what is the alternative solution to fix this problem .

Bear already told you, and I already told you that Bear told you. Why are you ignoring our posts? They point to the solutions that you will be using if you want to get this done. The sooner you start considering this, the sooner you'll be done.
Naveenzion Kumar
Greenhorn

Joined: Aug 02, 2010
Posts: 24
[ UD: Please do not post the same question to multiple forums: CarefullyChooseOneForum. Let's continue the discussion in this duplicate thread, where you have an answer already. ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to run a jar file in serverbased application