How to create executable jar files??
how to create executable jar files??
thx :)
Using JAR Files to Deploy
http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava2/jar.html#jar
Similar Messages
-
How to create a .jar file in wlcs3.1
hello friends,
hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
thanks.
hari$JDK_HOME/bin/jar (%JDK_HOME%\bin\jar) shows you the syntax
where JDK_HOME is your jdk installation directory.
Kumar
hari wrote:
hello friends,
hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
thanks.
hari -
Unable to create Executable JAR file
Hi,
I tried to create Executable JAR file for
//JarTest.java
class JarTest
public static void main( String args[] )
System.out.println("i am EXECUTABLE JAR ");
mf is like
Manifest-Version: 1.0
Main-Class: JarTest
used jar cmf JarTest.mf exe.jar *.classIt created a jar file but i can't Execute the file
Help me
Thanks
AEjava is choosy about the actual manifest file format (line ending, trailing empty line, whatever).
This works for me with your example:
posman@proli:~/ivan/aa> cat mf
Manifest-Version: 1.0
Main-Class: JarTest
posman@proli:~/ivan/aa> od -cx mf
0000000 M a n i f e s t - V e r s i o n
614d 696e 6566 7473 562d 7265 6973 6e6f
0000020 : 1 . 0 \n M a i n - C l a s s
203a 2e31 0a30 614d 6e69 432d 616c 7373
0000040 : J a r T e s t \n \n \0
203a 614a 5472 7365 0a74 000a -
How do I creat a Executable Jar file?
on my WIndows XP jars are automatically "executable".
if its not on yours (you can check) check out this thread:
http://forum.java.sun.com/thread.jspa?threadID=653572&tstart=0 -
How to create a .jar file for the BPEL project
hi all,
how can i create a .jar file for my BPEL project, i am trying to deploy the project but getting an error :
"Error: [Error ORABPEL-10902]: compilation failed [Description]: in "C:\OraBPELPM\integration\jdev\jdev\mywork\Workspace_BPELDemo\BPEL_Report\BPEL_Report.bpel", XML parsing failed because "". [Potential fix]: n/a. "
and when doubel cliking on this error Jdev take me to the beginning of the ".bpel" file.
I 'm really stuck in here i am not able to deploy the process!
Thanks,
RanaRana:
If you haven't already, I would post this question in the BPEL forum. I would expect a much better turnaround there.
Johnny Lee -
How to create a jar file which is in the remote system?
Hi,
I have a set of files that resides in a remote system,which have to be "jar"red. I have a firewall in between. I want to create a jar file out of the files situated in the remote system.How do i go about this process.?Hi,
You can't do that in a simple way. You need to have a port open in the firewall, and you need to have a server process on the remote machine.
Kaj -
I m New in java i want to create a jar files but i dont know how please anyone help me and answer my question thanks.
Hi muhammadawood,
Creating a jar file is easy. First of all, a jar file is not much more than a zip file. You can use your favorite zip program (ie. zip, WinZip, pkzip, etc) to create the jar. To do this, zip all your classes together into a zip file. Then, rename the file w/ a .jar extension. This method doesn't support a small set of features defined by jar, but it will work nonetheless.
If you are using the Forte IDE, it has the ability to create a jar from a menu.
Regards,
Nick G. -
How to create executable jar in eclipse using linking in compiler
Hi,
I have a project in Eclipse. I wrote already an ant build file for creating an executable jar which includes all project files.
Now I want to create a second executable jar which is a subset of the project (a limited number of classes are necessary).
I have a main class and I was looking for a way to generate a jar file which includes the main class and all the depending classes.
Is there a way to do it? With ant or with another tool?
Is it possible to compile a project given a main class, and include all depending classes?
Regards,
Biebel
Edited by: biebel1975 on Jan 7, 2009 10:21 AMbiebel1975 wrote:
Some more information:
When I compile all the classes, the jar file is +/- 3.5Mb inclusive the server side logic.
The subproject I want to build, should be less then 1Mb (Only some screens and beans, no business logic ((only +/- 10% of the projects code) )).
My question is: How can I create a executable jar with only the necessary class files which depends on the main class. (Linked with the imports).
Is there a tool to do that? Can it be done with an ANT script? If so, how does the script looks?
What are you talking about?
You already said that you are using Ant.
Ant uses script files.
Since you have one with X items in it and you want something new with X-Y items in it the obviously it would make sense to construct an ant script that does less than the other ant script.
The following provides a huge amount of information about Ant.
[http://ant.apache.org/resources.html]
Other than that no one can tell you want your Ant script will look like except that it will do less than the one that you already have. -
How to create a jar file as a library in java?
Let me put it simple: rb.java is already put under /home/jiane/rb/rb.java;
the tar file rb.tar being located under /mylib/rbcore/, the test client is put under /home/jiane/test.java. now rb.java looks like
//// rb.java
import java.until.*;
public class rb {
%>jar cvf /mylib/rbcore/rb.jar /home/jiane/rb.class
test.java as below
//// test.java
import mylib.rbcore.*;
import java.until.*;
class test {
%>export CLASSPATH="/mylib/rbcore/rb.jar;."
%>javac test.java
%>test.java:1 package mylib.rbcore does not exist
so, how to make adjustment to rb.java & test.java so that I can make use of jar file rb.jar. please shows the steps to do. thanks a lot.import mylib.rbcore.*;This assumes the package mylib.rbcore and imports all its classes.
But the source of the class does contain package statement, so the class is in the default package. -
hi
Eclipse: file -> export -> jar file ...
command prompt jar
Usage: jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file
If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.
Example 1: to archive two class files into an archive called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .http://java.sun.com/docs/books/tutorial/jar/TOC.html -
Hi i wanted to create an .exe file extract the content from .zip using winzip extractor, please
see the below piece of code. the same is working in 32bit machine, but not working in 64bit machine windows server 2008
private bool CreateExeFile(string directoryPath, string zipFileName)
bool status = false;
string emuPath = String.Empty;
emuPath = System.Configuration.ConfigurationManager.AppSettings["winzipSe32Loacation"];
//string emuParams = @" -e " + directoryPath + "\\" + zipFileName + ".zip " + directoryPath;
string emuParams = " " + directoryPath + zipFileName + ".zip -win32 -y ";
//string emuParams = " " + directoryPath + zipFileName + ".exe a " +zipFileName +".Exe -mmt -mx5 -sfx" + directoryPath;
try
Process p = new Process();
ProcessStartInfo psI = new ProcessStartInfo(emuPath, emuParams);
psI.CreateNoWindow = false;
psI.UseShellExecute = true;
p.StartInfo = psI;
p.Start();
p.WaitForExit()
status = true;
catch
status = false;
return status;
Regards
BharathHello,
What error with you program?
if the reply help you mark it as your answer.
Free No OLE C#
Word, PDF, Excel, PowerPoint Component(Create,
Modify, Convert & Print) -
Creating an executable jar-file including a custom package
I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
jar -cmf Direkt2b.txt Direkt2b.jar *.class
where Direkt2b.txt is just:
Main-Class: Diriekt2b
Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
The main-class:
import java.awt.*;
import extra.*;
class Direkt2b extends ExtendedFrame {
Font f;
Direkt2b() {
f = new Font("SansSerif", Font.BOLD, 24);
setBackground(Color.yellow);
setSize(400,150);
public void paint(Graphics g) {
g.setFont(f);
g.setColor(Color.blue);
g.drawString("V?lkommen till Java Direkt", 45, 100);
public static void main (String[] arg) {
Direkt2b d2 = new Direkt2b();
d2.setVisible(true);
The help-class:
package extra;
import java.awt.*;
import java.awt.event.*;
public class ExtendedFrame extends Frame {
private static boolean first = true;
private boolean isFirst = first;
public ExtendedFrame() {
addWindowListener(theListener);
first=false;
WindowAdapter theListener = new WindowAdapter () {
public void windowClosing(WindowEvent e) {
dispose();
if (isFirst)
System.exit(0);
}My problem wasn't really getting more than one class in a jar-file,
but rather that my jar-file with multiple classes wouldn't execute.
Reading the original post I realized that maybe I was unclear about that.
However I have solved the problem now so for anybody reading this
thread in the future I will tell you how.
The general setting is this: You have a bunch of self-made help-classes
organized in some classdirectory somewhere in the filesystem. You use these
in your programming from time to time. You have set a classpath-varible
in your OS such that Java could find your help-classes.
Now you want to create executable jar-files so that you could publish your work.
My problem was that while I added all needed classes in a jar-file, the main-class
couldn't find the others because they were referenced incorrectly. The solution I
came up with may not be elegant, but it works. I copied the main-class and all directories
(only one in my case) just as they appear in the classpath-directory, to the same temporary
directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
I suspected that incorrect referencing was the problem and I tried several variations on the theme above
before giving up and writing the first post. Part the problem was that I didn't get any error messages,
just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
I guess there is a way to include the classpath instead somehow, but I will use my method for now.
I hope this was helpful to somebody. -
Creating an Executable jar file
Hello ! I have a application that has been fully developed and all i want to do is to create an executable file using my own icon so that whenever it is double clicked it opens up the appliation.
Please provide an example fro easy refrence.
Thanksi have the procedure for creating executable jar file in a separate file.
if u r interested then mail me at:
[email protected]
regards
Md. Afroze -
Can we make executable jar file which dont have main method?
I have a problem.
With whatever R&D i have done so far my understanding is that in order to create executable jar files i need a main method.
my problem is i have certain MIS reports which are developed in java and deployed through JSP pages...so my java program has no Main Method and only objects of the classes are being called in the JSP pages.
for e.g: i have a java class file BulkSms.class and i make an object of it in the JSP page through which my purpose is achieved by calling various method in the BulkSms through it s objects and there is no main method.
Can i make an executable jar file without a main method and if so please give me a detailed procedure of how to go about it.
i want to make it executable so tht on the click of it the MIS report is displayed from the JSP page.I am completely ignorant of JSPs, but you can not execute a jar or any java application unless you have a main method. It sounds like you need a way to launch the JSP - can't you do this with a browser?
-
Classpath is not working for executable jar file
I have created executable jar file using following command where manifest file contains Main-Class and Class-Path entries.
jar cvfm app.jar META-INF/* lib/* *.class
So here app.jar contains my external jar's in lib directory
but when I move app.jar to another directory, it's doesn't get my external files.
I'm not getting this problem as these jar's are in app.jar
class-path entry in manifest file:
Class-Path: lib/abc.jar lib/xyz.jar
Pls help me where it is getting fail?
Thanks in advance,
VikasJava doesn't handle jars within jars. Your library jars need to be outside of the executable jar as in
dist - main.jar
- lib - lib1.jar
- lib2.jar
Maybe you are looking for
-
I have got two iCloud accounts showing on my iPhone, both with the same email traffic... how do I get rid of one of the duplicates... and which one is right?
-
F.17- Customer balance confirmation
Hi, What are implications of running F.17. Can I run the programme any number of times during a period ? even if it is just for testing ? Thanks Anil
-
Help need for procedure with "cursor in a cursor"
Hi Iam using two cursors in my procedure. Create SP_sample as cursor C1 is select a from A cursor C2 is select a,bc,d from A,B where A.a=B.a Begin For Cur_rec C1 loop For Cur_rec1 C2 loop "SELECT QUERY" end loop end loop end 1)the "SELECT QUERY" is w
-
Error in data base connection - Help me
Hi, In our application we are using jdbc:odbc:driver to connect with MSAccess database (.mdb), The data base is password protected,, when I run the application and access the database the user name, application path and the password is stored in the
-
Problem when installing jwsdp 1.5 in suse 9.2
Greetings!! I am trying to install the jwsdp 1.5 in suse 9.2 and when I execute the installation script it throws me an exception: "Exception in thread "main" java.lang.NoClassDefFoundError: JWSDP" and for but that have attempted I have not been able