folder « jar « Java I/O Q&A





1. How do you recompile a jar file?    stackoverflow.com

I took an old jar file and edited it. Now i have a folder that has all the files and I want to recompile them back to a jar file. How ...

2. How to get folder paths inside a jar file?    stackoverflow.com

Okay, so in the IDE it runs great and says the file exists, but once I pack it into a jar this code:

File levelFolder = new File(getClass().getResource("data/level").getPath()); 
System.out.println("exists = " + ...

3. How to enable the (JAR) file to access an external folder that is needed in the application?    stackoverflow.com

Please, My Java application is suppose to access an external folder which contains some other files. It was working perfectly under the Netbeans IDE but not when i run the (jar) ...

4. How do I access the content of folders inside a jar file?    stackoverflow.com

I need to take a look at the names of files inside a specific package. Currently, I'm doing the following:

ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL packageUrl = loader.getResource(getPackage().replace('.', '/'));
File packageDir = new File(packageUrl.getFile());

// ...

5. Move Jar file to Start Up Folder    stackoverflow.com

How do u move a Jar file to the Start up folder with code? Like within the code either make a Jar file or move it to a different directory with ...

6. how to put folders inside a jar file into the classpath?    stackoverflow.com

I am mantaining an old java application which has dcm4che as its library. The dcm4che library is not just a jar file. It is a folder which contains jar files and ...

7. SWT-App Loading .swf files from a runnable .jar or external folder    stackoverflow.com

I'm programming using the SWT Widget Library for Java in eclipse, and I'm designing a runnable Java application. I've got the application down, I just don't know how to load external ...

8. How do I get and use the Apache Ivy.jar file from inside my project, without having it in my .ant folder?    stackoverflow.com

At the moment I have this configuration: build.xml:

<!-- Ivy settings start-->

    <condition property="ivy.home" value="${env.IVY_HOME}">
        <isset property="env.IVY_HOME" />
    </condition>


  ...

9. Access a file from a JAR in the same folder    stackoverflow.com

I need to acces (create and read) a file from a JAR file (executable jar), and that file should be created in the same directory as the JAR I tried ...





10. classpath to jar files in a folder    coderanch.com

11. Why jsse and jce jar files are not in ext folder?    coderanch.com

Hi all, I was wondering that why jsse.jar and jce.jar are not by default put in jre/lib/ext folder? They are there in jre/lib folder of the JDK distribution but not in ext folder which makes it not usuable by default. We have to either copy or put symbolic link (in case of Unix based systems) so that it is visible to ...

12. Changing the JAR file contents in my lib folder    coderanch.com

Hi all, I want to change some.hbm files (which are just text files) that are inside a JAR file. The JAR file is inside my lib folder inside WEB-INF (it is a library that my application uses). Would it be possible to make these changes without unpacking and repacking the JAR? I tried to do it with WinZip but WinZip will ...

13. how to make a jar file inside a folder    coderanch.com

14. Creating a folder in a JAR file ...    coderanch.com

Hi, I'm dynamically creating a jar file. In this jar file i want my .class files to reside. I'm achieving this but only the .class files are being created in the jar file without sub packages that represent the package of the class. As an example if i have a class named A inside a package named x, in my jar ...

15. Reading from a file located in same folder as my JAR file.    coderanch.com

Hi All, I have my Netbeans Project after building of which creates a JAR file in the "dist" folder. Now i want to read some settings stored in a "settings.ini" which i pasted in the same directory as the JAR file. In my code i give directly, the name of the file to read from in the File Input stream. This ...

16. [Compiling] How to compile .java files with .jar and put in another folder    java-forums.org

How to compile Java source (.java) with Jar library and put classes (.class) in another folder with javac.exe? I would like to compile all Java classes form folder C:\Users\Kamil Szmit\Documents\NetBeansProjects\Warehouse\src\war ehouse (Category.java, Controller.java, Customers.java, Manufacturers.java, Model.java, Products.java, Startup.java, Subcategories.java, Transactions.java, View.java), add C:\Users\Kamil Szmit\Documents\NetBeansProjects\Warehouse\src\ojd bc6.jar as compile-time library and put classes (.class) in folder C:\Users\Kamil Szmit\Documents\NetBeansProjects\Warehouse\build\c lasses\warehouse.





17. add a folder to jar file    forums.oracle.com

can anyone help me on adding a folder to a jarfile?? i am using java.util.jar to create a jar file.. and i found that it only supports adding files to jar files and not a folder..is there any api that can allow us to add a folder to a jar file?? thanks, please geive me your guidance.thanks

19. How to build a jar file so the program can access its resources folder?    forums.oracle.com

I have a java program written by someone else in which I have made a trivial change (I changed the background color). The jar file runs but it does not find one of the resources file. Here is the project folder's structure mainClass.txt (manifest text file) folder resources (includes file Java does not find: order.txt, a text file) folder CFPT ( ...

20. Bin folder missing when creating JAR file    forums.oracle.com

Hello dear colleagues, I'm breaking my head over this one. After I downloaded and installed the latest Eclipse 3.3.0 + Omondo from the omondo website, I'm not able to get seperate output folders generated when exporting a JAR file. All source and class files are exported into 1 folder (src). I enabled the "use output folders src/bin" option in Java > ...

21. Referencing a file in the same folder as my programs jar.    forums.oracle.com

I have some images that my application uses and am having a very hard time figuring out how to best reference them. I want it so that my program can be anywhere on the HD as long as it's in one folder. The problem with this is that when I try and reference my images using just the image name, it ...

22. How to add all my folders and class files to my jar file    forums.oracle.com

Ok I have three folders (MapFiles, Textures, UnitFiles) and then I have my class files jar cmf mainClass.MF example.jar *.class This is what my jar creator.bat file says but I saw jar cmf mainClass.MF example.jar * this for all directories, but no luck the jar file works but when I run my game on the desktop I get an error, which ...