0

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

androidGenX
  • 1,108
  • 3
  • 18
  • 44
  • There can be many ways to do this 1) using relative paths http://stackoverflow.com/questions/219585/setting-multiple-jars-in-java-classpath 2) Packing all the dependent jars as part of a single executable jar: http://stackoverflow.com/questions/16422892/combine-or-merge-all-jars-in-one-executable-jar – Anupam Saini Oct 18 '14 at 09:47

1 Answers1

0

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

androidGenX
  • 1,108
  • 3
  • 18
  • 44