0

I am trying to convert my java application to an executable jar.

I have been able to package it into a jar with all my class files, but still am not able to include the jmf.jar file.

This is my directory structure,

Main dir

src/                  //A dir
--a.java
--b.java
jmf.jar
Manifest.txt

Content of my Manifest.txt file,

Manifest-Version: 1.0 
Ant-Version: Apache Ant 1.7.0  
Main-Class: src/a
Class-Path: .;jmf.jar //also tried ./jmf.jar

By double clicking the .jar file, I am able to run the main function, but the second function uses the jmf.jar throws exception when I tried running the jar file in debug mode, that javax.media not found. This class is in the jmf.jar file, which makes me conclude the jmf.jar file is not being included in the class path or so. So what am I doing wrong? How do I make this executable file?

The command I used to convert it to jar was,

jar cvfm myJar.jar Manifest.txt src\*.class jmf.jar
5
  • why did you delete your old question and ask the exact same one again? Commented Aug 14, 2013 at 20:06
  • @Recall I really need to solve this problem as soon as possible. I apologize for this, but I wasn't getting any answers there. Commented Aug 14, 2013 at 20:12
  • 1
    Everything looks fine here. Why don't you show us the manifest.mf file. Commented Aug 14, 2013 at 20:50
  • @jeez Well, you have enough reputation to start a bounty. You could have offered a bounty on the old question, or waited for the Community user to poke your question. Commented Aug 14, 2013 at 21:13
  • Your commands are in the wrong order. If you have cvfm, you must first specify the file name, then the path to the manifest, and then the directories to JAR up. Commented Aug 14, 2013 at 21:15

2 Answers 2

1

The jar files referred to by the Class-Path entry in the manifest must not be inside the jar, but outside of it, as explained in the jar tutorial.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, there's the answer, the space not added and classpath wasn't in .mf file.
0

If you are using JMF you’ll need to include jmf.jar and jmf.properties in the same directory as the executable jar

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.