|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

04-02-2008, 10:34 AM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
I followed all the steps described to create a jar file containing external jar files.
While creating the jar file manually I copied the external jars into a folder lib and use that in Class-Path attribute..
The manifest file that I created is exactly same as that generated by NetBeans. In both the problem is same.. The jar file is executing only in the current location.
|
|

04-02-2008, 10:47 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
It should work pal. I've followed the same way in large number of times. At leas that dist folder content should work, even in another location, after extracting the jar file into the dist folder.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-02-2008, 11:24 AM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
Yes.There is lib folder containing all the external jars for my application.
The manifest file I created manually and the one generated by the NetBeans are same.I copied the jar files into a folder lib and used that path as Class-Path attribute value.
Both jar files-that I created and Netbeans created -have the same problem..They can execute only in the location where they are created.
|
|

04-02-2008, 11:52 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Originally Posted by gowry
Both jar files-that I created and Netbeans created -have the same problem..They can execute only in the location where they are created.
Sorry if I asking the same thin and dump you. In the different location did you try it by extracting the jar which is in the dist folder. Not the jar file create. 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-02-2008, 12:10 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
Yes.. extracted the jar in the dist folder in another location and execute.thats giving an exception like class in the external jar file not found..
In the manifest file everything is fine.its having the main class name and class path..
If I copied the dist folder and execute the jar.its working.. I think its because the lib folder is within it and so.
|
|

04-02-2008, 12:20 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
No I think still you are not doing what I say.
Now you have a dist folder, which contain a jar file and the folder called 'lib' and README.txt file. Now copy that dist folder to separate location. Say D:\Temp\
Still that dist folder contain lib folder, text file and jar file.
In that point, execution of the jar file is not work.
Then extract the jar file to same folder, I mean to dist folder. Now you have followings in the dist folder.
1. lib folder
2. README.txt file
3. jar file which has the name of your project
4. META-INF folder
5. Another folder which has the same name as your project.
Is that right?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-02-2008, 01:05 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
Originally Posted by Eranga
No I think still you are not doing what I say.
Now you have a dist folder, which contain a jar file and the folder called 'lib' and README.txt file. Now copy that dist folder to separate location. Say D:\Temp\?
Still that dist folder contain lib folder, text file and jar file.
In that point, execution of the jar file is not work.
Copied dist to D:\temp and execute it there using
java -jar jarfile.
Its working..
The exception occures when am
move the jarFile from dist to D:\temp and try to execute the jar file at D:\temp.
Originally Posted by Eranga
Then extract the jar file to same folder, I mean to dist folder. Now you have followings in the dist folder.
1. lib folder
2. README.txt file
3. jar file which has the name of your project
4. META-INF folder
5. Another folder which has the same name as your project.
Is that right?
yes.
|
|

04-02-2008, 01:09 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Originally Posted by gowry
The exception occures when am
move the jarFile from dist to D:\temp and try to execute the jar file at D:\temp.
Just only jar file moving to another location it's not work. It simply destroyed the folder structure of the package. Moving whole dist folder and do stuff is the way to do.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-02-2008, 01:19 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
Ohhhhhh NO..
That means I was wasting ur time for the last two days ..
Sorry.. 
|
|

04-02-2008, 01:23 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Don't worry. In most the things we have learn after doing the wrong things in thousand times. I like to let others what I know 
Now what happened. Is it ok.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-02-2008, 01:35 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
Yes. its working within the dist folder.
Thank You...
|
|

04-02-2008, 01:38 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
You are welcome.
If you feel that your problem is solved, please mark this thread solved from the Thread Tools of the menu. If not, it's ok. Just leave this as it is.
Still you have some issues relating to this topic, post here, please don't start a new thread.
Eranga 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-04-2008, 10:09 PM
|
|
Member
|
|
Join Date: Feb 2008
Posts: 45
|
|
|
Just to add to it:
If you require to add external jar files to your executable jar, in your Manifest file, then you need to provide the relative path to your external jars in your Manifest file.
|
|

04-07-2008, 12:00 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
Yes.I specified the relative path of jars in Manifest file as Class-Path attribute.yes its working.but I should carry that jar files folder with my application wherever I want to execute my application.Is there any solution to execute jar file independently?
|
|

04-07-2008, 12:06 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
So, you need to create a single jar file, isn't it?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-07-2008, 02:57 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
Yes..I want to load my application using only that jar file.
|
|

04-07-2008, 03:03 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
I think you try it early. Create a single jar file including libraries you used.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

04-07-2008, 03:19 PM
|
 |
Member
|
|
Join Date: Apr 2008
Location: India
Posts: 27
|
|
|
yes.I create jar file by giving the external jar file path as Class-Path values in manifest file,.My problem occures from that time.. I cant execute the jar file in any other location without copying the external jar am using..
|
|

04-07-2008, 03:54 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Yes it's true. You have to include all the jar files into single file, as a example,
jar cfm jar-file-name manifest_file input-file(s)/folder(s)
in manifest file you have to refer all folders you use.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post coun | | |