Jar file execution problem

Hello friends,
I have a project folder in which i have 4 packages
application
ui
controller
model and
a folder Datafile containing project related xml and text files
my main class is in application package
I am creating a jar file of my whole project folder in Eclipse environment, using the main class as TheApplication in application package. I am able to generate the jar file but unable to execute it.
When I tried to execute it from command prompt it is giving me an error saying no main,
Please tell me what I am doing wrong, and suggest me a solution
Thanks in advance

ya, You are required to put an entry in Malifest file.
you need to add Main-Class <your class name with which you need to start ur application
Wasn't this already shown in reply #7?> Yes it was, But as he said, even though he is getting the same problem.. So. I tried to recall him that, that class should the starting point to the application & it should be public & it should have public method.. And is not mentioned in that reply #7
I guess you got my point now.

Similar Messages

  • Jar files download problems in Java Webstart with JRE 1.6

    We have encountered a few problems in Java Webstart with JRE 1.6
    In JRE 1.5, the jar files are getting downloaded onto the client
    machine with it's original names.
    Example :
    Server File Name : acm.jar
    Client File Name : RMacm.jar
    But in JRE 1.6, the jar files are getting downloaded with improper file names.
    Example :
    Server File Name : acm.jar
    Client File Name : 4fb074cc-66fc7407
    Moreover the path itself seems to be invalid.
    Example Path :
    JRE 1.5 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\javaws\https\D17.16.23.11\P443\DMtest\DMwebStart
    JRE 1.6 path:
    C:\Documents and Settings\Administrator\Application
    Data\Sun\Java\Deployment\cache\6.0\12
    Due to this, we are facing Classpath problems.
    What changes do we have to make to the code, for Java
    Webstart to work ?
    We are using JBoss 4.0.4 and JDK 1.5 in the Server
    On the client machine, we have IE 6 and JRE 1.6.01
    Help would be appreciated.

    Ask your Java Web Start question at:
    http://forum.java.sun.com/forum.jspa?forumID=38

  • Jar file execution fails

    Hi,
    May be somebody has an idea about my problem.
    I have vendor jar file; Notes.jar with class lotus.notes.NotesThread.class
    Now I'm trying to create an instance of NotesThread in my class CustomAgent.
    Problem is: when I run just the class: java CustomAgent, it works.
    But if I created jar file by jar -cf custom.jar *.class and try to execute it by java -jar custom.jar, it fails and gives me an error:
    Exception in thread "main" java.lang.NoClassDeffoundError: lotus/notes/NotesThread
    Does anybody have any clue?
    Thanks a lot

    Create a manifest file with the Main-Class property in it.
    Main-Class: MyClass
    And then create the jar file using the manifest.
    jar -cmf mymanifest myjar.jar /workingdir/*.class
    Now your jar file will be executable.
    Because you are using an external jar file.
    Make sure the manifest file also has
    the "Class-Path: external1.jar external2.jar"
    If you put those external.jar files in the same directory as your jar files you should be okay.
    Happy programming.

  • .jar file deployment problem

    Hi I am running a web application using tomcat 4.x .
    I want to deploy the appllication as war file in tomcat I did the following step:
    1.jar cf web.jar * use this command to make .jar file
    2. placed it in tomcat_home/webapp folder.
    it is able to get to the first page that has 2 frames. The pages in that frame are not been loaded. error 404 The requested resource (/integrate/jsp/default.jsp) is not available.
    is shown.
    Where could be the problem
    Thanks in advance.

    Hi I am running a web application using tomcat 4.x .
    I want to deploy the appllication as war file in tomcat I did the following step:
    1.jar cf web.jar * use this command to make .jar file
    2. placed it in tomcat_home/webapp folder.
    it is able to get to the first page that has 2 frames. The pages in that frame are not been loaded. error 404 The requested resource (/integrate/jsp/default.jsp) is not available.
    is shown.
    Where could be the problem
    Thanks in advance.

  • Jar file creation problem

    I have create the jar file, but it show the following error mesage since i start to run it.
    Java Virtual Machine Laugcher
    Failed to load the main class manifest attribute from
    E:\j2sdk1.4.2\bin\test.jar
    What the problem for this?
    my manifest.mf file contain the information
    Manifest-Version: 1.0
    Main-Class: mysystem.MainFrame
    note, my directory is javac mysystem/MainFrame.java to run

    Open the jar in WinZip (or any other).
    the mysystem directory should be in the root..

  • Creating jar file gives problem in WSAD IDE

    Hi,
    i programmatically created a Jar file successfully. I am able to open
    the jar file and read the jar file properly. But when i try to include that jar file into WSAD, it cannot recognize the class files within it.
    Any help would a great input.
    Thanks and Regards,
    Sapan.

    >
    2) U are having one program in which u are creating
    jar as well as using the class file in it at runtime
    using reflection. If this is the case then u might
    have to check manifest file of the project.
    If none of the above is the case then please explain
    little bit more, what r u trying to do.
    Regards,
    Samip.I m creating the jar file and then use the classes in the jar file through reflection / generics. I checked the default jar file that is created using jar command, and the manifest file doesnt have anything except, Sun Microsystems and jdk version.
    It seems that the problem is with the manifest of the jar file that is created. There is something that is missing in the jar file, and WSAD 4.0.3 expects the same.
    Regards,
    Sapan.

  • Jar file caching problem

    I'm running applets under IE in our application. The application contains multiple pages, each page with one applet. Each applet contains some shared jar file and one specific jar file for that applet.
    Most of the time, the caching mechanism work fines. The browser is able to check with the HTTP server to see if any new jar files and download automatically. If no updates, the cached jars (in browser) are used.
    However, at some other times, when I jump across several pages, performing different processing, suddenly the browser will reload all the jar files from the server. Even some shared jars are reloaded in every page within the same browser session.
    If above problem occurs, I close the browser, open a new one and jumping to the pages again, the browser will be able to use the cached version again.
    The runtime environment as follows:
    JRE 1.3.1_02
    IBM HTTP server 1.3.12.6
    IBM WebSphere Appl Server 3.5.3
    IE 5.50 (The "Check for newer versions of stored pages" is set to "Every visit to the page")
    Pages created by JSP, syntax as follows:
    <OBJECT classid="<%=JSPUtil.getClassid()%>" codebase="<%=JSPUtil.getPluginCodeBase()%>" WIDTH=100% HEIGHT=175% NAME=posApplet>
    <PARAM NAME=ARCHIVE VALUE="<%=JSPUtil.getSharedArchives()%>, <%=JSPUtil.getArchiveLocation()+"/posPending.jar"%>">
    <PARAM NAME=CODE VALUE=ho.aia.pos.pending.applet.PendingSGP >
    <PARAM NAME=NAME VALUE="PendingRequirement" >
    <PARAM NAME=codebase VALUE="<%=JSPUtil.getCodeBase()%>">
    </OBJECT>
    Do anyone knows anything about the problem?
    Anyone knows how to make the caching work NORMALLY?
    Thanks

    Recently I tried to used some robot tools to test our application for performance issue. During the robot testing, I acceidentally discover some difference for the jar downloading which cause the above mentioned problem.
    At first, this http request has no problem and the jar file is NOT downloaded. Http server shows a response code of "304", meaning download not required.
    http_request
    "GET lib/posLookup.jar HTTP/1.1\r\n"
    "Accept: */*\r\n"
    "Accept-Encoding: gzip, deflate\r\n"
    "If-Modified-Since: Thu, 05 Dec 2002 17:22:12 GMT\r\n"
    "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; T31246"
    "1)\r\n"
    "Host: defaulthost\r\n"
    "Connection: Keep-Alive\r\n"
    "Cookie: sesessionid=0001UULRZPFLU5IBRNBVHWUUAFI\r\n"
    "\r\n";
    Then after running for a while, the browser jumps into another page and finds that the same jar file "posLookup.jar" is required. It issue another http request to server as:
    http_request
    "GET lib/posLookup.jar HTTP/1.1\r\n"
    "cookie: sesessionid=0001UULRZPFLU5IBRNBVHWUUAFI\r\n"
    "User-Agent: Java1.3.1_02\r\n"
    "Host: defaulthost\r\n"
    "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n"
    "Connection: keep-alive\r\n"
    "\r\n";
    But this time the user agent becomes Java1.3.1_02 and the accept type becomes text/html instead of original zip format. After this, I check the IE temporary file and found that the posLookup.jar is having a type of "HTML Document" instead of "Executable jar file".
    Does anyone know whether this is a bug of the Internet Explorer or it is bug of the Java Plugin?
    Appreciate any opinions or comments.
    Thanks

  • .JAD/JAR file download problems

    Hi,
    I'm having trouble with downloads of .jad and .jar files through WAP onto my mobile phone. The .JAR file downloads fine via the WAP APN but then the .JAD file doesn't download.
    From what I can see, it looks like the j2me app manager on the phone which reads the jad file tries to download the .JAR file directly from the website. The problem here is that since i'm connected to a WAP APN, i have to download through the proxy so there's no direct access to the internet.
    Anyone else have this kind of problem?
    Is is possible to set up the .JAD file somehow so that it downloads through a proxy or takes the current APN to download it??
    This is a HTTPS site but I dont think that would make a difference.
    Cheers,

    Hello,
    I have a very similar problem. Not quite the same tho: i am able to download the JAD and the JAR gets requested. One some phones the JAR gets downloaded properly but on others it blocks after 50 or 60 %.
    We only encounter this problem when downloading through a proxy (defined in the phones wap/internet configuration); when we connect without a proxy everythibng works just fine.
    Another clue might be the fact that we cannot do HTTPS communication (from the device) using a connection that is proxied. (We tested by putting the file on the device using bluetooth).
    Has anybody seen this before? Do you know a solution to this problem?
    Thank you,
    Nick

  • Jar file execution

    hi all
    can anyone one tell me the procedure of how to create a executable jar file.
    on clicking on the jar file itself my class file has to be executed without executing it from command prompt.
    thanks in advance
    bindu

    HERE

  • Jar file import problem with ADF application

    Hi Everyone,
    I am using Jdev 11g with integrated WLS. I have an ADF application and is trying to integrate JasperReport in it. I added the JasperReport JAR file in the project properties -> Libraries and Classpath, and checked it for "export" and "Deployed by Default'. I have my JasperReport codes in my managed bean
    as follows
    +public String cb1_action() {+
    +try {+
    +JasperDesign design = JRXmlLoader.load("C:/JDeveloper/mywork/ReentryApplication/ViewController/public_html/jasper/testReport.jrxml");+
    +JasperReport report = JasperCompileManager.compileReport(design);+
    +....+
    +}+
    +}+
    I am able to compile the managed bean class successfully. However when I run the application, I got a stack of errors like this,
    +[2009-10-08T11:31:59.910-04:00] [DefaultServer] [ERROR] [] [javax.enterprise.resource.webcontainer.jsf.application] [tid: [ACTIVE].ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: test123] [ecid: 0000IGollZuB5EirL4YBUA1AnVop00000L,0] [APP: ReentryApplication] java.lang.RuntimeException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:[[+
    +C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\DefaultDomain\testReport_1255015914097_607807.java:4: package net.sf.jasperreports.engine does not exist+
    +import net.sf.jasperreports.engine.*;+
    +....+
    It appears that the JAR file is not picked up at the runtime correctly. I tried a simple Main class with the same codes and JAR file added, it works fine. Does anyone know what I am missing within the ADF application?
    Any helps would be appreciated.
    Thanks,
    John
    Edited by: john wang on Oct 8, 2009 9:24 AM

    Timo,
    Thanks you for your prompt response.
    1. I checked The following folder (I assume this is where it supposes to be). The JAR file is there.
    C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\o.j2ee\drs\ReentryApplication\ReentryApplication-ViewController-webapp\WEB-INF\lib
    2. I did not do anything about deployment descriptor. Since I run my application within JDev integrated WLS, I did not do anything about deployment setting. Do I need do something with deployment descriptor if I want to import additional JAR files here? With my experience with 10g, to add a JAR file within JDev, all I need to do is to add it through project properties ->libraries.
    3. I agree with your absolute path comment. This is a test of how JasperReport works with ADF application. I will work it out later.
    Thanks,
    -John

  • Jar file execution failed on Redhat

    Hi All,
    I am unable to execute jar file on Redhat 4ES using terminal. The same jar is executing smothly on windows and Mac OSX
    The error shown on the terminal is given below:
    # java -jar oiaccess.jar
    Warning: -jar not understood. Ignoring.
    Exception in thread "main" java.lang.NoClassDefFoundError: ..oiaccess.jar
    at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
    at JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
    at JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
    at __gcj_personality_v0 (/rajneesh/1Access6.7/lib/java.version=1.4.2)
    at __libc_start_main (/lib/tls/libc-2.3.4.so)
    at JvRegisterClasses (/rajneesh/1Access6.7/lib/java.version=1.4.2)
    Please provide any comment to solve it....
    Thnx in Advance

    blackstallion wrote:
    Hi All,
    I am unable to execute jar file on Redhat 4ES using terminal. The same jar is executing smothly on windows and Mac OSX
    The error shown on the terminal is given below:
    # java -jar oiaccess.jar
    Warning: -jar not understood. Ignoring.
    Exception in thread "main" java.lang.NoClassDefFoundError: ..oiaccess.jar
    at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
    at JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
    at JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
    at __gcj_personality_v0 (/rajneesh/1Access6.7/lib/java.version=1.4.2)
    at __libc_start_main (/lib/tls/libc-2.3.4.so)
    at JvRegisterClasses (/rajneesh/1Access6.7/lib/java.version=1.4.2)
    Please provide any comment to solve it....
    Thnx in AdvanceMeaning error in classpath!

  • Bat File execution Problem in Win Server 2k3

    I have a jar that is calling a .bat file.
    It executes the bat file in Windows XP, and Windows 2000
    But when I run it in Win Server 2k3 it can't execute.
    I get Exit Value 1
    Does anyone know any differences between the Operating Systems that could cause this?
    Thanks
    Paul

    I don't know enough about the difference in system or even between your two installation. An exit 1 error could happen for any reason, such the batch file not being found or other reason.
    The best thing to do is get a handle to the stderr and stdout of the process and display them. To do this you would write a class that reads from an InputStream (the output of the process is read using an InputStream) and displays to System.out. Follows is some code that illustrates this (done off the top of my head, more or less, so it won't necessarily execute as is):
       void runExternalTask()
          String cmd = new String { "myexecutable.exe" };
          Process proc = Runtime.getRuntime().exec(cmd);
          ProcessOutputHandler procOut = new ProcessOutputHandler(proc.getInputStream(),0);
          ProcessOutputHandler procErr= new ProcessOutputHandler(proc.getErrorStream(),0);
       public static class ProcessOutputHandler implements Runnable {
            InputStream _in;
            //PrintStream _out;
            boolean run = true;
             * Constructor for ProcessOutputHandler.
            public ProcessOutputHandler( InputStream in, int procID ) {
                _in = in;
                (new Thread(this,"output.handler."+procID)).start();
            public void close () {
                run = false;
            public void run() {
                try {
                    int i = 0;
                    while ( run && (i=_in.read()) != -1 ) {
                        System.out.print((char)i);
                } catch (IOException e) {
                  e.printStackTrace(System.err);
        }

  • JAR File ClassPath Problems

    i have this directory structure:
    deploy/
    deploy/program/
    deploy/program/(classes)
    deploy/program/subfolder/
    deploy/program/subfolder/(classes)
    from deploy i am jarring with the command:
    jar cfm Program.jar manifest.txt Program
    with the following manifest text:
    Main-Class: Program
    Class-Path: Program/ Program/subfolder/
    (new line with no space)
    my main class is called "Program"
    the classes in "Program" and "subfolder" are NOT in a package (they are "loose" classes)
    ive tried MANY different entries for the manifest classpath but get the same result:
    Exception in thread "main" java.lang.NoClassDefFoundError: Program
    please help!

    there are no packages because this is just a hack up demo with 15 or so classes.
    i thought itd be easy enough to jar this without adding packages. : /
    i could just throw them in one folder but this has become a battle of pride, lol.
    DrClap if I jar from the Program folder instead of Deploy with:
    jar cfm Program.jar manifest.txt *.class subdirectory
    and manifest:
    Main-Class: Program
    Class-Path: subdirectory/
    I get:
    Exception in thread "main" java.lang.NoClassDefFoundError: (subdirectory class)
    If I delete the Class-Path entry altogether I get the same Exception.

  • Run EJBC on jar file (in Weblogic)

    Hi all,
    Why do we have to use the following statement while creating a jar file for Entity Beans deploying in Weblogic App server.
    ==================================
    java -classpath d:/bea/wlserver6.0/lib/weblogic_sp.jar;d:/bea/wlserver6.0/lib/weblogic.jar weblogic.ejbc -compiler javac build\std_ejb_trader.jar d:\ejb_trader.jar
    ===========================================
    Any help will be appreciated.
    Seetesh

    Hi Deepak,
    java -classpath d:/bea/wlserver6.0/lib/weblogic_sp.jar;d:/bea/wlserver6.0/lib/weblogic.jar weblogic.ejbc -compiler javac build\std_ejb_trader.jar d:\ejb_trader.jar
    The installer of Weblogic 6.0 is that it doesnt have this Weblogic_sp.jar while installing whereas Weblogic 6.1 has this jar file.
    Problem in this case using Weblogic 6.0 is that without Weblogic_sp.jar d:\ejb_trader.jar file doesnt get created at all.
    Thanks for ur reply,
    Seetesh

  • Bulid Jar file

    Hello
    i made a simple project in netbeans and even i bulid a jar file but problem is when i open jar file in command prompt i got error exception in thread main
    please anybody tell me how can i remove this error?
    Thanks

    You can create jar file using netbeans simply by clicking bulid button but first change mainfest file
    mainfest file should like
    mainfest version 1.0
    Class name: name of class
    one more thing is you should include all external libariers which you use in out project
    but if you got stil error like me then use ant for bulidng like i do
    thanks

Maybe you are looking for

  • Reports exported to Excel - Formatting issues

    We have two Business Objects Enterprise servers (boxi r2 and boxi r3.1 sp3) running side by side.  We find that reports created using boxi r2 and exported to Excel format look fine.  When we run the same report and export to excel using boxi r3.1 sp3

  • How to create Date relationship with Fact and DimDate on Tabular model?

    I have two tables in SQL Server 2014 SSAS Tabular model. DimDate(defined as data table) have date column (format is 1.7.2010 00:00:00) This table have been impoted from AdventureWorks. FactSales have SalesDate column (format is 25.03.2015 18:08:05).

  • Bridge freezes when renaming files

    When I rename certain files or folders, Bridge freezes on this message: Updating the cache for items within the folder recursively... It doesn't happen with all files or folders, but I haven't been able to determine a pattern. I've also had issues wi

  • C/C++ using SOAP as JMS Client ?

    Did any body tried C/C++ using SOAP as JMS Client?

  • Differences between clients and devices in Cisco Prime infrastructure

    Hello It seems to be a very simple question : I read the Prime Licensing Guide in order to size the right version of OVA to deploy in my datacenter . I don't understand what is a "client"  , because there is a topic about it in the data sheet :(cf jo