cancel
Showing results for 
Search instead for 
Did you mean: 

Creating executable jar file

Former Member
0 Kudos

Hi all,

I had created a java project that calls RFC for getting data from Ztable(by creating proxy) which is having a main Class. How can I create an executable jar file of that project using the jar command of jdk.

Thanks

Fahad Hamsa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anil,

I tried that option and generated an executable jar file. But when i tried to execute the jar file it is showing coulnot find main class. But the main class is there in the manifest file of jar.

My requirement is to create an executable jar file accessing Ztable and schedule that jar file in window's Task scheduling.

So I just want to execute " RFC calling program" from DOS prompt

Thanks

Fahad Hamsa

Former Member
0 Kudos

hi Fahad,

You can create jar by using 'jar' command at command prompt, e.g. jar -cvf jarfile.jar files.

Jar files can be executed by using java -jar jarfile.jar.

If you are facing errors in manifest file, make sure it is in proper format and fully qualified package names.

A gudd note on all this is <a href="http://neptune.netcomp.monash.edu.au/JavaHelp/howto/jar.htm">here</a>

cheers

avadh

Former Member
0 Kudos

Probally you can't start the jar file directly from the Task scheduling but you can create a batch file with the command > java -jar jarfile.jar

Start this .bat file from the scheduler and it will work.

Former Member
0 Kudos

Hi,

I am unable to execute the jar file using the

java -jar Test.jar also.

It is showing some problems in package like

Exception in Thread main:java.lang.NoClass Definition Found Error:com/sap/aii/proxy/framework/core/AbstractProxy

I took the main class seperately and executed and it is working

Former Member
0 Kudos

Hi Fahad,

The problem is that you have to add the jar file that contains the AbstractProxy in your jar file (aii_proxy_rt.jar).

Then your project knows where to find this AbstractProxy class.

So in your manifest file you have to have something like this:

Class-Path: lib/aii_proxy_rt.jar

Maybe you'll get a different exception then, containing a other jar file that is missing, just put that jar files also.

Former Member
0 Kudos

Yes, that was the problem. I didnt gave the class path specifying the jars in the manifest file.

Thanks

I am rewarding u point

Former Member
0 Kudos

can you get me this jar file "aii_proxyrt.jar"

Answers (1)

Answers (1)

Former Member
0 Kudos

Refer to the sun site

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html

Using IDE, you can use "Export option to create a Jar file"

Go to File->Export->Jar

Regards, Anilkumar