Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Creating runnable JAR file with external library
Creating runnable JAR file with external library [message #774498] Tue, 03 January 2012 22:10 Go to next message
Eclipse UserFriend
Hellow
I have some problem with creating runnable JAR file in Eclipse. I made a class which use JMF library and I added this library in Eclipse (Build Path -> Configure Build Path -> Libraries -> Add External JARs -> and I pointed out locations of the required libraries (JMF.jar). When I compile and run my application in Eclipse everything is working properly and my problems start when I want to make a JAR file.

I was searching in internet and couldn't find the solution of my probleme.

I create a JAR file following by this steps: Export -> Runnable JAR file. The JAR is created but when I double click on it to opent it there is nothing happens. I tried to run it of the console (java -jar MYJARFILE.jar) and I get the following message:
Exception in thread "main" java.util.NoSuchElementException
        at java.util.Vector.firstElement(Unknown Source)
        at VideoTransmisja.<init>(VideoTransmisja.java:62)
        at VideoTransmisja.main(VideoTransmisja.java:349)


It seams to be a problem with using JMF library.



Next I tried to create by: Export -> JAR file in two ways "generate the manifest file" and "use existing manifest from workspace" and the problem was the same :/

my manifest file:
Manifest-Version: 1.0
Class-Path: jmf.jar
Main-Class: VideoTransmisja


Could someone help me please? I was trying to solve this probleme whole day Sad

I don't know if I correclty create my manifest file and if I could add jar library to creating jar file?
Re: Creating runnable JAR file with external library [message #774532 is a reply to message #774498] Wed, 04 January 2012 00:18 Go to previous messageGo to next message
Eclipse UserFriend
From what you described, the manifest file is correct. From the exception, the problem is due to your program's code: it seems looking for an element which is not available in a vector. So check the source code again.
Re: Creating runnable JAR file with external library [message #774619 is a reply to message #774532] Wed, 04 January 2012 04:47 Go to previous messageGo to next message
Eclipse UserFriend
The source code is OK. I can compile and run it from Eclipse and it's working properly.

I have tried in NetBeans and problem is the same Sad

[Updated on: Wed, 04 January 2012 07:14] by Moderator

Re: Creating runnable JAR file with external library [message #775011 is a reply to message #774619] Thu, 05 January 2012 00:37 Go to previous messageGo to next message
Eclipse UserFriend
Is jmf.jar in the same directory of myjarfile.jar?
Re: Creating runnable JAR file with external library [message #775914 is a reply to message #775011] Fri, 06 January 2012 18:23 Go to previous messageGo to next message
Eclipse UserFriend
yes
Re: Creating runnable JAR file with external library [message #776374 is a reply to message #775914] Sun, 08 January 2012 02:35 Go to previous message
Eclipse UserFriend
>> The JAR is created but when I double click on it to opent it there is nothing happens.
Did you check that the *.jar file type is associated to Java (TM) Platform SE binary?
Previous Topic:Defining key shortcut for completion engine via extension point
Next Topic:Java Build Path - Libraries search
Goto Forum:
  


Current Time: Fri May 23 18:21:43 EDT 2025

Powered by FUDForum. Page generated in 0.03635 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top