I have a few Java/Maven projects that I want to use in a Grails 2.0.4 project. I have tried various approaches, such as: Installing the JAR files in my local maven repository, and executing grails install-dependency com.foo:my-project:0.0.1-SNAPSHOT Copying the JAR files into the lib folder of grails. Adding compile com.foo:my-project:0.0.1-SNAPSHOT to the dependencies section of BuildConfig.groovy Uncommenting mavenLocal() and passing
Tag: jar
How to create a .jar file using the terminal
I’m trying to create a .jar file using the mac terminal but am having bit of trouble. I followed the steps here but was unsuccessful. I got this error message: So how exactly do you go about doing it? My java program is called Main.java and I have compiled it into a .class file. Now what do I do? Thanks
How do I update one file in a jar without repackaging the whole jar?
I have a .jar file called myfile.jar. Inside this jar file is a folder called images. Inside this folder called images, I have an image called hi.png. I want to update that image with a new version of that image, which is also called hi.png. I do not want to extract all of the files from the single jar file
Could not find the main class, program will exit
I made an executable jar with the command prompt in Windows 7 using the jar cvfm MyJarName.jar manifest.txt *.class which created the .jar file. But when I attempt to open it, I get a pop-up window …
How to get the JAR file for sun.misc.BASE64Encoder class?
I have some code in my Activity class that uses sun.misc.BASE64Encoder class. But it is showing java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder. Do I need the jar? Where can I download it from? Answer Don’t use sun.* classes. For Base64 in Android, use its native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the
How to run a class from Jar which is not the Main-Class in its Manifest file
I have a JAR with 4 classes, each one has Main method. I want to be able to run each one of those as per the need. I am trying to run it from command-line on Linux box. It has directory structure for the main classes as follows: I know that I can specify one class as main in my
Access file in jar file?
I need to be able to access a file stored in a compiled jar file. I have figured out how to add the file to the project, but how would I reference it in the code? How might I copy a file from the jar file to a location on the user’s hard drive? I know there are dozens of
I am getting “java.lang.ClassNotFoundException: com.google.gson.Gson” error even though it is defined in my classpath
I’m trying to parse some JSON object strings that I’m getting using gson-1.6.jar I have placed it in the same location as my other .jars and have added it to my buildpath in eclipse. The other libraries worked fine when I added them and I can use them without any issues, but when I try to create the JSON object,
What version of javac built my jar?
How can I tell what version of the Java compiler was used to build a jar? I have a jar file, and it could have been built in any one of three JDKs. We need to know exactly which one, so we can certify compatibility. Is the compiler version embedded somewhere in the class files or jar? Answer You can’t
What causes java.lang.IncompatibleClassChangeError?
I’m packaging a Java library as a JAR, and it’s throwing many java.lang.IncompatibleClassChangeErrors when I try to invoke methods from it. These errors seem to appear at random. What kinds of problems could be causing this error? Answer This means that you have made some incompatible binary changes to the library without recompiling the client code. Java Language Specification ยง13