简体   繁体   中英

Class-Path not getting write to MANIFEST.MF file on jar creation

I need to create a jar file I did the steps as follows:

C:\TIPL\GCST>javac -classpath lib/xbasej-20091203.jar Test.java

C:\TIPL\GCST>jar cfm MyJar.jar manifest.txt Test.class

My manifest.txt file as follows:

Main-Class: Test 
Class-Path: commons-logging-1.1.1.jar xbasej-20091203.jar

My Test.java as follows:

import org.xBaseJ.DBF; 

public class Test 
{ 
public static void main(String args[]){ 

try{ 

//Open dbf file 
DBF classDB=new DBF("Class.dbf"); 
System.out.println("here"); 
} 
catch(Exception e){ 
} 

} 
}

I am getting created the jar file , but when I extract it and inside my Manifet.MF file it looks like this:

Manifest-Version: 1.0
Created-By: 1.8.0_25 (Oracle Corporation)
Main-Class: Test 

It is not getting the class-path append to it. Due to this when I run my jar file I am getting errors? How can I solve this? What is the reason the classpath not getting append on MANIFEST.MF

In manifest text after putting your contents you must put an extra space into it. So Do an Enter after adding all contents in manifest.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM