Skip to content

Tag: jar

Android Archive Library (aar) vs standard jar

I’ve been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on jar files in order to build my project. However it seems that Android has also aar packages, which are the equivalent to the dll…

Load a file in Resources with FileInputStream

I know the safe way to open a file in the resources is: now the problem is that my file is a model for a decider in the Weka Wrapper package and the Decider class has only a method: load takes the file and opens it as a FileInputStream. Do you see a workaround? I really would like to ship

Read directory inside JAR with InputStreamReader

So, this question has been asked a million times i believed and I’ve been reading them for a couple of hours and trying several options given by some people but none of them work for me. I want to list all the files inside a directory inside the application’s JAR, so in IDE this works: That gives …

EXE4j Jar to exe error

I’m recently Java 7 update 21 JDK and i created java application with netbeans For distributing my jar i use Exe4j 4.5.2 Jar to exe. Now when i used Exe4j it creates exe but when i execute it it shows me error message. “The JVM could not be started. The maximum heap size (-Xmx) might be too large …

Import project (jar) into Eclipse

I got a .jar file which I need to import into Eclipse. However, I don’t want to have the jar as a referenced library. I need the .jar to be included like a “normal” project, with packages(!) and .java files. I tried to do the following: New Java project -> Import -> General -> Archi…

How can I add files to a Jar file?

I want to add a series of files previously extracted from other files(already done) to a jar. These files will be overwriting files inside the JAR. What is the most efficient way to do it? I need it to be fast. Thank you! Answer A JAR file is a ZIP file, remember. Just use some ZIP library.

Call java class method from jar (not main)

Is this possible to call a specific method (other than main) of a class in a jar file from command line? Answer If you are talking about running Java code from the command-line, then no. You can specify a class name, but not which method to call, that always has to be public static void main(String[] argv). W…

How to download sources for a jar with Maven?

In my project I am using a JAR file provided via Maven. But what Maven gives me is only this jar – no javadocs and no sources. Pressing “Download Sources” has no effect: Eclipse still does not find the sources of the jar. What this depends on? Should repository provide sources automatically?…