jar

Eclipse plugin that shows the META-INF of a jar library

Currently in eclipse when you open a library jar, it shows all the packages and classes, but if you want to see the META-INF content (e.g. manifest.mf), you have to open the file externally (e.g. using winrar) Is there a simple way buit-in in eclipse to do so, or a plugin that does this? ...

running java [-options] -jar jarfile (no explicit classname given)

Please correct me if I am wrong. When running java [-options] -jar jarfile with no explicit class name, if a single class exists within the jar that contains a public static void main(String[] args) method, that method will be invoked automatically. Right? What happens if I have several classes that contain an eligible main method? ...

building java project using ANT utility

I am using an ANT script to build the jars of the projects that I have in my eclipse workspace. The command that I use is ant -f <build_file.xml> I want to build the projects using the ant script only (at the moment I am using eclipse for the this). Can anyone help me out? ...

Unable to change the jFrame icon / load a resource for a .jar with Eclipse.

I'm trying to load an ImageIcon as described here, but I'm getting an error. Tried the method here too, but ran into the same error. It says: "Uncaught error fetching image: java.lang.NullPointerException..." I couldn't find a solution to this. I can load the image icon using this: setIconImage(new ImageIcon("etc/image.png").getImage(...

Eclipse Library Reference Out of Date in Project

I am using Eclipse Ganymede. I have a project open and call a static method of a class in another project, which the current one references. I close the current project, open the referenced library's project, change the method return type, and rebuild its jar. (It's set to build automatically, but I tried explicitly rebuilding all any...

Unexpected operator error

What is wrong in my code? #!/bin/sh LOOK_FOR="$1" for i in `find $2 -name "*jar"`; do echo "Looking in $i ..." #jar tvf $i | grep $LOOK_FOR > /dev/null jar tvf "$i" | grep "$LOOK_FOR" if [ $? == 0 ] ; then echo "==> Found \"$LOOK_FOR\" in $i" fi done #line 13 Output wk@wk-laptop:$ sh lookjar.sh org/apache/axis/mes...

security exception when loading web image in jar

I am trying to create a java jar Applet that will run in a browser, download an image from a URL, and display it to the user. My implementation is: try { String imageURL = "http://www.google.com/intl/en_ALL/images/logo.gif"; URL url = new URL(imageURL); img = ImageIO.read(url); } catch (IOException e) { System.out...

generate executable jar at runtime

I'd like to write a Java app which can create executable jars at runtime. The "hello world" of what I want to do is write a Java app X that when run, generates an executable jar Y that when run, prints hello world (or perhaps another string not known until after Y is run). How can I accomplish this? ...

How to combine library with my jar?

Ok so i wrote a program that makes use of a 3rd party open source library and i want to package it with my program in a single jar. I'm using netbeans 6.8 and everything I've tried java always spit back the error: java.lang.NoClassDefFoundError: libraryname; off topic:also i would like to know how to make an executable-jar(exe) throu...

Class-path in manifest not read when running jar in Unix

Hi, I have a client application that needs to run on Unix. It works fine in Windows but i get a NoClassDefFound exception in unix. Here's my manifest file: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: 2.3 (IBM Corporation) Main-Class: com.main.Client Class-Path: lib/commons-lang-2.3.jar lib/commons-io-1.3.2.jar lib/...

Accessing external library (jmf) within jar file

We used an external library, specifically jmf.jar (Java Media Framework), for our java application which relies on images captured from the webcam. However, when we tried to package the application into a jar file, the application runs but once we try to access/open the webcam nothing happens. We are using Eclipse and we used its export...

How does Java efficiently search jar files for classes?

Suppose I have 500 jar files linked to my program totaling over 500 MB (size of all the jars, not each one) and my program makes a call to a class located in one of them. How does Java search through jars for a class, and what is the efficiency of this? O(n)? O(log(n))? ...

device not found

I downloaded and installed a fat-jar eclipse plug-in to be able to package my project containing an external library(JMF). But when I run the application, it says "No device found". Does this mean that jmf.jar wasn't included in the new jar file since it can't detect the webcam? Because when I'm running the application in eclipse, there ...

Control the classpath ordering of jars in WEB-INF/lib on Tomcat 5?

I have a legacy web app running in Tomcat 5.0. This web app has two jars in WEB-INF/lib, let's say Foo-2.0.jar and Bar-2.0.jar. Bar-2.0.jar actually includes a Foo-1.0.jar inside of it. Bar is also a dead project, meaning no upgrading, no source, but still important to the application. The latest release of this application requires Fo...

Selecting main class in a runnable jar at runtime

I have two main classes in the app. When I package it to a runnable jar (using Eclipse export function) I have to select a default main class. Is there a way to access the non-default main class from the jar at runtime? ...

Comment lines in manifest of a jar

Is there a way to insert a comment line in the manifest of a jar file? ...

How can I package an extensible default Spring configuration in my framework?

It is the second time that I stumble across that issue and I haven't found a good solution yet. My problem is that I want to package a framework like JAR with a default Spring context and give the user of my JAR package the possibility to use this configuration (or even an ApplicationContext implementation) to add his own bean definition...

How to export my QtJambi project to .JAR file within Eclipse?

Hi, i am using Eclipse and i have a QtJambi project which i would like to export in a .JAR file. I have tryed several times it never worked. It worked for me on a Swing project, but with a QtJambi project, I dont know how to do it. Here are the screenshots (maybe it can help you to understand my situation): Export wizard (page 1) ...

How to identify a missing method (Binary Compatibility) in a JAR without running it?

I want to verify binary compatibility between 2 JARs. Following the suggestions in this answer I used jboss tattletale but it can find only missing classes. How can I find if there are missing methods? Is it possible at all? E.g. "Depends - on" class Foo depends on Bar (like many other middle class workers) import org.overlyusedcla...

What happens when two Java frameworks need third one but each of the two need different version of third one?

In my Java project I'm using two different frameworks (let's say A.jar and B.jar) and both of them require one common framework (let's say Log4j.jar) but in two different versions. How it is treated by Java if framework A needs Log4J v1.1 and B needs Log4j v1.2? Will it cause some kind of conflict/error or will by somehow (how?) resolved...