jar

Modifying a file inside a jar

I would like to modify a file inside my jar. Is it possible to do this without extracting and re jarring, from within my application? File i want to modify are configuration files, mostly xml based. The reason i am interested in not un jarring is that the application is wrapped with launch4j if i unjar it i can't create the .exe file a...

Simple Apache Ant Question: Including library dependencies.

Hey guys, I can't quite figure out how to add all of my .jar dependencies to my client jar. This is what I have so far: <target name="create-metrics-client" depends="clean,build"> <jar destfile="sd-metrics-client.jar" basedir="${build.home}"> <manifest> <attribute name="Main-Class" value="com.mycompany.client.M...

How to automatically create jar in JBuilder

Have a project developed in JBuilder 2007. I can create a jar with the compiled classes and resources by right-clicking on the project in Package Explorer and selecting Export, but is there a way to set-up the project to automatically generate the jar file, whenever the source changes ? ...

Apache Ant JAR Task: not finding properties.

Hey guys, How exactly should I specify the location of all the properties files inside the ant manifest? My jar is not working because it can't find the log4j, Spring, etc properties. These files are all contained within a folder called "server-config" that sits at the same level as the source code, ie: META-INF com server-config ...

How to run a JAR file

I created a JAR file like this: jar cf Predit.jar *.* I ran this JAR file by doubling clicking (it does not work). So I ran it from the DOS prompt like this: java -jar Predit.jar It raised "Fail to load main class" exceptions. So I extracted this JAR file: jar -xf Predit.jar and I ran the class file: java Predit It worked wel...

Serve a jar file from within a war file (as a resource)

I have a web app: MyApp.war, inside it, I have a jar file: WEB-INF/lib/PublicJar.jar I want client applications to be able to download that jar like a web resource. e.g http://theserver.com/myapp/jars/PublicJar.jar I want the web application to be able to compute the hashcode of the jar file to see if it has changed, so clients know i...

Where is the log4j javadoc jar hiding?

It's not in apache-log4j-1.2.15.tar.gz available from the Apache website and the mirrors, and Google returns nothing. Apache Commons Lang had a javadoc jar within the tar.gz file for the release, but no luck finding the same inside the log4j tarball unfortunately. ...

Accessing .exe file within .jar

Hi everyone! I recently created an application and successfully jarred this to c:/my/folder/app.jar. It works like a charm in the following case [Startup #1]: Open cmd cd to c:/my/folder java -jar app.jar But when I do this, it doesn't work [Startup #2]: Open cmd cd to c:/my/ java -jar folder/app.jar Because app.jar contains a ....

Jar within War - NoClassDefFound Exception

Hi All, I have deployed 2 apps as app1.war and app2.war on jboss. These two apps use a common java package, say, myPackage. Earlier my wars looked like this ======================================================================== app[12].war/ -----web.xml -----app specific classes (.class files like) -----appClass1.class -----appCl...

Can I call class files that are within a jar library located in another jar file?

I am trying to access the class files packaged as a library but unfortunately the jar libraries should be packaged in another jar file. As an example say I have a.jar that contains some class libraries. I can call (import) the classes in the jar file from my external java application. Now I need to put this a.jar inside another jar say...

Launch Runnable Jar from Web Start

This is my first time trying to use Web Start, and I am trying to launch my runnable jar. I get the following error from my webpage as I click the link to launch the jar. Can anyone help me out? The Notepad example from the tutorial works fine from another link on the test page (JNLP and jar in same folder as I have too). The jar and jnl...

Why do my aspects get executed in their original setting and not when packed as a separate jar and called from elsewhere?

Hi all, I am a newbie to aspectj... I have written the following aspect which is intended to add logging to function calls of type public * doSomething*(..). If my main class is part of the same project the weaving of the aspect is performed without a glitch and the code executes. If I pack up the weaved code into a jar and call it fr...

Multiple entry point (mainclass) for application client jar

How do I set up multiple entry points in an application client jar? I am using Glassfish application server. I can grab the client using asadmin get-client-stubs --appname APPLICATION_NAME . I currently can run the default mainclass that I have specified in the MANIFEST.MF. However, I want to be able to specify another mainclass a...

Sign a jar file exported from Eclipse 3.5?

Is it possible to sign a jar file as you export it from Eclipse 3.5? Or a plugin to allow this to happen? I can easily export a runnable jar, and sign it myself using jarsigner, but manually doing this every change is not efficient. ...

Ant: Exclude files from merged jar file

Hi there. For a java project I'd like to merge all third-party jars it depends on into the main jar created by Apache Ant, which I already managed to do. The problem is that some of these jar-files have signature-files in their META-INF-directories, so when I try to run my jar-file, I get the error message "Invalid signature file dige...

Include Third Party Jars ANT

I am new to using ANT and am trying to include third party jars in the build using Eclipse 3.5. I keep getting "cannot find symbol" errors in the compilation, so obviously it is not taking these two jars into consideration. If anyone can show me where I am going wrong, or suggest another route, I would appreciate it. Thanks. JarPath bel...

buildr: package dependencies into a single jar

I have a java project that is built with buildr and that has some external dependencies: repositories.remote << "http://www.ibiblio.org/maven2" repositories.remote << "http://packages.example/" define "myproject" do compile.options.target = '1.5' project.version = "1.0.0" compile.with 'dependency:dependency-xy:jar:1.2.3' compil...

How to use JarOutputStream to create a JAR file?

How does one create a JAR file programmatically using java.util.jar.JarOutputStream? The JAR file produced by my program looks correct (it extracts fine) but when I try loading a library from it Java complains that it cannot find files which are clearly stored inside it. If I extract the JAR file and use Sun's jar command-line tool to re...

Netbeans: How do I let additional files be included into the created JAR?

Hello! Netbeans doesn't allow me to specify, which files I want to have additionally included inside the JAR. Can I work this around by editing the manifest.mf? Or by editing build.xml? What else could be done? EDIT I need the files to appear in jar's root (files such as LICENSE.txt or some exec script), because otherwise they would...

Hudson continuous integration server: how to see Windows mapped directories that are visible to Ant?

Using Hudson, Ant 1.7, Tomcat 6.20, JDK 1.6 and JDK 1.5; all on Windows boxes. My Ant build script for a WAR file uses JARs stored on a remote server. The directory path to the remote server is mapped as a network drive in Windows. A build.properties file is used to specify the paths to the JAR dependencies. When building with Ant, e...