jar

Java Jar Class Not Found Exception

I can build my application cleanly on windows and Mac OS X but on windows when i try to run the application i get a class not found exception about my main class main$4 not found. class is there and it build cleanly. why can't it locate the class file? Jar works in OS X. Jar is created like the following. <target name="jar" depends...

JAR file gets modified during execution

This is after the last unsuccessful run of my program. I notice that the file size has changed and I can no longer run the Java class for my program: root@dbs01 ~ $ ls -l lifecycle-0.1-SNAPSHOT.jar -rw-r--r-- 1 root root 24740243 Jun 4 20:48 lifecycle-0.1-SNAPSHOT.jar This is after I copy the new copy of the original JAR f...

How to Make JVM Ignore Jar Signatures

We have a vendor-provided Jar that contains a class we wish to extends and/or modify via AOP. The default Sun JVM security model does not allow code that is unsigned or signed by someone else to extend classes in a signed jar. We can easily remove the signatures from the jar file, but I would prefer to configure the JVM to ignore jar s...

ant's java task can't find a jar in the jre/lib/ext directory

I put "stax-utils.jar" in the extensions directory ([JAVA_HOME]/jre/lib/ext), but ant's java task can't find it, giving: java.lang.NoClassDefFoundError: javanet/staxutils/IndentingXMLStreamWriter Strangely, it works for compilation: ant's javac task can find it. The problem is only with running code, with ant's java task... If I us...

where can I find IContentTypeManager

I get this exception in Eclipse: java.lang.NoClassDefFoundError: org/eclipse/core/runtime/content/IContentTypeManager$IContentTypeChangeListener at java.lang.ClassLoader.defineClass1(Native Method) I added org.eclipse.core.runtime.jar to the build path, but it doesn't seem to find IContentTypeManager there. Can someone tell me if t...

NoClassDefFoundError inside jar

I have a class that that sits in a package called com.toptur.sysTray all it does is load system tray it does not use any external packages. i create a SysTray object to install the system tray. Everthing builds fine. i can run the application from command line and systray gets installed. But when i try to create a jar from the class file...

Java static vs regular objects

While working on my previous problem, http://stackoverflow.com/questions/950636/java-jar-class-not-found-exception I noticed something odd. the class that can not be found is referenced from main. Now if i try to create an instance of the class like SysTray tray = new SysTray(); i get a class not found exception when i try to run th...

Running a jar archive in a running Java application

Hi all, I am new to java programming. I want to run a runnable jar archive from within my running Java application. I need to be able to control the running classes from within my application (i.e. Stop, start them etc). Basically I need to do the eqvilient of "java -jar X.jar". I cannot use Runtime.getRuntime().exec("...") as the jar...

Why should I sign my JAR files?

Why should I sign my JAR files? I know that I need to sign my client-side JAR files (containing Applets) so that special things like filesystem access can be done, and so that the annoying bit at the bottom of windows doesn't show, but why else? And do I need to sign my server-side JAR files containing Servlets, etc.? Some basic rules ...

JavaBeans Classes in Separate JAR Files

Is it possible to build classes for a JavaBean in separate JAR files? Specifically- a JavaBean has the Bean and BeanInfo classes in one JAR file and the Custom Property Editor class inn a different JAR, the JAR file with the Bean and BeanInfo classes has the JAR file with the Custom Property Editor class on the classpath, but during dra...

Using a jar in a Java project?

Hi All, I'm trying to use the public methods/classed from a project provided as a jar file (called Hello.jar for instance) wrapped in a package called hello. package hello; public class Hello { public static void main(String[] args) { coucou(); } public static void coucou() { System.out.println("Hello there"); } } In...

How to get method signatures from a jar file?

I have a third-party jar file that comes with the javadocs for only part of the API. Is there a way to reverse engineer the jar file to obtain a complete listing of classes and methods? ...

Does SWT distribute a JAR that works on any supported operating system?

The SWT project currently maintains one distributable for each supported operating system. For example: swt-3.4.2-win32-win32-x86.zip swt-3.4.2-gtk-linux-x86.zip swt-3.4.2-carbon-macosx.zip Is there a distributable that just Does the Right Thing, regardless of which operating system the application is running on? ...

Access .properties file at same level as working directory

I am working on a Java project that I want to deliver to my client as a .jar file. However, I want to allow the client to be able to change the parameters of the program without having to recompile or recreate the .jar. Basically, I want to be able to load .properties files from classes inside the .jar but locate those .properties file...

How do I force jarsign to sign jarfiles?

Our product is halted at Java version 1.5.0_13 and we would like to upgrade. Our software deploys a large number of jars via Java Web Start; all of these jars must be signed. However, a couple of the jars do not contain class files, and starting with Java version 1.5.0_14, it appears that the jarsign utility chooses not to sign any jar...

make a refresh on a eclipse project with ant

Hello, we have some ant script for building the different jar we use, in several eclipse projects. ( there is some interdependancie ) At the and of the build, we have to refesh some of the eclipse project in order to make the build path ok. ( without this, he dont see one of the just-builded jar and eclipse throws a build path error ) ...

What's the best way to share JARs across multiple projects?

When you have multiple projects that all use the same set of JAR libraries, it's tedious to include the same JARs over and over again with each project. If I'm working on 20 different projects, I'd rather not have 20 of the same exact set of JAR files lying around. What's the best way to make all those projects (and new projects as well)...

Invalid or corupt jarfile

I tried to create a jar file from a java project, which uses some external jars. I created a lib folder and put all the jars I need there. I run the project in eclipse by adding all the jars in the lib folder to the Build Path and it works ok. When I try to create the jar with ant from build.xml, it seems ok, no error is shown. When I...

Can pack200 be used to compress class files to run on jdk 1.4?

I would like to compress a jar file as much as possible for distribution (for downloading over dial-up modem). Can pack200, which was included in jdk5, be used on pre-jdk5 class files? To clarify, the target environment is jdk 1.4.x. ...

"Invalid signature file" when attempting to run a .jar

My java program is packaged in a jar file and makes use of an external jar library, bouncy castle. My code compiles fine, but running the jar leads to the following error: Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes I've googled for over an hour searching for an exp...