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?

Similar Messages

  • Cannot make executable jar file for swt application

    hi to all!!! i have started learning swt library and it seems nice to me, but i have one problem, i cannot run my application. The problem is that i cannot make executable jar for it.
    i'm using ecilpse_3.1.2 and have pluggined the visual editor for swt! yesterday i found one topic where was described the process of making the swt executable jar, i followed the instructions in the topic, but didn't resolve my problem, so if anybody knows how to achieve this , please help!!!!!!
    the instructions in the mentioned topic are :
    1. Make sure the SWT jar file is included in the Eclipse project build path
    a. Download the standalone SWT jar file from eclipse.org even if you already have the ones that come with Eclipse. It is called ?swt.jar? and you will package it with the executable JAR. Make sure it is the same version of SWT that you used to make your program.
    b. In Eclipse, import swt.jar via Project Properties::Java Build Path::Libraries::Add External JARs. (Make sure to include the source .zip file). Also make sure to select the swt package in the ?Order and Export? tab.
    c. At this point, you should be able to compile and run your SWT application in the Eclipse SDK.
    2. Do a standard Eclipse jar file export
    a. Right click on the main .java project file and select ?Export??.
    b. Choose ?JAR File? from the list.
    c. Select the relevant packages and .classpath and .project resource files
    d. Make sure ?Export generated class files and resources? is selected and browse to the location where you want the JAR file to be created.
    e. Specify ?Generate the manifest file? and don?t seal the JAR or any packages. Choose the class containing the main method as the ?Main class?.
    3. Change the manifest file
    a. Navigate to the JAR file you created and open it with WinZip.
    b. Open the MANIFEST.MF file inside and copy the contents.
    c. Create a new file called ?MANIFEST.MF? and paste in the contents of the old manifest file.
    d. Add the line ?Class-Path: <swt jar file path>?. For simplicity, you can just keep a copy of the swt.jar file in the same folder as the executable jar, in which case, the line is ?Class-Path: swt.jar?. Make sure there is a carriage return after the last line in the manifest file, or that line will not be parsed.
    4. Replace the manifest file
    a. Make sure the manifest file and the executable jar are in the same folder.
    b. Open the command prompt and navigate to the containing folder.
    c. Enter the command ?jar umf MANIFEST.MF <executable jar name>? to update the manifest file with the class path information.
    5. Package the JAR with SWT files
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows.
    b. The JAR file should now successfully execute. On Windows, you can usually just double click the JAR file in explorer and it will open. If that does not work, the command ?java ?jar <executable jar name>? on the command line has the same effect.
    but a few steps aren't exact for me , for example : first, which jar i have to include in build path : downloaded or from plugins folder, second
    i have to incude source.zip too??? but it is only in downloaded zip file which includes both swt.jar and src.zip, and finally can anyone clarify next :
    "5. Package the JAR with SWT files
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows."
    what does this mean, put these in folder or make jar from them????

    wolve634 wrote:
    but a few steps aren't exact for me , for example : first, which jar i have to include in build path : downloaded or from plugins folder, secondTry it both ways. If neither works, then ask again. In a suitable forum, though. An Eclipse forum or an SWT forum or something related to where you got those instructions would make a lot more sense than asking here.
    i have to incude source.zip too???No, of course you don't have to distribute the source code.
    a. Put the updated executable JAR file, swt.jar, and the associate DLL in the same folder. The DLL can be pulled out of swt.jar and should have a name like ?swt-win32-####.dll? on Windows."
    what does this mean, put these in folder or make jar from them????It says "Put (them) in the same folder". You're asking whether that means to put them in a folder? Yes, it does.

  • Can i make an .exe file which does't need any plateform or engine to run

    i just want to make a plateform independent executable file which should not need any run time engine to run. is it possible ??
    I have labview version 7.0 and it is fine. the applications is also simple but the target pc does't have any run time engine or labview installed.
    can u help me.
    thanx.
    --Alok Trivedi
    Pune
    -AL☼K

    You have to have a run-time engine installed and you cannot create an exe that is cross-platform. To create an exe for Linux or Mac, you need the Linux or Mac development system and the app builder for each.

  • I can not fint the texture files, which should have been installed with the CS6 and CC? why?

    I installed Photoshop CS6 a while back. Later on I discovered that the texture files where missing, or not included? Later I installed Photoshop CC, to see if the texture files were included here. But no, it was not. As far as I concern, I know that the texture files are included, and should have been installed, but they were not. Someone have any idea why?

    In Photoshop CC 2014, Filter Gallery opens the dialog below, and "Texture" is the last folder.

  • How to execute a jar file which has an applet, without using a html file ?

    I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
    <html>
    <applet code="file.class" archive="file.jar" width="500" height="300">
    <param name="name" value="value">
    </applet>
    </html>
    I want to know how to execute this class file without using the html tags.
    pls help me out in this.
    Anki

    Hi,
    You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
    1. Open a notepad and write the following
    Main-Class: XXXXXXXX
    XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
    2. Save the file as Mani.mf
    3. In the commant prompt ( your directory ) type following lines.
    jar cmf Mani.mf Demo.jar *.*
    4. This will make a jar file which is executable jar file
    Hope this will help you.
    Deepak

  • Executable JAR file: Could not find the main class.

    Hello,
    I have a problem with making an executable JAR file.
    I have written a JAVA program that consists of five different classes of which User.java is the main class and I have saved a text document with Main-Class: User and a blank line after that.
    If I try:
    jar cmf MainClass.txt User.jar User.class Beheerder.class Operator.class Manager.class MaakVisueelSchema.class
    it makes a executable jar file which actually works! :)
    But when the Operator class trys to open the MaakVisueelSchema class the screen stays blank.
    I can run MaakVisueelSchema with java MaakVisueelSchema.
    So I tried to make an executable JAR that consists only of MaakVisueelSchema, the same way as I did for User:
    Main-Class: MaakVisueelSchema
    jar cmf MainClass.txt MaakVisueelSchema.jar MaakVisueelSchema.class
    Then I get the error message:
    Could not find the main class. Program will exit.
    from the Java Virtual Machine Launcher.
    The big difference between MaakVisueelSchema and the other classes is that MaakVisueelSchema contains a PaintComponent method and an ComponentListener. Is it possible that one of those creates the error?
    Can anyone help me with this problem?
    Thanks in advance!
    Bye!

    Yes,
    I tried:
    jar xvf MaakVisueelSchema.jar
    and it returns:
    META-INF/
    META-INF/MANIFEST.MF
    MaakVisueelSchema.classN/G. You need to manually create a manifest file in a text editor, have it point to your main class, and enter it in your jar command as an argument.

  • Problem in loading applet from non executable jar file

    hello ,
    I am new to jar concept plz help.. I am trying to call an applet from another applet through frame it is working fine but its download time is much more. now i want to store all my images , sound files and class files of other applets in a jar file and want to access these inner applets from this jar file so that it will make only one http connection with the server for this jar file only and can reduce the download time of applet.
    Can anyone can give me suggestion plz..
    Thanx

    You have to download what you have to download. You
    probably can't easily share images between 2 separate
    Jar files. Unless you can expose them through the
    other applet via a method that can be known once you
    have the reference to the other applet.Thanx but i think i have to elaborate the problem :
    my project structure is just like this ::
    on the top is ::
    Applet A---> from this applet i am callling Applet B & Applet C in frame
    and communication is established between these 3 applets successfully .
    now i have made a single non executable jar file which contains images , sound and class files of these applets .
    so i am referencing images and sound files in applets through this jar.
    but i wanted to load Applet B & C through this jar file only.
    How can i do this ??
    Thanx .. I hope now the problem is clear

  • 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.

  • Executable Jar Files??

    Can someone tell me how u make Executable Jar Files.......... Thanks a lot...

                                                                             ^
         You need to search the forum                                       /|\
                                                                             |
       ----------------------------------------------------------------------|

  • Why -jar option used to install a software which is in executable jar file?

    Hi all,
    i have a query, i have a generic installer which is used to install the oracle weblogic 10.3 software in unix platform(i.e., which is in .jar extension) which is executable jar file.
    To install this software which have to use -jar option to install
    java -jar net_server<version>_generic.jar
    my question that why we use -jar option to install or to extract the software
    can any one clarify my doubt...
    thanks in advance
    abhi
    Edited by: sumanth_abhi on Jan 27, 2009 11:50 PM

    According to the Jar Guide (http://java.sun.com/j2se/1.4.2/docs/guide/jar/jarGuide.html)
    Executable Jar Files
    On Microsoft Windows systems, the Java 2 Runtime Environment's installation program will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with javaw -jar. Dependent extensions bundled with the application will also be loaded automatically. This feature makes the end-user runtime environment easier to use on Microsoft Windows systems.
    The Solaris 2.6 kernel has already been extended to recognize the special "magic" number that identifies a Jar file, and to invoke java -jar on such a Jar file as if it were a native Solaris executable. A application packaged in a Jar file can thus be executed directly from the command line or by clicking an icon on the CDE desktop.
    Despite that every JAR file can be executed as a program if and only if the META-INF/Manifest.mf contains the Main-Class tag. This done through java -jar jarfile.jar
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Why i can't execute jar files

    Greetings
    I read that jar files are executable unpon clicking them, but with me it do nothing.
    right now i'm using the command prompt to decompress jar files
    jar -xf jarfile.jar
    i have windows xp professional with j2sdk1.4.1

    You can execute JAR files by double-clicking them if the JAR files have an appropriate manifest and your file associations are set correctly (i.e. make sure you open JAR files with JAVAW.EXE). You can learn more about the manifest here:
    http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html

  • I download a file in the torrent site which is MP4 but unfortunately i tried to delete it but i can not. but all the files that i have is easily to delete only MP4 files i can't delete in the download foldeer please try to help dont know what to do please

    i download a file in the torrent site which is MP4 but unfortunately i tried to delete it but i can not. but all the files that i have is easily to delete only MP4 files i can't delete in the download foldeer please try to help dont know what to do please

    Well you can sync your iPod/iPhone to yur computer or laptop then take the photos off of your iPod like taking photos of of a SD card (from a normal camera) or off of a USB..! Good Luck. plz tick this saying This solved my question if it helps you.

  • How can I add image files to a executable jar file ?

    Could you tell me how can I add image files to executable jar file ?
    package structure:
    ../com/Main.class
    ../images/..

    Please don't cross post, and read this
    http://forum.java.sun.com/thread.jsp?forum=31&thread=271751
    I've answered the question in the New To Java thread.

  • Is it legal to convert the music files, which I have purchased in recent months, to the mp3 format and burn them on to a CD so that they can be played in non-apple music devices that dont support the M4A format?

    Is it legal to convert the music files, which I have purchased in recent months, to the mp3 format and burn them on to a CD so that they can be played in non-apple music devices that dont support the M4A format?

    Yes, of course it is legal.
    To convert the format, follow one of these documents:
    iTunes 11 for Windows: Save a copy of a song in a new file format
    iTunes 11 for Mac: Save a copy of a song in a new file format
    Also note that you have the option of buying your files in MP3 format in the first place, from Amazon MP3 or other online retailers.  MP3 files will work in iTunes as well as virtually every other player, program, and device.

  • Can't find jar file which contains com.sap.portal.directory - Constants

    Hi,
    I am not able to find a jar-file which contains the Constants class of com.sap.portal.directory.
    Does anybody know where to find it?
    Thank you in advance.
    Kind regards, Patrick.

    Hi,
    Refer this link
    Using JAR Class Finder
    in the server u can find the jar files required for the application....
    C:usrsapJ2EJC00j2eeclusterserver0appssap.comirjservlet_jspirj
    ootWEB-INFportal
    Regards,
    Senthil K.

Maybe you are looking for

  • Withholding taxes not updated when program run in background

    Hi, in a z1 report i do:   SUBMIT z2   VIA JOB lc_jobname    NUMBER v_jobcount      WITH p_fecha  = p_fecha                                     WITH p_file   = v_file_in      WITH p_e_file = p_efile       WITH p_client = p_client      WITH p_test   =

  • HT5097 How to restore from time machine?

    I've backup my Macbook Air Using time machine before reformat it to have window partition. However, after installing OS Lion 10.7.4, how do I restore back all my application and data on my last backup from time machine? Thks

  • Cannot start Xserver after installing Solaris 10 08/07 for Sparc

    Hi, Has anyone ecountered the following promblem after installing Solaris 10 08/07 for a Sparc processor .I am trying to exceed to the server but cannot get access to CDE or Gnome as the Xserver is not running! getting the following message on bootin

  • Flash crashing and adobe deleteing my threads?

    adobe doesnt want to support there product? you delete my threads? http://forums.adobe.com/thread/1039235 flash player crashes regularly. Pat Willener is going to try to blame my graphics drivers. like he always does.   here is the eventviewer log Fa

  • Write big query results into a file  ? ?  ?

    Hi all, The problem is: I want to write a simple query results into a file. I have no idea how to do that. Only thing I know is utl_ functions. Please advise GURUS how can I use them for big queries. Any example will be really appreciable. Thank you