jar

Teamcity ant build classpath - how to add additional jars

In Teamcity I'm kicking off an Ant Build. I want to add additional jars to the classpath, including ant-javamail.jar How do I specify these in the settings control panel? ...

Jar extraction and verification in BlackBerry

The application I am currently working on requires me to extract contents from and verify the authenticity of the signed jar that is stored on the SD Card. In Java [and Android], we have the java.util.jar and java.util.zip classes, that allow to extract jar. However, J2ME or BlackBerry® does not provide support for these packages. I have...

Code jumps out of a jar and runs? What is causing this?

I am trying to get a sample program working with JUNG, a graphing tool in Java. I downloaded and referenced all the .jar files in eclipse so my project hierarchy looks like this: In Test.java I have the following code: public class Test { static public void main() { System.out.print("Hello"); }} For some reason though when I tr...

include external jar when running java -jar

From my readings, when you execute a command as follows: java -jar foo.jar Then the main classpath is ignored and the classpath is taken from the manifest file. Further, the classpath declared on the command line is also ignored. So in: java -classpath /usr/local/jar/foobar.jar -jar foo.jar /usr/local/jar/foobar.jar is ignored. ...

After installing the spring-security-core grails plugin, how do you get IDEA to know about the jar files?

I have installed spring-security-core in a grails project, but for some reason, IDEA didn't automatically pick up the jar files. I can deploy the app and run tests using the grails command line just fine... but IDEA still puts squiggly lines. Is there a way I can get IDEA to automatically pick up jars after I install plugins? ...

Can not load the images in Java Swing when running from a .jar-file

I can run my Java Swing application from Eclipse without problems. But when I run it from a .jar-file, the images fails to load. I load my images with: setIconImage(Toolkit.getDefaultToolkit(). getImage(getClass().getResource("../images/logo.png"))); How can I load the images so they work even when I'm running from a .jar-file? The ...

Encrypt jar executable internally in java swing application

How to encrypt jar executable internally made in java swing application? [It must be executable without decrypting it.] ...

run .jar file with "java" command Centos

I'm trying to run a .jar file on my centos box, but it says "java: command not found". What's the best or easiest way to solve this? I was hoping for a yum command but not sure that that will exist for java? ...

running scala apps with java -jar

Yo dawgs, I got some problems with the java. Check it out. sebastian@sebastian-desktop:~/scaaaaaaaaala$ java -cp /home/sebastian/.m2/repository/org/scala-lang/scala-library/2.8.0.RC3/scala-library-2.8.0.RC3.jar:target/scaaaaaaaaala-1.0.jar scaaalaaa.App Hello World! That's cool, right, but how bout this: sebastian@sebastian-desktop:~...

Loading velocity template inside a jar file

I have a project where I want to load a velocity template to complete it with parameters. The whole application is packaged as a jar file. What I initially thought of doing was this: VelocityEngine ve = new VelocityEngine(); URL url = this.getClass().getResource("/templates/"); File file = new File(url.getFile()); ve = new V...

How to bundle a native library and a JNI library inside a JAR?

The library in question is Tokyo Cabinet. I want is to have the native library, JNI library, and all Java API classes in one JAR file to avoid redistribution headaches. There seems to be an attempt at this at GitHub, but It does not include the actual native library, only JNI library. It seems to be specific to Leiningen's native dep...

Open archive file content in OpenFileDiaolg C#

Hi All, I want an Open File Dialog with *.class ,*.jar filters. I want that *.jar files will be treated as folders (pressing OK or double-click should display the jar file content [ *.class] ). This capability is very similar to the TotalCommander archive plugin that let you browse inside archive files in-place (without the need to extr...

Does putting Java source files into a JAR increase the JVM's RAM consummed ?

If not, why not always include sources file into "open source" JAR distributions ? (thanks in advance if you have some official weblinks that explain your answers) ...

Filter for jar-file by analyse with findbugs

Hi, I have a jar-file, which I want analyze with findbugs through build.xml. I use "class location =....jar" - pattern. The jar-file contains several folders, but I need to analyze only one folder. How can I specify that ? Thanks in advance ! ...

A tool to determine jar dependencies based on existing code?

Is there a tool that can determine .jar dependencies given a directory of .jar files and a separate directory of java source code? I need to generate Eclipse .classpath files based on an existing code base that doesn't have any dependencies defined. To be more specific, I've been given a large codebase consisting of a dozen or so J2EE-s...

Updating .class file in a jar throws exception

I'm trying to port a wikimedia plugin to run on OpenVMS and needed to alter a class. I'm trying to update the .class file in the jar using jar uf jar-file .class-file, however when I do this I get the following: java.util.zip.ZipException: duplicate entry: META-INF/LICENSE.txt at java.util.zip.ZipOutputStream.putNextEntry(ZipOut...

How to load a library that depends on another library, all from a jar file

I would like to ship my application as a self-contained jar file. The jar file should contain all the class files, as well as two shared libraries. One of these shared libraries is written for the JNI and is essentially an indirection to the other one (which is 100% C). I have first tried running my jar file without the libraries, but h...

Java code to create a JAR file

What is the Java equivalent to this jar command: C:\>jar cvf myjar.jar directory I'd like to create this jar file programmatically as I can't be assured that the jar command will be on the system path where I could just run the external process. Edit: All I want is to archive (and compress) a directory. Doesn't have to follow any j...

Java Applet in JAR File

I have created a java applet (.class file) and made a .jar with it and digitally signed the .jar file. Now I need to run the .jar as an applet in firefox. What do I put in the html code to run the .jar file as an applet? I tried and it doesn't work, it tries to get a .class file, how do I load and run my applet as a .jar file using the...

How do I make a third party .jar available to my .jsp page?

I'm just starting to learn JSP (and I'm pretty new to Java in general), and I'd like to use JSON-lib with it. I want to make a page something like this: <%@ page import="net.sf.json.JSONObject"%> <% String json = new JSONObject().put("hello", "world").toString(); out.println(json); %> I downloaded json-lib-2.3-jdk15.jar and put it in ...