Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with the Classpath in Self Executable jar file

Posted on 2004-03-23
8
Medium Priority
?
388 Views
Last Modified: 2013-11-23
Hi All,
I am facing a problem in my application.
I wanted to create a stand alone application that needs the weblogic.jar in its class path to run
I had created a self executable jar file for this.  
weblogic.jar file is usually located at C:/bea/weblogic81/server/lib/ folder
I created a manifest file as follows

Manifest-Version: 1.0
Main-Class: com.Starter
Class-Path: file:///C:/bea/weblogic81/server/lib/weblogic.jar


and i use the following command to jar it

jar cfm myapplication.jar manifest.mf com/

Manifest file in the jar file is as follows
Manifest-Version: 1.0
Created-By: 1.4.1_02-er (Sun Microsystems Inc.)
Main-Class: com.Starter

and the application fails to work ,
can u please help me in this regard ?
Thanks in advance  :-)
0
Comment
Question by:ajithprabhakar
  • 3
  • 2
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10665346
> Class-Path: file:///C:/bea/weblogic81/server/lib/weblogic.jar

this need to include the relative location of jar.
eg. if weblogic.jar is in same directory:

Class-Path: weblogic.jar
0
 

Author Comment

by:ajithprabhakar
ID: 10665604
Then in which way i can set a class path,  Can u please explain how can i set the class path for a stand alone self executable jar file?
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 10665705
Hi ajithprabhakar,

Try to run your application using the following command line:
  java -classpath C:\bea\weblogic81\server\lib\weblogic.jar   -jar myapplication.jar

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Expert Comment

by:objects
ID: 10665755
> Then in which way i can set a class path

you need to use the Class-Path as you are, you just need to supply the *relative* location of the jar.
0
 

Author Comment

by:ajithprabhakar
ID: 10665850
hi there,
i am aware that i can use both the ways, but what i want to do is to set a path to a jar file which is not in the same directory , that means i want to give absolute path in my self executable jar file.
But for the relative location the jar to which my class path points should be a part of the new archive that i am creating right ?

0
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 10665896
> that means i want to give absolute path in my self executable jar file.

you can't.
You'll need to install any required jars as extensions (in the 'ext' directory) if you do not specifiy them using Class-Path:
Or don't use a executable jar of course.

> But for the relative location the jar to which my class path points should be a part of the new archive that i am creating right ?

Not sure what you mean by 'creating'?
It should be pointing to the location of any other jars/directories that are required by the executable jar.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question