Solved

Problem with the Classpath in Self Executable jar file

Posted on 2004-03-23
8
369 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 75 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now