include « jar « Java I/O Q&A

1. Is it bad practice to include properties/configuaration files within jars?

For example: MyApp is a web app that contains a properties file ( that describes config data (e.g. server names) for the app. In the development phase, is located in ...

2. How to include file in Jar through Ant at specific location

I've got an ant jar task:

<target name="jar">
    <jar destfile="${generated.jars.dir}/hello-${environment}.jar">
     <fileset dir="${generated.classes.dir}"/>
     <fileset dir="${environment.dir}/${environment}" includes="config.xml"/>
How can I ...

3. How do you include .jar files in a Java library?

How do you include .jar files in a Java library so that it can be imported directly in a program?

4. How do I include java stuff in .jar files?

Okay. So here's my question: I am making a data parser in Clojure. One part of my program is that it has to be able to graph the data. I figure, ...

5. Permissions error for a signed Java applet when including external JAR files

I have a signed Java applet. And it works fine. But now I have to integrate some 3rd party JAR files with it. When I test it from Eclipse, the whole ...

6. Problems including jar files outside the jar file containing the manifest

Basically let me first explain what I am aiming to do. I have a dynamic ETL transformer app written in JAVA. Due to the dynamic nature of this app I have ...

7. Including .properties files with .class in JAR after an mvn install

Imagine I have a project I want to build using maven. My project doesn't, unfortunately, respect the maven default layout. So I'm having two source folders A & B containing .properties ...

8. Intellij include src files in jar file

I remember a while back with eclipse or netbeans I was able to easily include my source files in my jar file. I have moved to intellij 10 community edition and ...

9. How to include all the jars present at a particular directory in the CLASSPATH in one go?

I have around hundreds of jars at a particular directory which my application uses. So I thought its hard to add each jars one by one to the classpath. So is ...

10. Including external Jar when running jar file

I am writing an ant file that will compile and run my java files. The ant creates the AntLabRun.jar file. When I try to run the jar file, I get the ...

11. Making a JAR file which includes all files of a cetain type from any subdirectory

So this is a simplified version of my package structure

 Project 1


12. How to include library files while creating jar files

How to include JOGL.jar and Gluegen-rt.jar in the java project? I have included these external jars in the eclipse, but when I try to create a Jar file of the project, ...

13. Including jar files in class path

I m running a java program from a batch file which refences some external jar files .How do i include those jar files in my batch file.Please help

14. include policy file in jar?

i have a rmi client in a JAR file, but it need a policy file to run properly. is it possible to put the policy file also in the jar file, so i can distribute my client in a single jar file. if so, please show me how to do it? thanks X HOU

16. How to include my own package in jar file

I have program that uses a class file in a specific package named MyPackage which works except when I bundled in a JAR file the job that requires the clas s file in MyPackage doesnt work. I tried including the folder MyPackage into the JAR file like this: Jar cfm Program.jar *.class MyPackage Where the contains only the Main-Class ...

17. including jar files in jar files

I want to deploy a jar file. I have included two other jar files in it because they contain code that's needed by my class files. This doesn't seem to work unless I deploy those two jar files separately and stick them in the same directory as my jar file. Is there a way for the jar file to look at ...

18. Including a jar file in your classpath

SET CLASSPATH=C:\ADIRECTORY\ajarfile.jar;%CLASSPATH% You would probably need to do that in your C:\AUTOEXEC.BAT file and then reboot the machine. The %CLASSPATH% tells the system to put the "old" or "previous" value of the CLASSPATH at the end of the new CLASSPATH. If there was no previous CLASSPATH you can use SET CLASSPATH=C:\ADIRECTORY\ajarfile.jar;. Note the semicolon and period at the end! -Barry

19. Include other jar files in project

Hi! I think this is a rather simple question but I can get it right. I need to include antoher jar file in my projects so that when a user downloads my jar no classpath needs to be set. There are altso properties files that a user needs to edit but they must reside outside the jars. // Mathias

21. How to include third party jar files with in manifest file.

I have a requirement, where by I need to create a executable jar file. The application uses third party jar files like log4j.jar etc. One way, I was able to do is extract the class files from third party files and include those classes under the execuatable jar. But that means I need to extract lot of 3rd party jar files. ...

22. Including property file in the jar

Original Code : import; import java.util.Properties; public class PropertyFileAccess { Properties prop; public PropertyFileAccess() { prop = new Properties(); } public String getPropertyValue() { String stpropvalue = ""; try { prop.load(new FileInputStream("C:/")); System.out.println("\n"); System.out.println(" = "+propname); stpropvalue = prop.getProperty(MAX+""); System.out.println("prop.value = "+stpropvalue); return stpropvalue; } catch(Exception e) { System.out.println("PropertyFileAccess : getPropertyValue : Exception : "+e); return stpropvalue = "NULLVALUE"; } ...

23. Problem including external jar to build.xml file Ant

Dear Friends, I am not getting how to add external libraries to build file used by Ant. I want to use classes12.jar and ojdbc14.jar in my java code. But i dont know how to incldue them in the existing build.xml. Here is an excerpt of my build file :

24. build jar file that includes needed classes automatically

A few years ago I could have sworn that I read about a jar creation tool that would automatically discover what class files would be needed for a application and build a jar file with just those class files. I believe that you provided it with the name of the class or classes that had entry points (main methods) and it ...

26. How can i include .so files in an executable .jar?

Hi, I need to some native libraries to run my app. I want to put this .so files into a jar file. With a shellscript i can set the java classpath, but i need to have only the jar file. If anybody know what do i do to java search the files into a directory specified by me (a directory compressed ...

27. library not included in the jar file when exported

I'm using the eclipse platform and trying to export my program into a jar file. However a library I'm using pdfbox is not getting included. I am able to run the file program just fine when I'm in the Eclipse. But when I run the jar file I'm getting class not found. Help? Thanks My setting in Java Build Path do ...

28. How to include jpegs or gifs in a jar file and then be able to use them?

I wrote a fairly simple TicTacToe game using JButtons as the spaces and to amp it up I decided to add ImageIcons to the buttons to make it more visually appealing. Right now I'm just loading the images using the file directory on my hard drive like this: blank = new ImageIcon("/Users/david/Pictures/TicTacSkin/blankice.jpg"); Obviously when I run the game on my laptop, ...

31. Ant including needed .jar files

32. How to include external jar library files into my own jar library file

Hi, I am trying to create a library of some useful classes so my other colleagues can use them. In doing so, I have used other external (open source) libraries (eg. from apache.commons). When I create the jar file containing my classes, do I have to somehow include the external libraries too? If so, how? If not, do the users of ...

33. JAR: opening a notepad file included in jar

hello there, i m not sure whether this question fits in this topic; but anyhow. heres my problem: i have created a jar file. i put a 'txt' file in it. & accessing the file thru the main class. i had a 'exe' file too inside the jar. ( i know including exe removes the multiple plateform support, but i need ...

34. How to include externel library in JAR file?

Hi all =) I have a program that uses an external library (in a JAR file) I would like to compile my program as a JAR and have it include the external library that it needs to run, so that the external library would not need to be on the computer running my program. How can I do this? Thanks =) ...

35. Problem with jar including resource files.