jar

Create cross platform Java SWT Application

I have written a Java GUI using SWT. I package the application using an ANT script (fragment below). <jar destfile="./build/jars/swtgui.jar" filesetmanifest="mergewithoutmain"> <manifest> <attribute name="Main-Class" value="org.swtgui.MainGui" /> <attribute name="Class-Path" value="." /> </manifest> <fileset dir="./build/c...

Change root package of Java JAR

I am writing a Java Agent which makes use of the Java ASM library for handling byte code. This is a common library and I want to be sure about the version of ASM which my code is using at runtime. What is the easiest and most automated way to take the ASM classes and process them into a private copy where all the classes have been reloc...

So I dynamically load a jar at runtime how do I use it?

So question 194698 shows how to load a jar file at runtime and you can load individual named classes and get a Class object. Now my problem is I want to be able to cast those Classes to the types they really are, but I can't because I can't use an import since the whole point is to load it at runtime rather than compile time. It seems l...

Android - Invoke activity from within jar

Hi All, I have a jar that consists of a class that extends Activity and performs some activity on onCreate. I want to import this jar into my Android app and start the activity. How can I go about this? Thanks George ...

Hiding specific files in TextMate

I do a lot of JRuby on Rails apps, and we have a fair amount of Java .jar dependencies. These become quite annoying in textmate as it really muddies up my lib directory, and I never (obviously) need to actually open these files. Can someone tell me how I might hide .jar files from my file listing in Textmate?? ...

Which application server should i choose for my project ?

Hi folks, I am currently developing an application for some researchers in my university.It's a small java program that you can use by command line. The next step is to package that program and deploy it to an application server. Some clients program will submit requests to the server who will call the tool that I wrote. Lately, we will ...

Is there a way with Apache Ant to update a jar file after it's been built?

Is there a way to update a jar file in Ant? EDIT: For example, if I wanted to add some additional files to an already existing JAR file? ...

Android SDK - Other ways?

If I needed to build an android SDK that other developers can integrate into their android apps, is jarring my SDK the only way to go about it? As far as I have learnt, jarring has the following considerations: If your app uses a layout, then you have to create it programmatically. Since jar files cant carry any resources. The jar wil...

Java Lib file errors

I am a brand new Java developer (I have been working in asp.net) and I inherited a project I am trying to get running correctly. I am on Windows 7 and have Tomcat installed and I am using Eclipse I'm trying to figure out how the heck Jar's work in java and I am really confused at the moment. I have been playing around with it and lookin...

How can I add a .jar to my build path in Eclipse?

I try to do it the following way: Right click on the name of the project. Click on Build Path in the drop dawn menu. Click on "Configure Build Path" And then I do not know what to do. Should I select "Source", "Projects", "Libraries", "Order and Export"? In "Libraries" I have "Add JARs..." and "Add External JARs...". What should I s...

How can I create a self-consistent .jar file with Eclipse?

I wrote my Java application in Eclipse. Now I would like to generate a .jar file which can be run on other systems from the command line. Is there a easy way to do it in Eclipse? In particular I am wondering what should I do with the jar files of external library that I use (should it be included into my .jar file?). Moreover, should I...

Different ways of Creating jar files?

Cany one please give me what are the different ways of creating the jar files. Through programmatically we can create using java.util.jar Other than these method, please share your knowledge ...

How do I access a JPG embedded in my JAR file via a URL object? What would be the address?

I've bundled a JPG inside of my application's JAR file. I need to access it, preferably via a URL object from the code in the same JAR. But I've no idea how to construct the address. I'm guessing it would be a "file:///" but what comes after that? ...

Read / Write XML file from Java application bundle

Hi there! I've got an XML file that is parsed and written in my application. From within my IDE (Eclipse) I simply address it like this: Reading: private String xmlFile = "file.xml"; and then I build the document: doc = sax.build(xmlFile); Writing is done like this: writer = new FileWriter("file.xml"); Runs great so far, but a...

Include a different jar for x32 and x64 bit operating systems

Hello Is there a way in Java to determine if the software is run on an x32 or x64 operating system - and in function of that - include a different jar during runtime? I am using qtjambi and they wrap the QT c and c++ libraties in an xxx_x32.jar and xxx_x64.jar Thanks for your feedback Marc ...

How do I exclude a properties file when deploy

I want to include this file when running locally, but exclude it when deploy. I tried the following the doesn't seem to work. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> ...

Executable console java app to service on Mac

Hi, I have a jar file an console app, I need to make it a service on mac osx which should run perioducally, how can I do that? Thanks, Manoj ...

JAR file: digital signature

If a JAR file is digitally signed, does the signature become part of the manifest file? ...

Adding images to a JAR file in Eclipse?

I'm trying to make a game in java, but I'm a bit of a newb. The game has images, and when I run the application from eclipse, they all show up fine. But when I export the project as an application, the images don't show up. When I put the application in the same folder as the images, they show up when I run the application, so someone s...

Why does the Maven goal "package" include the resources in the jar, but the goal "jar:jar" doesnt?

Hi, when I package my project with the Maven goal "package", the resources are included as well. They are originally located in the directory "src/main/resources". Because I want to create an executable jar and add the classpath to the manifest, I'm using maven-jar-plugin. I've configured it as the following likes: <plugin> <group...