Results 1 to 7 of 7
Thread: Jar File Manifest
- 03-09-2009, 05:44 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
Jar File Manifest
1) Am I supposed to create a manifest file before I compile a jar file or is it the other way around?
2) when I compile my Jar file using command prompt, there is compliation error but when I run it in netbeans it works. Please refer to attachment
3) How am I supposed to pass arguments in the JarRunner class?
The JarRunner Class (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
There is no prompt for user input.:mad:
public JarClassLoader(URL url) {
super(new URL[] { url });
this.url = url;
}
public static void main(String[] args) {
if (args.length < 1) {
usage();
}
URL url = null;
try {
url = new URL(args[0]);
} catch (MalformedURLException e) {
fatal("Invalid URL: " + args[0]);
}
// Create the class loader for the application jar file
JarClassLoader cl = new JarClassLoader(url);
- 03-09-2009, 06:13 AM #2
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
manifest file can be created right from txt file with right click -> Create -> newfile.txt ) just change txt to *.mf exten.
But your manifest should contain correct path to your main class so add it manually. some like a mainpackage.mainclass...
pack jar file and create web-inf package and place your manifest to it. then place web-inf right to your jar file )
I know it seems too manually but it is quite useful )))
- 03-09-2009, 06:34 AM #3
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
what is web-inf package? How do I place it "right to" my jar file? I even have problems opening it. If I extract it, I cant even edit the .MF extension.
- 03-09-2009, 10:58 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
When you build the application on NetBeans did you check the dist folder in the project folder?
- 03-10-2009, 03:23 AM #5
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
- 03-10-2009, 03:25 AM #6
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
It is a simple system folder )what is web-inf package?
- 03-11-2009, 04:08 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
how to read openproj(Projity) file i.e. ,POD file(Project Management file)
By mahendra.athneria in forum New To JavaReplies: 0Last Post: 02-11-2009, 09:53 AM -
To open an image file such as Jpeg file using JAva Program
By itmani2020 in forum Advanced JavaReplies: 10Last Post: 07-11-2008, 09:57 AM -
How to parse the CSV(Comma separation values)file and validate the file using java
By padmajap13 in forum Advanced JavaReplies: 7Last Post: 05-23-2008, 03:46 AM -
Manifest file in executable jars
By Java Tip in forum Java TipReplies: 0Last Post: 12-15-2007, 08:16 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks