Solved

Problem with the Classpath in Self Executable jar file

Posted on 2004-03-23
8
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

623 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