Skip to content
Advertisement

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 files in a Windows OS, as mentioned

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 me all the

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 or an

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 -> Archive File. In this case, when

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). What you could

classpath – running a java program from the command line

My code compiled fine with the following command: javac -cp “../lib/*” AvroReader.java (lib is where i put my jar files) At run time I get a ClassNotFoundException on the following line: DatumReader<?> dtmrdr = new GenericDatumReader(); It says it can’t find org.apache.avro.generic.GenericDatumReader even though I’ve imported it. Why is this happening? Answer Importing has nothing to do with loading classes

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? May be I need to write something in

Advertisement