jar

Netbeans: Creating custom build target to let sources be packaged to JAR...?

Hello! I ask the question more specific: Using Netbeans, is there a possibility to create an additional custom build target, which would: either package all project sources along with the binaries into a singe JAR, or package all project sources without the binaries into an additional JAR? Notes: It's not an option for me to mod...

Get stdout and stderr from jar tool bundled for OSX

I've created an OSX app using Jar Bundler from Xcode following this howto: http://www.centerkey.com/mac/java/. The tool works fine, is launchable and I stop it from the dock, the problem I'm facing is that this tools is a command line server, creates no windows and its stdout and stderr are needed. Is there a way to create the bundle i...

Create a subset of a Java Eclipse project based on dependencies of one source file

I have a library Eclipse project/workspace containing functionality that is occasionally delivered to a customer. We're all researchers so this is done very informally; I make a JAR and a Word file with documentation, and send it to them. I prefer to send them a JAR file that only contains what they actually need, to simplify things. ...

Java Application NoClassDefFoundError

Created a Java application to upload documents via CIS (Content Integration Suite) to a storage application. The app runs successfully in RAD, but as a executable jar in a unix environment, getting a NoClassDefFoundError. I can not find the class on my local machine and there are not references to the class on the internet. The mani...

Read resource inside context (.war) from a jar file

I am using JBoss4.0.1 and Struts2.1.6 I have an application which have some configuration file(appConfig.xml in folder WEB-INF/config). This congiuration file contains the relative paths of other files to be read.(other.xml, some.xml etc). Application is deployed as .war inside default/deploy I have a Utility package that reads the con...

including an exe file to jar

Hello, I have written a java program that is actually works as a gui to an existing command line program. so in basic all my program does is Runtime.getRuntime().exec("myprogram parameter");. So I have exported my java source as a executable-jar file by using Eclipse IDE and it is working nice, however I indeed need to include this mypro...

calling an exe file inside jar

I am trying to call the "dspdf.exe" inside the jar file where this smartpdf class exists. I plan to extract it to a temp location and delete when program ends. However this doesn't seem to work, any help will be appreciated. import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import org.omg.CORBA.portable....

Copy a directory from a jar file

Hi. I recently finished and application and created a jar file. One of my classes creates an output directory populating it with files from it's resource. The code is something like this: // Copy files from dir "template" in this class resource to output. private void createOutput(File output) throws IOException { File template ...

Autoupdate feature in a Java Swing desktop App

I've developed a desktop Swing app and I'm thinking about the best way to provide the autoupdate feature. I know that JavaWebStart provides this but I think that It doesn't suit my needs because I need to read local files so I would need to sign the jar. Besides, JWS requires extra work to deploy in the server while now I only need to u...

Tomcat: hot deploying new jars

Can you hot deploy JAR files on Tomcat 5? The idea is to avoid restarting Tomcat and still be able to load (via reflection) some class from a newly added JAR. Can it be done? How? Is it unadvisable for a production system? Thanks Edit: my scenario requires the addition of new JAR files for which the names aren't known in advance. Can t...

Create Multiple JARs from Eclipse Project

I have begun working on a project that, at the moment, produces a monolithic JAR file from an Eclipse project. Basically, there is an Ant script that runs anytime the Eclipse Java Builder runs and takes the output of the Eclipse Java Builder (the .class files) and packages that up into a JAR file. That JAR file is then placed in a comm...

Java Minimize Dependencies

I have a situation where there is a small piece of Java code that has a large number of jars that it depends on. However, the dependencies inside these jars are very shallow. In most cases it only depends on a jar for a single interface. Instead of distributing all of the jars with the application, I would like to just distribute the sp...

JavaWebStart app randomly fails

Hi I have a JAR signed with a self-signed certificate and deployed by JWS. It usually runs ok (most of the times) but sometimes fails which is quite annoying, It shows the splashscreen but nothing else. These are the last log lines: <record> <date>2009-09-08T16:55:33</date> <millis>1252421733468</millis> <sequence>173</sequence> <logg...

Java: Howto know where the jar is located in Linux

Hello, In Linux, the JVM sets the working direcory equal to the homefolder from the user. In Windows is this the folder where the jar is located. How can I find where the jar (from my app) is located to change the working dir? Martijn ...

How to handle two jar files in java?

I am using Netbeans IDE for a java project. In this project i need a jar file "htmlunit-2.6.jar". I have included this jar file in the project libraries folder. I have instantiated one of its class "WebClient" but this class needs other classes of "commons-httpclient-3.1.jar" file. Now I have also included "commons-httpclient-3.1.jar" ...

Where does a Java ME JAR install to?

When you install a Java ME program on a phone using a .jar file, where does it install to? At which path can the Java files be found? Or does it install to a location hidden from the filesystem? ...

NoClassDefFoundError while running from jar

I am getting a "no class definition found" exception while trying to run my application on Windows (it runs fine on OS X). The classes the JVM is complaining about are my classes (no third party jars required). When I unzip the files inside the jar, all files are present, including the ones the JVMm is complaining about. The jar is cr...

Verify integrity of JAR files necessary?

I have a zip file containing a number of jar files that is being downloaded from an HTTPS site. The jars form a command line driven, server side application. I have a Java written application installer that does some checks to verify that the jars are signed using a particular trusted digital certificate and have not been modified durin...

How do I hide Referenced Libraries in Eclipse's Java EE perspective?

Eclipse's normal Java perspective seems to hide Referenced Libraries just fine (in a "Referenced Libraries" folder in your project). Unfortunately, the Java EE perspective does not seem to have this same feature and enabling it is non-intuitive. Can anyone shed some light on this issue? ...

List files inside a jar

I have this code which reads all the files from a directory. File textFolder = new File("text_directory"); File [] texFiles = textFolder.listFiles( new FileFilter() { public boolean accept( File file ) { return file.getName().endsWith(".txt"); } }); Works great. It fills the array with...