jar

Maven assembly Plugin with Maven Jar Plugin

Hi, I'm trying to use the maven assembly plugin for the first time. Essentially, I want to combine the output of the maven assembly plugin with that of the maven jar plugin into the target/classes directory so I can still run the app within Eclipse. I couldn't find a way to tell the maven jar plugin to collect the output of the maven ...

What is the significance of the POM file that Maven places in a JAR file, is it used by anything?

When Maven builds a JAR file, it places the module's POM file inside (seemingly in the directory <groupid>/<artifactid>). When I build a JAR file from Ant to be deployed via the Maven Ant tasks, is the presence of this POM file (the one inside the JAR) important? It doesn't seem to be, but I just wanted to be sure that it is not being ...

Default arguments in JAR-manifest

Is there a way to create a JAR-file that contains some arguments that are passed to the main class? (It does not matter whether it prepends or appends the arguments to potential command line arguments.) I know I could simply write a bootstrapping class and specify this as main class (calling the real main class with the arguments), but ...

loading from JAR files during deployment vs development

hi when i am loading some data into my java program, i usually use FileInputStream. however i deploy the program as a jar file and webstart, so i have to use getRessource() or getRessourceAsStream() to load the data directly from the jar file. now it is quite annoying to always switch this code between development and deployment? is t...

Problems with jar

I have a project in Eclipse, that inculdes some files with data(not in classpath), and I want to pack this project to the runnable jar-file, but the problem is, that after I pack it to the jar, it's not located there. How can i add it to the jar? ...

Modify a string in Java bytecode (jar)

I need to modify a connection string that's hard-coded into a Java application (jar without source). I presume it's possible to decompile the jar, then change the source and recompile to a new jar, but is there perhaps a quicker way to do this? EDIT: It's a standalone application, not a jar I'm loading from my own code I doubt it wi...

PHP, shell commands, and jar files

Hey everyone, I have a jar file that I would like to execute using PHP, but when I run the script all I get is the following error: Could not reserve enough space for object heap. I have done some searching and it seems as though I am getting this because the command isn't being executed in a login shell. If this is the case how do I ...

How to set icon to my jar using Visual studio

Hi I am using Visual Studio, I want to set icon to my jar file. But I donot know how to set icon file to my Jar file. So How can I set icon to my Jar file. Thanks Sunil Kumar Sahoo ...

Include jar file in Scala interpreter

Is it possible to include a jar file run running the Scala interpreter? My code is working when I compile from scalac: scalac script.scala -classpath *.jar But I would like to be able to include a jar file when running the interpreter. ...

Can I use the classpath to override a file in a jar that is being run?

I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using ClassLoader.getResource()), and has its dependencies completely satisfied using the configuration files baked into the JAR file. On occasion I want the application to be ...

creating a JAR file programmatically

I created a Jar file from my java code : public void create() throws IOException{ FileOutputStream stream = new FileOutputStream(this.packagePath); JarOutputStream out = new JarOutputStream(stream, new Manifest()); out.close(); //jarFile = new JarFile(new File(this.packagePath)); } I get a META-INF directory, with a MANIFEST....

how to reference an external jar in jsp app?

I am new to Eclipse. I am trying to run a jsp example using iText to generate a PDF, I put iText.jar file in Referense Library folder, but when I ran the jsp, I got error message that the class Document defined in the iText,jar can't not be resolved. ...

Jar file resource not available ?

My program has the following lines, works fine when run from Netbeans, JButton Button_1=new JButton(new ImageIcon(Phone_Dialer.class.getResource("Dir_Icons/"+"Key_1"+Botton_Color+".gif"))); But when I run it from the resulting Jar file, this line caused "java.lang.NullPointerException" error, why ? The dir is like this : C:\Phone_Di...

.JAR + Android?

I just purchased an Archos 5 and I'm wondering if it is possible to put a .JAR file on it and use it as an application. I read somewhere that it is possible but saw somewhere else that it wasn't. If it is possible, is there anything I have to do differently? Or do I just run it like I would on my computer? ...

include dependencies into jar

Hi, is there a way to force maven(2.0.9) to include all the dependencies into jar file? I have a project the builds into a single jar file. I want that the classes from dependencies will be copied as well. Update: I know that I cant just include a jar file into a jar file. I'm searching for a way to unpack the jars that are specified as ...

eclipse: how to debug a Java program as a .jar file?

I use ant for creating .jar files in Eclipse. Works great. I have a .jar file I am working on that expects the code to be in a .jar file (it looks for .properties files in the same directory as the .jar file) -- the standard Eclipse "Run" and "Debug" menus execute the main() method of a specified Java class... but they do it from the di...

Directory list of JAR file within classpath

The typically method to reference a file contained with a JAR file is to use ClassLoader.getResource. Is there a way to get the contents of a directory within a JAR files (similar to java.io.File.listFiles())? Note that the JAR file is within the classpath and its filename might not be known during runtime. Basically I have a bunch of n...

Refactor packages in a Jar

I have a requirement that i need to load two versions of a jar at once. To avoid class path collisions I'd like to rename the packages of one of the jars. Then in source you could always easily determine the version by the package name. I've played with javap but couldn't find an assembler for Java 1.6. I've also attempted to decompi...

Eclipse (Pulsar) packaging: How do I incorporate other projects into my jar?

I have a JavaME project in Eclipse (Pulsar 3.5; Galileo). I have another project with common code in it in the same workspace and this is referenced from my app. When I choose 'package app' it generates a jad/jar in the project's deployed folder, but the classes from the referenced project are not included. Is it possible to include t...

How to keep up to date on available Java libraries?

I've been writing java.io code verbosely for far too long, and stumbled onto Apache Commons IO last week. I've used a lot of Commons before, but never looked at IO, and now I feel silly for writing a notable amount of extra code over the years. Is there any good resource for Java libraries that isn't overwhelming, besides maybe reading...