jar

Hide public classes in JAR

Hi all! Does anyone know the way to hide public classes in JAR file. In other words is there any way to create "jar-visible" classes. The point is to hide public classes in my JAR file and provide to my JAR-users access to specified classes. F.e. similar thing is implemented in OSGI framework with the help of "Export-Package" parameter i...

can I ship a 'lein uberjar' containing some gpl3 classes?

I have a project that I have released under the GPLv3 that requires clojure.jar and clojure-tontrib.jar to run. I would really like to ship one big jar file with all of them. (perhaps with a license.txt also) Does anyone know of a clear legal explanation* if this is in keeping with the licenses? can i specify this in my license.txt...

Version property on jars in Web Start

In a JNLP file, is the version property for a jar resource related to any metadata (e.g. manifest) or is it just arbitrarily set by the user creating the JNLP file? ...

Installing jar file to Tomcat web application

How do I install a 3rd party JAR file to my tomcat web application? I have placed it in every folder I can think of, and am referencing it like: import com.google.api.translate; Is there a particular folder? I have tried WEB_INF/lib ...

Delivering a single jar with a Maven project

I want to deliver a single .jar file to my clients, but my project is currently built with Maven, and I have several modules that generate a single .jar each. I know nesting different .jar files is not a great idea, so I am not sure how can I achieve this. Any ideas? ...

How should one distribute the Javadoc for a Library?

I am writing a custom library. It's build into a .jar archive. I am fully able to generate the javadoc, but I don't know how I should distribute it? Put it in the same .jar with the library Put it in a different .jar Some other way? And how to include the javadoc in another project that uses my lib? If I had put it in the same .jar...

How to extract a jar to a particular location?

Hi, I am using jar -xf <name of the jar> -C <location where jar is to be extracted> But i am getting issues with the syntax. Please let me know where i am wrong or site some example. Thanks. ...

extracting portion of jar to a path

Hi, I am using the follwing command and my intention is to extract only DYEDistinctAppServer.topology from discovery1-full-8.1.0-07-10-2010_1055.jar at data/product/template-topologies/DYEDistinctAppServer.topology path. Command: jar -xf discovery1-full-8.1.0-07-10-2010_1055.jar -C data/product/template-topologies/DYEDistinctAppServ...

Eclipse and How it Handles JARS -- Odd Case

Trying to make some small changes to Apache's Velocity engine. Here's what I can and can't do. I'm making a change to the merge function(). The change I'm making doesn't matter because I haven't made it yet. ;) Right now I am settling for a println statement firing. I have two references to merge(). If I change the function to mergeBA...

ant: handling jar whose contents have file permissions 000

I am trying to overwrite the default icon of installer JAR created by IzPack, with one from my application: <jar update="yes" jarfile="${pwd}/dist/${release}_installer.jar"> <zipfileset src="${pwd}/dist/app.jar" includes="com/izforge/izpack/panels/**"/> <zipfileset src="${pwd}/dist/app.jar" includes="com/xyz/img/logo.png" fu...

Does "Runtime.getRuntime().exec()" have a bad performance??

Hi there, I want to execute a jar from my own java application. (it's impossible to import that jar a library and start the app as an instance of my own "launcher"). To execute a jar from my own java app...I am using the next lines: String [] cmd = new String [] {"java","-jar","myjar.jar"}; Process process = Runtime.getRuntime().exec(c...

How do I know what version of servlet-api.jar I have?

Hello I downloaded a copy of servlet-api.jar from java2s.com. How do I know what version it is? There's no reference on the site. EDIT Ah. Apologies. I should have listed the content of the wordpad output when I double clicked on the MANIFEST.MF file in the jar I got: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By...

Android - Junit - Tested project uses external Jar

I have some java code (compiles nicely for Android) in a library project (LIB) that I want to use in an another Android project (A). As LIB's code is unlikely to change much, I opted for adding it as a jar to A. It works fine. I have another project that is an Android instrumentation project, testing the first Android project (B). So ...

Locating resources within a jar package

I have a static class and inside that class images are loaded into BufferedImage objects like so: File groundTopImageFile = new File("src/main/resources/ground - grass top.png"); Now when I create an executable jar out of this using Maven2 everything works, except it doesn't find the image files. I checked the jar, and the image files...

How to load DTDs from a jar file?

The intended machine doesn't have a connection to the internet and I do not want to load it using a fixed location. Aim: To load DTDs from a jar, the jar will be a dependency. ...

How to change default jar icon

First I have read all questions about this subject, so this is not a repeated question. What I want to ask about, how an application written in Java (such as eclipse) uses an icon instead of the default jar icons. I don't matter about compatibility, I always can make 2 different versions of my program to Windows and Linux. How to make...

Execution fails via java -jar while the same code runs fine through eclipse

I have been working on packing a project lately but it has turned into a nightmare. So here's the problem in a nutshell. I have a project that I'd like to have as a jar file, and eventually use it as Java Web Start. When I try to build and run the code through Eclipse, it works fine. However when I export it as a "runnable jar" and try...

How to run a maven-packaged clojure application from the jar

I have the following contents in src/main/clojure/za/co/pb/maven_test/test.clj file: (ns za.co.pb.maven-test.test (:gen-class)) (defn -main [] (println "Hello world!")) I also have a POM that has the necesary dependencies on clojure-maven-plugin with the compile execution. If I execute a mvn package command, I get a target/maven...

How to get a path to a resource/file out of a Java JAR file

Hi there, I'm trying to get the path to a file that it is located out of the java jar and I don't want to use an absolute path. An exampel: lets say that the jar is located in ~/lib/myjar.jar and the file is located in the same folder. What I've trying is something like this, but it fails: File myfile = new File(this.getClass().getRes...

How to view annotation of java classfile via command line?

Hi, Is there a command line tool, preferrably in the JDK, that either prints all annotations in a classfile or takes a specific annotation as argument to print? If so, is there an equivalent command that can be run on a jar file for a specific class contained within? I've googled this for a while and had no luck. :( Thanks, Jack ...