• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to run a jar file in serverbased application

 
Naveenzion Kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[ 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. ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic