Classpath for jar files?

Hi all,
i am trying to run a standalone java program using JRC through command promt.
my problem is i am importing few classes from jar files into my java class. but its not getting imported.
how to resolve it?

Hi Saravana
You can use batch file to run your standalone java program.
The contents of the batch file would be as follows:
@echo off
if "%OS%" == "Windows_NT" setlocal
rem
rem Sets the CLASSPATH environment variable to include all JAR files
rem required for the JRC then compiles and jars Java file(s).
rem
rem Edit the environment variable BOBJ_JAVA_LIB to point to the
rem location where you have the JRC jar files.
rem
rem Make sure to define any other required libraries in the environment
rem variable CLASSPATH.
rem
rem Make sure you have defined the environment variable JAVA_HOME
rem
set BOBJ_JAVA_LIB=c:\Program Files\Business Objects\Common\3.5\java\lib
set CURRENT_DIR=%cd%
echo Using JAVA_HOME: %JAVA_HOME%
echo Using CURRENT_DIR: %CURRENT_DIR%
set RUNJAVA="%JAVAHOME%/bin/java"
set RUNJAVAC="%JAVAHOME%/bin/javac"
set RUNJAR="%JAVAHOME%/bin/jar"
set CLASSPATH=%BOBJ_JAVA_LIB%\ReportViewer.jar;%BOBJ_JAVA_LIB%\ReportPrinter.jar;%BOBJ_JAVA_LIB%\CrystalCommon.jar;%BOBJ_JAVA_LIB%\CrystalDatabaseConnectors.jar;%BOBJ_JAVA_LIB%\CrystalReportingCommon.jar;%BOBJ_JAVA_LIB%\CrystalFormulas.jar;%BOBJ_JAVA_LIB%\CrystalQueryEngine.jar;%BOBJ_JAVA_LIB%\CrystalReportEngine.jar;%BOBJ_JAVA_LIB%\keycodeDecoder.jar;%BOBJ_JAVA_LIB%\MetafileRenderer.jar;%BOBJ_JAVA_LIB%\rpoifs.jar;%BOBJ_JAVA_LIB%\jrcerom.jar;%BOBJ_JAVA_LIB%\jrcadapter.jar;%BOBJ_JAVA_LIB%\rascore.jar;%BOBJ_JAVA_LIB%\rasapp.jar;%BOBJ_JAVA_LIB%\Serialization.jar;%BOBJ_JAVA_LIB%\external\log4j.jar;%BOBJ_JAVA_LIB%\external\icu4j.jar;%BOBJ_JAVA_LIB%\external\Concurrent.jar;%BOBJ_JAVA_LIB%\external\xercesImpl.jar;%BOBJ_JAVA_LIB%\external\xml-apis.jar;%BOBJ_JAVA_LIB%\CrystalCharting.jar;%BOBJ_JAVA_LIB%\CrystalContentModels.jar;%BOBJ_JAVA_LIB%\CrystalExporters.jar;%BOBJ_JAVA_LIB%\CrystalExportingBase.jar;%CURRENT_DIR%;%CLASSPATH%
%_RUNJAVAC% -classpath "%CLASSPATH%" *.java
%_RUNJAVA% -classpath "%CLASSPATH%" HelloWorldSwing
// HelloWorldSwing is the name of your .java file
Make sure you have all the jar files in the lib directory.
Hope this helps you.
Thanks
Soni

Similar Messages

  • Apache Tomcat 7.0.4 can't recognize the classpath for .jar files

    Hiii Everybody,
    I have a weird problem. I am trying to develop a simple application where I am trying to pass an excel file name as an argument to a method and the method creates a copy of the specified file. I have used jxl.jar for excel file manipulation. During this I have faced two problems.......
    1) I tried to compile the file CopyExcel.java in the command prompt(windows), sometimes the file is not compiled and the error shown indicates that it can't recognize the package jxl. But if I close the command prompt window and open it again.... I could compile the CopyExcel.java succesfully with no error.
    2) Even if I have compiled the CopyExcell.java file successfully, whenever I am tryiyng to call a method copyMain() inside it, browser shows....
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: jxl/Workbook
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    root cause
    java.lang.ClassNotFoundException: jxl.Workbook
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.4 logs.
    --------------------------------------------------------------------------------The code for CopyExcel.java is as folows.............
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Administrator
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.File;
    import java.io.IOException;
    import jxl.Cell;
    //import jxl.CellType;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    import jxl.write.WritableWorkbook;
    public class CopyExcel {
         private String inputFile;
         public void setInputFile(String inputFile) {
              this.inputFile = inputFile;
         public void copy() throws IOException  {
              File inputWorkbook = new File(inputFile);
              Workbook w;
                    try{
                        System.out.println("Before w= Workbook.getWorkbook(inputWorkbook);  ");
              w= Workbook.getWorkbook(inputWorkbook);
                     System.out.println("After w= Workbook.getWorkbook(inputWorkbook);  ");
              WritableWorkbook copy=Workbook.createWorkbook(new File("CopyPan.xls"), w);
                    copy.write();
                    copy.close();
                    }catch(Exception e){}
    /*          try {
                   w = Workbook.getWorkbook(inputWorkbook);
                   // Get the first sheet
                   Sheet sheet = w.getSheet(0);
                   // Loop over first 10 column and lines
                        for (int i = 1; i < 6; i++) {
                             Cell cell = sheet.getCell(0, i);
                             //CellType type = cell.getType();
                             //if (cell.getType() == CellType.LABEL) {
                                  //System.out.println("I got a label "
                                       //     + cell.getContents());
                             //if (cell.getType() == CellType.NUMBER) {
                                  //System.out.println("I got a number "
                                            //+ cell.getContents());
                                                    System.out.println(cell.getContents());
              } catch (BiffException e) {
                   e.printStackTrace();
         public static  String copyMain(String args) throws IOException {
              String str=args;
              CopyExcel test = new CopyExcel();
              test.setInputFile(args);
              test.copy();
                    return "Success";
    }I have set the "CLASSPATH" environment variables in "user variables for administrator" as follows,
    .;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar Also I have tried editing the startup MS-dos batch file as folows....
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    set CLASSPATH=.;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar
    @echo off
    rem Licensed to the Apache Software Foundation (ASF) under one or more
    rem contributor license agreements.  See the NOTICE file distributed with
    rem this work for additional information regarding copyright ownership.
    rem The ASF licenses thi..........But the problem remained...........
    Plz. help me.
    Thank u in advance for any help.

    Hiii Everybody,
    I have a weird problem. I am trying to develop a simple application where I am trying to pass an excel file name as an argument to a method and the method creates a copy of the specified file. I have used jxl.jar for excel file manipulation. During this I have faced two problems.......
    1) I tried to compile the file CopyExcel.java in the command prompt(windows), sometimes the file is not compiled and the error shown indicates that it can't recognize the package jxl. But if I close the command prompt window and open it again.... I could compile the CopyExcel.java succesfully with no error.
    2) Even if I have compiled the CopyExcell.java file successfully, whenever I am tryiyng to call a method copyMain() inside it, browser shows....
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: jxl/Workbook
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    root cause
    java.lang.ClassNotFoundException: jxl.Workbook
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         CopyExcel.copy(CopyExcel.java:39)
         CopyExcel.copyMain(CopyExcel.java:81)
         ServicePage.processRequest(ServicePage.java:28)
         ServicePage.doPost(ServicePage.java:73)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.4 logs.
    --------------------------------------------------------------------------------The code for CopyExcel.java is as folows.............
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Administrator
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.File;
    import java.io.IOException;
    import jxl.Cell;
    //import jxl.CellType;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    import jxl.write.WritableWorkbook;
    public class CopyExcel {
         private String inputFile;
         public void setInputFile(String inputFile) {
              this.inputFile = inputFile;
         public void copy() throws IOException  {
              File inputWorkbook = new File(inputFile);
              Workbook w;
                    try{
                        System.out.println("Before w= Workbook.getWorkbook(inputWorkbook);  ");
              w= Workbook.getWorkbook(inputWorkbook);
                     System.out.println("After w= Workbook.getWorkbook(inputWorkbook);  ");
              WritableWorkbook copy=Workbook.createWorkbook(new File("CopyPan.xls"), w);
                    copy.write();
                    copy.close();
                    }catch(Exception e){}
    /*          try {
                   w = Workbook.getWorkbook(inputWorkbook);
                   // Get the first sheet
                   Sheet sheet = w.getSheet(0);
                   // Loop over first 10 column and lines
                        for (int i = 1; i < 6; i++) {
                             Cell cell = sheet.getCell(0, i);
                             //CellType type = cell.getType();
                             //if (cell.getType() == CellType.LABEL) {
                                  //System.out.println("I got a label "
                                       //     + cell.getContents());
                             //if (cell.getType() == CellType.NUMBER) {
                                  //System.out.println("I got a number "
                                            //+ cell.getContents());
                                                    System.out.println(cell.getContents());
              } catch (BiffException e) {
                   e.printStackTrace();
         public static  String copyMain(String args) throws IOException {
              String str=args;
              CopyExcel test = new CopyExcel();
              test.setInputFile(args);
              test.copy();
                    return "Success";
    }I have set the "CLASSPATH" environment variables in "user variables for administrator" as follows,
    .;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar Also I have tried editing the startup MS-dos batch file as folows....
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
    set CLASSPATH=.;%SYSTEM%;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\bin;C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.4\lib\servlet-api.jar;C:\Program Files\Java\jdk1.6.0_11\lib\jxl-2.6.jar
    @echo off
    rem Licensed to the Apache Software Foundation (ASF) under one or more
    rem contributor license agreements.  See the NOTICE file distributed with
    rem this work for additional information regarding copyright ownership.
    rem The ASF licenses thi..........But the problem remained...........
    Plz. help me.
    Thank u in advance for any help.

  • When to use CLASSPATH for .jar files

    I find I must put newly added .jar files in my classpath in order to avoid "does not exist" errors when I compile. Where should .jar files be placed in order to avoid hardcoding this in my classpath?

    Actually. With this .jar file (ksoap-midp.jar) which I downloaded, I can't resolve the imports even when I put the .jar in my classpath. What are the steps to take to add new classes to your system?

  • Custom certificates for JAR file signing

    Hi,
    Can anyone please let me know how to check that we have custom certificates for JAR file signing set up in our instance
    Thanks,
    Praveen

    It depends on the version of your $ADJVAPRG. See the referenced note.
    How to use,create and /or update Digital Certificates for Jinitiator in 11i Applications
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365735.1

  • Looking for JAR files for AQ JMS

    Hello all,
    I installed Oracle 9i 9.2.0.1 and trying to run a
    JMS Sample that uses JMS oracle.jms.AQjmsQueueConnectionFactory
    and oracle.jms.AQjmsSession. My questions which jar
    files should be included in the CLASSPATH.
    thanks

    The jar file you need is called aqapi.jar.

  • Classpath in JAR file

    I have packed my stand alone app, which is using JAVA Mail API in one JAR file (myapp.jar).
    Since JAVA Mail requires 2 seperate jar files, I created a lib dir within the jar that contains all required jar files.
    How do I add the lib directory inside the jar to my classpath ?
    Just adding myapp.jar to the classpath is not enough.
    I also tried to put Class-Path into my Manifest.mf file inside the jar
    which did not help. What dir does the manifest.mf file go inside the jar ? How would my Class-Path value have to look ? Maybe I did something wrong there ? Or is the whole thing just not possible and I have to deliver all other jar files seperate :(((((((

    Yes that is exactly how it looks. And if it looks like
    that, the
    lib dir has to be outside the jar file. The '.' is the
    same dir as the jar dir. Was your reply a guess or did
    you actually manage to do something like that ?I thought I had this working myself. After many iterations, I was able to run the jar files I was creating. Right after I figured it all out, your querry came up.
    But, just last night, I realized something was wrong. I tested this structure on both machines I write code on (one Linux, one Win2k) and it worked on both. Finally, I wanted to test on my 'depolyment' machine, a Win2k laptop I rarely write code with, and nothing workded. I was getting the same classdef not found errors you were.
    I finally realized, as you mention, it worked on my other machines because the "lib/some.jar" structure existed on the disk. Thus, the jar files were in the larger one, but those weren't being used. Argh. Of course the laptop doesn't have those jars somewhere else. So nothing worked.
    Guess this was a case of the blind leading the blind. Sorry! I've had to resort to putting out both jars and doing some rearranging of internal packages to get everything to work from a jar file. I need to have all this done for a trade show next week (Java on Wall Street, anyone?), so it works 'well-enough' right now. Hopefully I'll get back to this and find the proper solution after the show.

  • How to create service in Windows XP for jar file?

    Dear friends,
    I'm having an jar file in my Windows XP OS. I would like to create new service Windows XP to run this jar file. When i start the service then the jar file to be executed.
    I did search in google but i didn't get any proper solution for this.
    Could anyone please tell me the best and easiest way to create service for my jar in Windows XP os.
    Thanks in advance,
    Sathish

    Hi Chennail123,
    Just have a read : [*Converting Your Java App into a Windows Service*|http://www.devx.com/Java/Article/34438].

  • Maximum size for JAR files on Nokia 3120 Classic

    I am trying to download and install a java app for a Nokia 3120 classic, but when installing I get an error message telling me that the file is too big at 5.7mb.
    I can't find the maximum size of .jar files for this phone anywhere.
    Can anyone let me know what this is and whether there is any way to get the app to work.
    Many thanks.
    Alan Watson

    YES THERE IS A WAY!! I only got this information from someone else. Thanks for that person.
    Here are the steps:
    1. Download the jar file you want to install, to your computer. Now open My computer, and on the upper left corner you shall see a menu, click the "Tools" button and then click "Folder options..." A little window will appear. Click the "View" tab. On this window you need to find an option "Hide extentions for known file types" below "Advanced settings". Then unmark or uncheck the box.
    2. Now when you open my computer and go to the folder where you had downloaded the java file, the file name will read "(anyfilename).jar". HERE IS THE TRICK.
    3. Rename the last part of your file. Instead of .jar change it to .jpg so that it reads  "(anyfilename).jpg"
    4. Now copy the renamed file and paste it in your mobile's C: or Memory Card drive.
    5. Once you had pasted, rename the copied file back to what it was. i.e "(anyfilename).jar"
    BASICALLY the phone limits a file with a ".jar" extention, you can fool it by renaming the extention to ".jpg" and then once the file is copied into the phones C:drive you can change the extention back to ".jar" by renaming it.
    Share it. Hope it works for you! God bless...
    Only One Life Twill Soon Be Past.
    Only What's Done For Christ Will Last.

  • Manifest for jar file

    hi i create an jar file
    Manifest-Version: 1.0
    Main-Class: com.IR.IRoom
    Class-Path: classes12.jar aqapill.jar aqapi.jar aqapi60.jar art.jar arutil60.jar atli2.jar atli2_ip.jar atli2_ip_cio.jar bsh.jar codeset.jar commons.jar commons_httpclient.jar commons-lang-1.0.jar commons-logging.jar commons-net-1.1.0.jar
    i have two question now.
    when i jar this it give me error "line too long " bcz i have some more jars in it.
    second could i mention any folder which have jars file in classpath
    like Class-Path:include/*.jar
    regards

    Have you seen this recent thread: http://forum.java.sun.com/thread.jspa?threadID=689987&tstart=0
    There is a limit of 72 bytes (not chars!) per line in a manifest. YMMV, but you should be using Ant.

  • Icon for Jar File?

    Is it possible to include an Icon in a Jar file
    that will be displayed for the jar file instead
    of a default Icon give to it by Windows 2000? If
    so, how is it done?
    Thanks

    no it's not possible as the JAR file does not know anything about the operating system. this is windows dependend. if you want a custom icon for one jar file, create a shortcut to the jar and adjust the icon of this shortcut.

  • Classpath and jar file question

    my application need to use few jar files i downloaded from the internet
    so i need to set the classpath so that i can import the packages in the jar file rite?
    let say set classpath=.;c:\somedir\bin;
    the ".;" after the "=" means that i search the current directory first then search the directory i have specified after that rite?
    if so, can i put all the needed jar files in the current directory so that my application can use them??
    Another question is if all the jar files in located in the same directory how can i set the class path to refer to them without sepecifying each of the jar file name??can i just put the directory path and will it locate them automatically when my application start??
    can anyone tell me about it??thanks

    No, you need to include each and every jar file in your classpath.
    Or put them all in your <jdk_installation_dir>\jre\lib\ext directory, so that they will get included in your classpath automatically.
    Sudha

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC&#178;

  • Classpath and jar file

    Hy,
    I have written an application that uses the javax.comm package.
    My application contains many classes disposed in \classes directory.
    The main class is admin.class.
    If launch the application with a batch file (in Windows):
    echo off
    cls
    java -classpath c:\hy\classes;C:\jdk1.3.1_02\lib\comm.jar admin
    All works fine.
    if I insert the classes of the application in a jar file, hyper.jar (in the manifest file I write "Main-Class: admin"), and if I launch the application with another batch file:
    echo off
    cls
    java -classpath C:\jdk1.3.1_02\lib\comm.jar -jar hyper.jar
    The application starts, but the interpreter java says to me:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/SerialPortEventListener
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at hyper.loadModuli_comm(hyper.java:142)
    at hyper.setStatus(hyper.java:63)
    at admin.main(admin.java:205)
    why, the interpreter java, can't it found javax.comm package?
    thanks.

    Hy,
    I tried to set class-path key in manifest file, but the application doesn't start, and the interpreter java doesn't find admin.class... I believe that I set class-path in incorrect way.
    I write:
    Class-Path: C:\jdk1.3.1_02\lib\comm.jar
    is it ok?
    thanks.

  • Need some information for jar files upload in Oracle

    Hi,
    I am developing some java stored procedures which requires uploading about 10-15 jar files or may be more, to the oracle database. One way is to use loadjava and oracle stores classes in those jar files as separate java classes. Is there a way that I can put these jar files somewhere in the file systems, configure some oracle parameter, restart the database and still I am able to use them from my java stored procedures. This will be some kind of a dropin folder for jars. Any information on this will be helpfule.
    Thanks

    The forum on the JVM in Oracle at Java in the Oracle Database might be a better one to answer your question.
    Melli

  • Class Loader for Jar Files

    I have a set of Jar files which i need to load using Custom Class Loader. Any one who has Javacode for Custom Class Loader for loading Jar files send it. The Jar files are local jar files.

    Here is the class loader I use:
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.net.JarURLConnection;
    import java.lang.reflect.Method;
    import java.lang.reflect.Modifier;
    import java.lang.reflect.InvocationTargetException;
    import java.util.jar.Attributes;
    import java.io.IOException;
    * A class loader for loading jar files, both local and remote.
    public class JarClassLoader extends URLClassLoader {
        private URL url;
        private URL[] m_urlList = new URL[10];
         * Creates a new JarClassLoader for the specified url.
         * @param url the url of the jar file
        public JarClassLoader(URL url,ClassLoader cl) {
             super(new URL[] { url },cl);
          this.url = url;
        public JarClassLoader(URL[] urlList,ClassLoader cl) {
             super( urlList,cl);
          this.m_urlList = urlList;
         * Returns the name of the jar file main class, or null if
         * no "Main-Class" manifest attributes was defined.
        public String getMainClassName() throws IOException {
          URL u = new URL("jar", "", url + "!/");
             JarURLConnection uc = (JarURLConnection)u.openConnection();
             Attributes attr = uc.getMainAttributes();
             return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
         * Invokes the application in this jar file given the name of the
         * main class and an array of arguments. The class must define a
         * static method "main" which takes an array of String arguemtns
         * and is of return type "void".
         * @param name the name of the main class
         * @param args the arguments for the application
         * @exception ClassNotFoundException if the specified class could not
         *            be found
         * @exception NoSuchMethodException if the specified class does not
         *            contain a "main" method
         * @exception InvocationTargetException if the application raised an
         *            exception
         public void invokeClass(String name, String[] args) throws ClassNotFoundException,
                NoSuchMethodException,
                InvocationTargetException
             Class c = loadClass(name);
             Method m = c.getMethod("main", new Class[] { args.getClass() });
             m.setAccessible(true);
             int mods = m.getModifiers();
             if (m.getReturnType() != void.class || !Modifier.isStatic(mods) || !Modifier.isPublic(mods)) {
             throw new NoSuchMethodException("main");
             try {
               m.invoke(null, new Object[] { args });
             } catch (IllegalAccessException e) {
             // This should not happen, as we have disabled access checks
    }

Maybe you are looking for

  • How to fix the mouse and keyboard freezing when installing Windows 7 on 27' iMac late 2013?

    Hi, I have a question for u guys who can solve this. I recently bought the new 27' iMac late 2013, and I installed some softwares and used it for few days. Before I bought this I used the 15' Macbook Pro Retina, I installed Windows 7 Home Premium 64

  • No sound through HDMI

    I just bought myself a new Mini DisplayPort to HDMI, because the old one was broken. So I have used a HDMI cable before, and everything went fine. But this one isn't working and I have tried everything. I've looked at my audio settings, and everythin

  • How to Monitor IDOC Adapter

    Hi Frnds, How to monitor IDOC adapter. Its resides in Integration Engine. Regards, Raj

  • Reader 9 has a bug, Reader X is a step backward.

    I upgraded to X because the latest reader 9 wasn't highlighting search / find terms consistently. Now with X, not only does it superficially look like a older version of reader, the toolbar customization is difficult, limited, and the search / find b

  • Floating divs

    Hey TLF team, Do you have any immediate plans to implement floating blocks instead of just floating images?  I am currently implementing a stop-gap measure that splits the input up into multiple blocks, renders each to a different textflow, then lays