executable-jar

How to add VM options to jar?

I need to add -Djava.security.policy=myPolicyFile so that my RMI jar would work. Or is there some other way to make that run? ...

Packaging ejb3 swing client

Hi, I get the "java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac tory" error while running my packaged ejb3 swing client jar. Here's the stack trace. G:\Courses\OSUMC\Installables\June 5\New>java -jar MetaDB-Client.jar javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf aces.NamingContex...

manifest.mf is overwritten by ecplise during jar export

Hello guys, I would like make an executable jar archive with eclipse. So into my project I created file src/META-INF/MANIFEST.MF : Manifest-Version: 1.0 Main-Class: MainClass Class-Path: . But when I export my java eclipse project eclipse warn me with following message: "JAR export finished with warnings. See details for additional...

How do I build a Rhino project as a runnable JAR in Eclipse?

I have a Rhino project where I've written some .js files, and from Eclipse I start my program by calling org.mozilla.javascript.tools.shell.Main with a parameter to one of my .js files, "src/bot.js". Now, in order to run this on my server I would like to be able to build it into a single runnable JAR for easy deployment. How do I do this...

Classpath problem: .jar file can access a file from Class-Path in manifest, but not from -cp command line parameter

I have the file foo.jar in this directory structure: +--+- /foo_lib | | | +- Ice.jar ... | +-- /swt-linux-gtk -- swt.jar | +-- foo.jar where manifest says, in part: Class-Path: . foo_lib/Ice.jar swt-linux-gtk/swt.jar foo_lib/o rg.eclipse.core.commands_3.5.0.I20090525-2000.jar... It can be lauched without problem by the command ...

Copy a jar archive to file system with structure intact with Java

I have a program that runs from an executable jar. It has external dependencies such as xml files. I have created a jar full of resource xml files and placed it within the XML file and with a click of the button within the program I want all of those xml files and the folder structure to go along with it to be created at a user defined d...

Program stopped working after creating a .jar file with Netbeans

I made a simple Swing application with some database connectivity, using Notepad++ and executing it from the command prompt. It was executing perfectly. Then I copied all of the code to Netbeans and tried to build to main project, in order to package my application as a .jar file. A .jar file was created successfully, but when I trie...

Problem creating an executable jar from scala file.

I'm tryign to export my project as a jar with IntelliJ 9.0. My project compiles and runs with no problem in Intellij, but when I write it to a .jar and open it, it will show an error. My Main class is something like: package Main //Imports object Main{ def main(args: Array[String]) { println("Main: Hello, world!") //do stuf...

Create jar file that can be executed on any machine

I have simple java app that prints `hello world!' on console. It is packed in app.jar. Jar structure: main/Hello.class - my main class with singe println method META-INF/MANIFEST.MF Manifest file contains following: Manifest-Version: 1.0 Main-Class: main.Hello Everything goes fine. But when you have a dependency than trou...

How do you recompile a jar file?

I took an old jar file and edited it. Now i have a folder that has all the files and I want to recompile them back to a jar file. How do i do this? ...

Trouble Creating an executable Java Jar file

Hi all, I have the following Java code. It does what it is meant to do, but I am having problems creating a jar file. import java.io.*; public class openfile{ public static void main(String argv[]) { try { String line; Process p = Runtime.getRuntime().exec ("c:\\Users\\user\\D...

how to run or install a *.jar file in windows?

i have downloaded jbpm-installer-3.2.7.jar but i don't know how to install or run the file. if i double click it it is opening in winrar application. i tried installing through command prompt, but i got some errors as follows C:\Documents and Settings\ccuser\Desktop\manoj>java -jar jbpm-installer-3.2.7.jar Exception in thread "main"...

Unable to open specific JAR file in Java Code

I'm not able to open my JAR file using the following code. Though, I'm able to open other JAR files. try { Desktop.getDesktop().open(new File("myPlugin.jar")); } catch(Exception exception) { exception.printStackTrace(); } } I don't know if I'm exporting the JAR file incorrectly ...

Java Eclipse executable jar file

Hi All! I am new to eclipse + Java. I am trying to create executable jar file with eclipse export option. It works very well. But in my project, I have almost 10 packages (my own) and 4 main classes. I want to create a executable jar file that can execute any of main class from 4 main classes. For example: Double click write class name...

Java application runs properly in Eclipse, but not as .jar

I'm creating a Java app that creates 4 PDF files using iText. On the one that creates a PDF with an image in it, the .jar creates a 0 byte file and does not continue execution. However, when I Right Click >> Run As >> Java Application, it works just fine. To create the jar, I'm doing the following Right click src Export Runnabl...

Unable to run JAR file on another PC. Possible issue with Environment Variables?

I've built a JAR file and it executes fine on my PC (XP) which has Eclipse installed. It also works on another PC, which also has Eclipse. I've tried running it on another PC(XP) that does not have Eclipse. Though it contains the JDK and multiple JRE. The JAR file just does not execute by clicking or from the command prompt. I am not ...

Netbeans 6.8 & Glassfish 2.1.1

I am using Netbeans 6.8 with Windows OS 7. I downloaded "glassfish-installer-v2.1.1-b31g-windows" executable jar file to my harddrive. I open this jar with Java Platform SE binary by right clicking the jar file and chosing "Open." A folder called "glassfish" is placed in the same folder as the jar. The glassfish server is now downloa...

How to read external xml file from jar

Hi, i need to read an external XML file from my java application in jar executable file. If I lunch it from console (java -jar package.jar) it works fine, but if I lunch it by double click (Java Platform SE binary) it don't work. I have this problem with relative path. With absolute path it work in both way. ...

Exported runnable JAR file from Eclipse doesn't seem to execute

(Disclaimer: I am not a Java programmer, and really have very little idea what I'm doing in Eclipse) I hacked out an application in Eclipse a while back which I finished off and exported as a JAR which runs nicely. I didn't take any notes or make any comments. The time comes to make some changes to the project but I have to reload it a...

Problem with my Bash script

He all, i have a problem with my bash script. That's my code: #!/bin/bash java -jar my_app.jar echo "The present working directory is `pwd`" If i exec it by ./script_name it work, but if i double click on it don't work, i got this error: "Unable to access jarfile my_app.jar". Then the pwd output is different !!! My OS is MacOSX but i...