jar

Setting Grizzly's keystore to use a jks in a jar

I'm trying to use com.sun.grizzly.SSLConfig.setKeyStoreFile() to set SSL for Grizzly. It only takes a String as input (not InputStream or File). I want to use a jks file that is within a JAR file. If I pass a string for a jar path (eg C:\dir\my.jar!\resources\my.jks), it fails. Other than just unzipping the file from the JAR, how can...

Opening a JAR resource as a FileStream

I have a project where I want to access a resource in a JAR from another project. It's not on my classpath, so ClassLoader is not an option. I tried: new FileInputStream("C:\\mydir\\my.jar!\\myresource.txt"); and received a FileNotFoundException. JarInputStream might be a possibility, but I want the flexibility of the input file...

Safe class imports from JAR Files

Consider a scenario that a java program imports the classes from jar files. If the same class resides in two or more jar files there could be a problem. In such scenarios what is the class that imported by the program? Is it the class with the older timestamp?? What are the practices we can follow to avoid such complications. ...

extracting jar files

how do we extract jar files in ubuntu???? ...

How can I use different JARs for compiling and testing in maven?

I compile my programm against javaee-api. But for Junit testing I must use a specific implementation like glassfish's javaee.jar to avoid errors like java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/Persistence (see also 1). So avoid using methods, that are only a...

Where should I put an external JAR file in my Eclipse project?

I've created a new project in Eclipse and I want to include the ANTLR jar file. Where do you typically place your jar files before referencing them in your project? Do you create a "Source Directory" in eclipse, or a normal "Directory"? Do you then reference them from there? I want to be able to easily transport this project around a...

Running jar, setting classpath

Hi guys, I've got a project I've made with Maven. I compile a JAR, with "mvn package", and now I want to run it, preferably without setting some insane classpath, as it depends on Spring and half the internet or something. Is there any way I can run it easily? Something like "mvn run" would be great, or an option to throw in all depende...

Using multiple .jar with javac

Hi all, pardon my terminology. I'm trying to use three jar files with a java program for my CS class. The first is funjava, a simplified java language, and the others are class definitions color and geometry. Here is my code and what happens when I try to run it. import colors.*; class Canvas{ public static void main(String [] args){...

Bundling different java classes in a single jar files in a single jar

basically what I have is an application server running liferay portal. and we also have custom portlets that have shared custom libraries as well as third party ones. for instance dwr-3.0, several drools jar files, spring-webmvc, spring, etc. the problem is that is a nightmare for server administration, because when there is a deploy so...

Java Webstart intermittant JAR not updating

We use java Webstart to deploy a java application on our intranet. The application receives frequent updates. Once in awhile a user will launch the application from their desktop icon after we have updated the JARs / WAR on the webserver (timestamp changed) and Java Webstart will launch the old version instead of downloading a new one. ...

cannot run java app on mac properly

Hello everybody.. I have small problem..I created a java App in windows and my .jar consist of whole app..i copied this jar file to mac and executed it from there it works fine.. Java App consists of bonjour code if i execute .jar on windows it works fine and bonjour starts advertising...But,for mac the app runs fine but doesnot adverti...

How to test the code signing of a JAR file on a client machine?

We have signed a JAR file using a certificate generated by MS Active Directory Certificate Services. However, when accessing it via Java Web Start we are getting the prompt that the digital signature cannot be verified even though we've installed the root CA into the certificate store on the client machine. Now trying to look at the ro...

How to use Embedded tomcat with wars that have jars inside of them?

Hi, I had the same problem as this and solved it by using the code given by Antonio. My problem is that the war file has multiple jars inside of them, and these jars are dependencies, without which, the web application does not run. Is there anyway to tweak the ClassLoader or another method to make the embedded tomcat also load the ja...

ant jar's mainclass

how do i set the Main-Class attribute of my jar in ant? ...

Accessing a resource within a jar (working in Netbeans but not on command line)

I have a jar file with bundled resources (language model binary files) that need loading at run time. The directory structure within the jar is tagger/app.class tagger/models/stop/SentDetect.bin.gz where SentDetect.bin.gz is a binary whos path is loaded into a thirdparty class (SentDetector) as a String parameter, i.e. URL url = this...

Why is jar ignoring my manifest?

I tried to create an executable jar using this command: jar -cvfm h.jar Manifest.mf Whatever1.class Whatever2.class The manifest contains this: Main-Class: Whatever1 But if I try to run the jar, I get: Failed to load Main-Class manifest attribute from my.jar. I extracted the jar, and I saw that the contents of it's manifest were th...

Package Jython app as JAR in Netbeans

We are currently considering using Netbeans to develop a Jython application and I am in the process of evaluating Netbeans' features. It appears that creating a Jython application is trivial in Netbeans once the Python and Jython modules are installed. Yet I couldn't find a feature which would let we wrap my Jython app as a JAR file wit...

What can I leave out when creating an executable JRuby jar ?

I've attached an image of what JRuby.jar contains: http://www.freeimagehosting.net/uploads/fbfd966375.png The problem is that even for simple scripts, the resulting jars have about 8mb. Can you tell me which folders I could remove from there, and still have it running ... or what's the purpose of some of that folders? ...

How do I load and display a remote jar applet in my applet?

I would like to load remote applets into my own applet. For example, lets say I want my applet to download and display a game from this site within my java applet: http://www.java4k.com/index.php?action=home How do I do that? ...

if i know a class, how can i know which jar it is from?

for now i could use clazz.getClassLoader().getResource(class.getName()), then i substring the URL to get the jar file's location, but i really want to know if there is any better way to do it. is there any API for this? thank you. ...