jar

Newbie question: how to include JAR files when compiling?

I have the following in a java file (MyRtmpClient.java): import org.apache.mina.common.ByteBuffer; and ByteBuffer is inside a JAR file (with the proper directory structure of course). That jar file and others I need are in the same directory as the .java file. Then I compile with the line: javac -cp ".;*.jar" MyRtmpClient.java But...

How to deploy JDBC client app via WebStart ?

Hi all, I know that this is a very helping community.. so i hope I will get an answer for my problemt. Actually, I have a swing app which contacts an oracle database via JDBC. Now I want to deploy this via WebStart. I have a text area in the application that prints out the log messages . all goes well, jnlp downloads my application ...

Publishing artifacts with sources on archiva

At work I'm dipping my toes in managing project dependencies with maven. We use Apache Archiva (1.2.1) as a local repository and proxy. I'm adding artifact for open source project, that is not published on any public repository. I've learned that to publish the sources I should use the Classifier field on Upload artifact page. The source...

Include multiple jars with classpathentry

I have an eclipse's .classpath file that looks like this: <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="test"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> <classpat...

NoClassDefFound when running a jar

I built a jar using IntelliJ, setting the main class properly. When I run "java -jar foo.jar" from the command line (Windows), I get an exception that claims the main file is missing. The main class looks something like: package mypackage; public class LockUtil { public static void main(String[] args) { ... I'm getting the follo...

Loading .jars during runtime: my loader works, but using setContextClassLoader doesn't?

Hello, I have an URLClassLoader named "MyClassLoader" set up with some jars on it. If I try MyClassLoader.loadClass("MyClass"); it works. If I try Thread.currentThread().setContextClassLoader(MyClassLoader); Thread.currentThread().getContextClassLoader().loadClass("MyClass"); it also works. But If I try Thread.currentThread().s...

How do you extract a JAR in a UNIX filesystem with a single command and specify its target directory using the JAR command?

I am creating a Python script within which I am executing UNIX system commands. I have a war archive named Binaries.war which is within an ear archive named Portal.ear The Portal ear file resides in, say /home/foo/bar/ jar xf /home/foo/bar/Portal.ear Binaries.war Will extract the Binaries.war file out of the /home/foo/bar/Portal.ear ...

How can I load jar files for debugging in Jython?

The title says it all ...

How to build jars from IntelliJ properly?

I have a project that contains a single module, and some dependencies. I'd like to create a jar, in a separate directory, that contains the compiled module. In addition, I'd like to have the dependencies present beside my module. No matter how I twist IntelliJ's "build jar" process, the output of my module appears empty (besides a META-...

Source code of libraries downloaded with ivy

I use ivy with the ivy eclipse plugin to download dependencies. Works great. But how can I attach the source code for those libraries, in order to step into these libraries? ...

How do I discover which classpath entry provided a class?

I am loading several different classes from several different .jars from a custom class loader in Java. I create a custom URLClassLoader, add several .jars to it and pass it on to a ServiceLoader to find the classes I want. My question is: given a class, is there a way to discover which .jar it was loaded from? ...

How to run other main class during runtome and get it's console output?

I have a list of jars that contains jar with needed main-class. I try to run it main class: public static void runCommandlineMain(String classPathFile, String args[]) throws Exception{ URL[] urls = getJarUrls(classPathFile); URLClassLoader classLoader = new URLClassLoader(urls); Class<?> clazz = classLoader.loadClass("liqui...

maven-jar-plugin and transitive dependencies

I'm using both the assembly and jar plugins to deploy my application. I'm also using the jar plugin to help me generate the classpath in the manifest file using <addClasspath>true</addClasspath> While that seems to work, the problem comes when I try executing the jar (it has a proper main class specified) - it will fail to locate a li...

searching through .jar files eclipse

I'm porting a few java gwt projects into eclipse and the projects depends on many external .jar files, some of the dependencies seem to be dynamically linked so eclipse isn't picking up the missing links while running the ide. At run time, I often get exceptions that say for example 'import bar.foo.XML' is missing or some FooBar class d...

Tomcat deployment problem using jar file instead of classes

We're deploying a WAR file into Tomcat 5.5 and it works fine if WEB-INF\classes contains .classes files, but if we move the .jar file containing that .classes into WEB-INF\lib, we get an exception on runtime complaining that java.lang.NoSuchMethodError, but existing class file in .jar file contains the class and method does exits! Any ...

what could modify the SerialVersionUID while serializing and storing in a Jarfile ?

Hello, I am facing some issues while serializing objects (I am using JBoss Drools, and want to store an ArrayList of KnowledgePackage). When I serialize the list, store the result in a file, and deserialize it, no problem occurs, so it works fine. But when I serialize the list, store the result in a byte stream, then save it in a JarF...

Creating a javadoc web from compiled jar library

I have a third-party library in the form of a jar containing only class files. I'd like to be able to run javadoc (or some other tool) and generate a reference to the library API calls that I can make. I know I'm not going to get many useful comments, but I'm not expecting that. I just want the auto-generated summary of the classes and...

Add image to JAR Java

Hi, I'm using some imgages in JFrame, I have given a path to load image into panel of the frame, but when i made jar of the application its not dispalying images. Where should I place the image? How should I specify the path? setIconImage(Toolkit.getDefaultToolkit().getImage( "D:\RFT\src\dailogBox\dump.jpg")); like this i have do...

input/output with Java Web Start

I'm working on converting a very simple java desktop application to run in java web start and I'm having all kinds of trouble with the input/output files. Most specifically I can't seem to find any information on how to handle i/o in a web start application. I tried placing the input files in the same folder on my web server as the jar...

How do you build a JAR in eclipse with a custom manifest file?

I am trying to to build a Felix bundle in Eclipse. This basically includes having Eclipse create a JAR (through export) and adding my custom manifest file, however, I can't seem to get this to work. When I try exporting a JAR file, my custom manifest file shows up in the JAR, but doesn't ever get added to the right location within the JA...