jar

I have a java code developed using javamail API and jaf ,now I want to transport this code to another machine having Windows Xp,how to do it? can u help me out.
[167 byte] By [ashishpta] at [2007-11-27 7:08:24]
# 1
What exactly is your problem? Do you know how to use a memory stick?
CeciNEstPasUnProgrammeura at 2007-7-12 18:59:54 > top of Java-index,Java Essentials,Java Programming...
# 2
http://java.sun.com/developer/Books/javaprogramming/JAR/basics/build.htmlCreate the jar for your application and then ship it with the library jar.
JL.Nayaka at 2007-7-12 18:59:54 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi,

I am giving some steps to do it. Try these steps.

If you have any queries please let me know.

1. Open the Command Prompt

2. Move to your code directory

3. Use the following command to create a jar

jar -cvf filename.jar .

(Make sure the path was set or not)

4. Jar will be created move that file to other system

5. Extract them using the command

jar -xvf filename.jar

Thanks & Regards,

Santhosh Reddy Mandadi

santhosh-mcaa at 2007-7-12 18:59:54 > top of Java-index,Java Essentials,Java Programming...
# 4

Thnx santhosh

ur reply will be a gr8 help for me.

I made jar file of the application and put it in a batch file along with mail.jar & activation.jar now wat will b the classpath for that so that I can execute it on another machine.I ll try this one:

java -classpath .;abc.jar;mail.jar;activation.jar;Mailer

pause

I put this in a text file & made batch file of it.

and run it but wont work.Do u hv any clue.

Here Mailer is the class file.

ashishpta at 2007-7-12 18:59:54 > top of Java-index,Java Essentials,Java Programming...
# 5

Hi

Your command is wrong. You should use space instead of semicolon(;).

It should be (assuming your Mailer class and all the other jar files are in current directory where you execute the following command):

java -classpath .;abc.jar;mail.jar;activation.jar Mailer

If you have a few jars files to use, use the following sample command:

java -classpath %jar_files% %package_name%.%class_name%

e.g. java -classpath .;xyz.jar;anyjar.jar com.whateverpackage.WhateverMain

redfragrancea at 2007-7-12 18:59:54 > top of Java-index,Java Essentials,Java Programming...