How to execute a jar file in other machine?
Hi all,
I am working with java. and my machine is connected to LAN.I would like to execute a jar file in my machine from a remote machine that is also connected to LAN.how should i go about doing this.Help me if somebody have a solution as i am badly in need of this.
Regards,
Mohan
Hi Mohan.tkm,
If you want it to be done in pure Java and independently of the OS of both computers, you may build a RMI server that will launch your JAR by request of a remote RMI client.
There's an example of RMI here .
Similar Messages
-
How to execute a jar file which has an applet, without using a html file ?
I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
<html>
<applet code="file.class" archive="file.jar" width="500" height="300">
<param name="name" value="value">
</applet>
</html>
I want to know how to execute this class file without using the html tags.
pls help me out in this.
AnkiHi,
You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
1. Open a notepad and write the following
Main-Class: XXXXXXXX
XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
2. Save the file as Mani.mf
3. In the commant prompt ( your directory ) type following lines.
jar cmf Mani.mf Demo.jar *.*
4. This will make a jar file which is executable jar file
Hope this will help you.
Deepak -
How to execute a jar file in a java application
Hi,
I've already try to execute a jar file by this way :
Runtime.getRuntime().exec(java -jar myJarFile.jar);
But the problem is that the display doesn't launch. Normally a "JFrame" display.
however the corresponding process is launched.
So i would to know if there is a way to execute a Jar File without using the Runtime class.
Is there a specific class for the Jar File?
Thank you.
RichardCreate a 'manifest' file pointing to the 'main' class, jar it into the .jar file, place it onto your desktop - or whereever you can click on it, and click on it.
-
How to place/retrive a file in other machine connected in a n/w
I am in urgency to have this information. I would really appriciate if any one can gimme the information.
I am involved in developing a web-based application.
I would like to give a breif description of my requirements.
1)User browses a file and specifies a location to store that file. The location typically will be a directory (unix dir like /usr/tmp)of any machine connected in the network and clicks archive button. That file should be stored in that location specified.
2)User will give the location of file(the location will be full path file in any machine connected in the network ) and clicks DownLoad button.
How can I do this. I explored how to upload a file to Tomcat server and My question is how to save this file in the directory specified by the user (if the machine is other than where tomcat is residing)and how to retrive the file specified by the user.
How can I do this using Servlets & JSP. It would be too great if one can gimme code snippts or atleat let me know the procedure.
Thanks & Regards
Kishore Kor if you are using linux then simply run java JMFRegistry and you should be able to see JMF Registry Editor where you can turn on the logging by checking "Allow Logging " and by specifing the logging directory for jmf.log file.
-
How to read a text file from other machine???
I have a text file located in local machine. I use th e code below to retrieve data from that particular text file.
String realPath = (String)getServletContext().getRealPath("");
BufferedReader holsFile = new BufferedReader(new FileReader(realPath + "/webpages/holidays.txt"));My question is , how could I retrieve the records from the tsxt file if the file is located in another machine or webserver?
Thanks for advanced.It's ok to be new.
The answer is yes. (But I'll let you look in the javadoc to see which package it's in).
Also it may be worth understanding that there is no such thing as a "function" in java, operations are termed "methods". To go further, you should realise that URL is a class not a "function" or method. The parentheses mean you're calling the constructor.
HTH
/k1 -
How to run my jar file on a webserver
hello everybody,
I've created a chat aplication which consists of a client-side and server-side. The client-side is an applet and is working fine. But i'm getting problem with the server-side. Actually, it is working fine on my local system and even in a local area network. But now, i want to put the server-side on a webserver. So, i want to know how can i do that. My server-side is a jar file "chatserver.jar" which i've developed using frame containers. I want to know also how to run the chatserver.jar on the webserver. Is it that i should have implemented jsp? Or javascript? coz my chatserver must be always running 24/7. It must not be available to user. users will chat through applets and the data will be sent to the server-side which will in turn control and recognise those data. Can anyone please help me in that issue.that was very kind of u for replying to me. thanks a lot. Well, the web software i'm running is nothing soo great but it's simply a chat server side application. In this application, i'm using a thread where my datagram socket will keep on receiving data from clients and this server side apllication must response to the client. For example, if a client has added a new room, or a new user has logged in, the server side must take care to inform all other clients that a new user has just logged in or a new room has been created. The main method is in the "chatserver.class". Then, i've combined all my classes including the chatserver.class into a jar file. When i click on the jar file on my local system or on the server of a local area network, it works beautifully. So, my server side application works like that. I have to click on the chatserver.jar once and nothing else. No other interaction with the applicaion. But my problem is how to run it on a web-server like apache. Or even if i upload this software on a website, how do i make it run? Shall i implement jsp codes? If yes, how to execute such jar file using jsp?
here are part of the codes where my datagramsocket is receiving message from clients:
public void run()
while(thread!=null)
byte[] recbuf=new byte[65536];
recpacket=new DatagramPacket(recbuf,recbuf.length);
try{
servsocket.receive(recpacket);
if(servsocket==null)
byte[] bt=recpacket.getData();
String recvmess = new String(bt, 0, recpacket.getLength());
InetAddress clientaddress=recpacket.getAddress();
int clientport=recpacket.getPort();
chatcom=new chatcom(this,clientaddress,clientport,recvmess);
try{
thread.sleep(10);
catch(InterruptedException _INExc)
chatcom is another class which i've created to differentiate if the data received is a message, new room, new user, etc... I've created my own RFC to make those differences. Like i said above, if a client has created a new room, the chatcom class will recognise that a new room has to be created and will therefore send the new room created to all other clients. So, i want to know how to get my "chatserver.jar" run on a web server like apache or even on a website if i want to upload this software. Coz once it starts running, i dnt hav to close the application. I mean to say that this application will have to run 24/7. Do i have to execute it externally using jsp codes? Is there any way to get my application run on a webserver? -
How to run a JAR file in Unix system?
hi there
ca anyone tell me how to run a JAR file in unix system or X window, thank youYou want to create an executable JAR file? You do it in the following way.
Create a manifest file such as manif.txt and the contents should contain
Main-Class: foo
assuming foo is the name of your main class. Then create the jar as follows
jar cvfm foo.jar manif.txt foo.class
I hope that helps you!
you can find more info here http://java.sun.com/docs/books/tutorial/jar/ -
While executing a jar file I am getting an error
while exec a jar file i am getting an error
invalid file (bad magic number): Exec format error
i tried to execute it with the commnad
java -jar test.jar
or by directly too
./test.jarThan tell me how to launch a jar file I tried different ways like
java -jar MyJar.jar
and
MyJar
and
./MyJar
but its not worked -
How To Access a jar file present outside the war file through a jnlp
Aoa
I m new to this forum
I m having problem with my jnlp file
i want to know is there any way to access a jar file through jnlp.The problem is that my jnlp file is present in the war file
and i want to know how to acess a jar file through this jnlp.The scenerio is as below
I m using ear file on jboss.Its hirerchy is as
-PAN-war.war
-launch.jnlp
-PAN-app-client.jar
my jnlp file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="PAN/launch.jnlp">
<information>
<title>PanEmirates</title>
<vendor>M Fazal Ur Rehman</vendor>
<description>PanEmirates</description>
<description kind="short">PanEmirates</description>
<homepage href=""/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+"/>
<jar href="PAN-app-client.jar" download="eager"/>
<jar href="lib/javafxrt.jar" main="true" download="eager" />
<jar href="lib/Filters.jar" download="eager"/>
<jar href="lib/javafx-netbeans-fxuserlib.jar" download="eager"/>
<jar href="lib/swing-layout-1.0.3.jar" download="eager"/>
</resources>
<application-desc main-class="net.java.javafx.FXShell">
<argument>pan.Main</argument>
</application-desc>
</jnlp>
when i run launch.jnlp file it says unable to download resource http://localhost:8080/PAN/PAN-app-client.jar
how to access this jar file
Any help or comment would be highly appreciated
Regards
M Fazal Ur RehmanExcellent question. I don't see any client-jar in your EAR file structure. So I am assuming you are writing a separate client application which will talk to the ejbs deployed as part of this EAR. You need to do the following:
Write another EAR file with the following structure:
ear:
META-INF/application.xml
util.jar
client.jar
client.jar should have a META-INF/MANIFEST.MF and that should contain Class-Path:util.jar and value for Main-Class attribute.
Now deploy this new ear to your application server and execute it using Application Client Container that comes with your app server.
If you don't want to write another EAR file, then bundle th client.jar in your original EAR file.
Points to note are:
you have to repackage util.jar again inside this ear file.
For portability reason, you should use Class-Path manifest entry in client.jar. Refer to http://java.sun.com/j2ee/verified/packaging.html and J2EE platform spec section #8.2.
Hope this helps,
Sahoo -
How to import external jar file
i am using bcprov-jdk14-124.jar file for my project. i can import this jar file through eclipse project properties but this is not worklng when i create jar file for my project. This is worked in eclipse only. i want to use that jar file in my project current path. so any body help me how to import this jar file? ( i am using mac os to develop java project )
You need to specify the classpath when you execute it outside of Eclipse.
Kaj -
hi
can anybody tell me how to run a jar file in java,is there any need to unzip a jar file before running it?
Thanks in advance.Set the classptha, if you want to run it by double clicking.
I assume that you know, how to set the classpath.I though that if it is an executable jar, the classpath environment variable will be completely ignored. Are you saying something to the contrary? -
How to load a Jar file in the class path?
How to load a Jar file which contains class files, images, etc.. in the classpath without using URLClassLoader.
You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.
-
How to make a jar file downloadable with IE
hello,
I just bought a website:
http://www.frozenfountain.net/
and I put a jar file on it called Logo.jar
Using Mozilla, the jar file downloads as expected, but with Internet Explorer, it tries to download it as .zip file.
How do I get it to download as a .jar file with IE?
thanksJust post a link to the Jar. Mozilla will download
it as a jar. Windows will download it as a zip.
Only one link. No problem, really. ;-)There is a problem. People who arent as good with computers as you are won't know how to run the jar file after downloading with IE.
At school, I told someone to download the file, which they did with IE. It downloaded to desktop as a zip. They extracted and were left with a bunch of .class files.
On a sidenote, how do you draw text with a gradient? -
How to call a jar file from oracle forms (6i)
Hi,
I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
thanks.
dumindaI created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
then i tried to run it in application server. its still not running.
can you tell me what i have to do within my bean class? or can you suggest any solution?
thank you. -
How to call a .jar file from a java bean?
any body knows how to call a .jar file from a java bean?
Crosspost!
http://forum.java.sun.com/thread.jspa?messageID=4349619
Maybe you are looking for
-
Production order not settle correctly
Hello Guru, PO70 in the closing steps showing the balance of production jobs that settled in the current month. Normally the account holds hundreds of records for thousands of dollars. February close had approximately 10 records for $.05. 1. How C
-
IWeb 08 screws my photos color profile
Anyone has this problem with the new iWeb 08? I installed the new version, ran it without any problems, did some rearranging of my site, created a new page etc.. And then published the whole site all over again. But now, all my images are tagged with
-
Document No. in parallel Ledger
Hi, We use parallel ledger in TRM and create two valuation area 001 and 002 for IGAAP and IFRS. We Initialization of Parallel ledger. We post both valuation area for accounting but system pickup diff. number range as per valuation area. My document t
-
Posting Stock of a Material to Interim Account
Hi, I want to change the Valuation class of a material. I have marked all relevant open purchase and production order as Deleted. However there is some valuated stock existing for the material. I understand that we need to post this to other account.
-
Oracle 9i download a full version or just trial
Is the Oracle 9i Server software that you can download off of OTN a full or trial version? We are in the process of updating our Oracle license but need to upgrade to 9i right now. We have been told that we can not get the cd's until our license is u