JAVA Application speed using JARs

Good day guys,
I have a quick question about the perfomance.
When I write Java application that uses other third party JARs, do I have to remove all the
classes from those jars that I dont use to make application run faster or it does not metter?
Thank you very much

Ajaxian wrote:
Good day guys,
I have a quick question about the perfomance.
When I write Java application that uses other third party JARs, do I have to remove all the
classes from those jars that I dont use to make application run faster or it does not metter?
Thank you very muchLet's take that to another level. Suppose this is on Windows, and that none of the apps running on it will ever use some DLL(s) or some APIs in those DLLs, which are already installed on the box. Do you really think you should worry about trimming them down?
And surely none of the java specific apps you will write will use ALL of the classes and methods in the whole java library, so should you whack those too?

Similar Messages

  • How to call a java application in a jar which is in a war file of a ear ?

    So sorry to cross post, but no response in other topics.....
    Please help!
    I have a Ear file which contains a war file.
    xx.ear/META-INF
    xx.ear/YY.war
    and the YY.war has the following structure:
    YY.war/META-INF
    YY.war/WEB-INF
    YY.war/WEB-INF/classes
    YY.war/WEB-INF/classes/com/
    YY.war/WEB-INF/classes/com/mycompany/
    YY.war/WEB-INF/classes/com/mycompany/MyClass.class
    MyClass.class is a java application which has a main method.
    how can I call this MyClass applicaiton from the xx.ear??
    java -???? com.mycompany.MyClass ??
    Please help because I have a Unix cron job need to access this class externally outside AppServer. Thx!!

    an ear file is a standard jar with a different extension. You may
    be able to get away with just adding a manifest file to it that
    specifies the main class (make it an executable jar with a different
    extension).
    I don't know if this will handle the nested war file though. It may.
    matfud

  • Load sound in java application without use of newAudioClip api.

    In personal java 1.2, (JDK1.1.8), the method newAudioClip is unavailable to load sound. What other api can one use to load sound into the java application in this case?

    there's nothing wrong with the old one, except that it's a api of the applet. If you try to run the applet thru' the java app. (without the browser or applet viewer), the getaudioclip api will fail.
    This is the limitation I am facing, 'cos I am developing in Personal Java1.2 env.

  • How to make an standalone java application that uses mysql driver

    Hi,
    I have an application that makes connection to a mysql database, on my computer, I set on classpath the driver address, so everithing works fine.
    The problem is that I want to execute my application from other computers, where the classpath does not have the drivers.
    So my question is how can I package the driver? so, everybody can run my application from a Jar, for example.
    thanks in advance,
    - Susana

    Nobody answered me, but I post the solution I found, that maybe can help somebody else with this problem:
    I packed all my application sources (.class) and the drivers sources (.jar) with the tool: FAT JAR. It is an Eclipse plug-in. And now I can run mi application from the resulting Jar in other machines without installing the conector.
    Bye,
    - Susana

  • Java application built using cr4e(clipse) fails to work in some Windows OSs

    I created a variation of the SampleViewerFrameClient, leveraging the opportunity to automatically refresh (refreshReport()) a Crystal report.  This worked in Windows 2007, but fails to work in Windows 2008 and 2003 (in a couple of ways).
    One theWindows 8 system with Crystal Reports installed, the viewer frame deploys displaying the report selection window, but after selecting and opening a Crystal report, it presents the following error window:
    Problem Showing Report
    Error Code: -2147467259
    This Windows 8 system happens to have both Crystal Reports 2013 and Crystal Reports for Enterprise 4 installed.  Java version JDK 7u55.
    On the Windows 2003 system,  without any Crystal Reports installation, running Java JRE 1.6, it fails with an exception:
    unsupported class version error (major.minor 51.0): SampleViewerFrameClient.
    It runs fine from eclipse on the Windows 2008 system.
    Thanks!

    Fixed the unsupported version error (by compiling with appropriate java compiler in Eclipse), and the report launch error in the viewer was resolved as well.

  • My Java application quits immediately ...

    I've written a Java application and used Jar Bundler to create a .app version.
    On my Mac Pro it works perfectly but when I copy it over to my laptop, it quits immediately when I attempt to run it.
    I assume this is a simple permissions problem so I tried to 'chmod +x myapp.app' but it didn't seem to help.
    Does anyone know why it behaves like this? I've ran out of ideas.
    (Both machines are setup identically.)

    Right, I've finally got to the bottom of this.
    I tried many things, 32/64-bit execution alongside different Java versions & they all produced the same result.
    I delved further down the permissions route and found this to be the key. The command 'chmod +x myapp.app' didn't work because the .app is really a directory and therefore the system didn't set any permissions.
    I ran the command recursively over the .app and this allowed it to be executed.
    'chmod -R +x myapp.app'
    So, I'm trying to setup a portable build system which will (eventually) span across 4 or 5 Macs - how do I get each system to 'remember' the permissions? How come other .app's don't suffer from this permission requirement? Is there a simple solution for me?
    Thanks.

  • How can i built a java application using java debug class on Log4J

    Hi,
    As java API support the MethodEntryEvent, using which I can get the automatic logging statements when the method is entered or exited as HelloExample.main(with argument type).
    Where HelloExample is the class name.
    Main is the method entered with its argument types.
    In some cases I have the o/p as
    -- VM Started --
    ====== main ======
    main -- HelloExample
    callerMethod -- HelloExample
    ====== main end ======
    -- The application exited --
    By using Log4J is there any possibility of getting these sort of o/p along with the loggers supported by Log4J. i mean to say can i built an java application which supports the MethodEntryEvent and MethodExitEvent from java API and also uses the Log4J debugging. I took an e.g. trace example, which (in J2SE 1.4.x or 5.x) will be found in $JAVA_HOME/demo/jpda/examples.jar and unpacking it by
    jar -xvf $JAVA_HOME/demo/jpda/examples.jar i found the com/sun/tools/example/trace/Trace.java and passed the class constructed with logger taken from Log4J. In this case the logging message is displayed on the console. As per the requirement i need to transfer the whole o/p to an output file along with Log4J logger statements. in this case i should not give any command in the cosule except compiling and executing the programme. the programm also should able to run without the main() as i need to integrate Log4J with an application and the code must me application server independent. i need the output as i got using MethodEnteryEvent (shown as above) in case of java application built using Log4J.
    Can any one help me in this regard. can any one give me some suggestion or any programme of this sort. All suggestions are welcomed.
    Thanks & Regards,

    hi,
    can someone help me how to implement logging for method entry parameters and
    method exit return value.
    can someone help me how to use log4j and integrate it to the method entry
    logging and method exit logging.
    Here what i need is without writing the log statements for the method entry and
    method exit i need to log it to the file
    along with other log4j debug statements i provide in the file.I should be able
    to configure whether to enable/disable the logging
    for method entry and method exit. In method entry i should be able to log the
    parameters the method take and in method exit
    i should be able to log te return value to the log file, before the method is
    returned to the callee.
    i hope i am clear
    Thanks in advance.

  • Can i develope a java application using C API

    hai,
    i have C api, the project was developed in C before, now i am having that api. I have to do that in java by using that C api.
    can any one suggest me how to do this?

    Your question is not that very clear!! You want to convert the C api to a Java api? or you want to develop a Java application that uses the C api?
    For the first question I believe that you should check the functionality of the C api and re-code it in Java! do not believe you should find anything imposible in that! (unless that api is trying to do something crzy directly with memory)
    For the second question then I believe you will have to use native calling or something like that. I have never used it, but read about it, and it seems one way how Java can interect with C.
    Over here there is a forum.
    Regards,
    Sim085

  • HOW TO USE KRYSALIS BARCODE AS A JAVA APPLICATION

    HI
    I HAVE DOWNLOADED THE KRYSALIS FREE BARCODE GENERATOR. IN SAMPLE CODES THEY HAVE USED THAT AS AN APPLET. BUT I WANT TO GENERATE THE BARCODES USING JAVA APPLICATION WHILE USING KRYSALIS LOG4J LIBRARY...
    SOMEONE PLEASE HELP ME OUT.
    THANKS
    PIYUSH

    You caps lock is on!

  • IE11 compatibility of application developed using webdynpro java in NWDS7.01.12

    Hi,
    I have a webdynpro java application developed using NWDS 7.01.12 with jdk1.4. This portal application is not working when accessed using IE11 browser. The action on buttons and selection from a drop down list in this application is not responding in IE11. Its working well with mozila fire fox vrs 31. On click of action the following error is encountered:
    SCRIPT438: Object doesn't support property or method 'attachEvent'
    File: sapUrMapi_ie6.js, Line: 683, Column: 7
    which points to the below piece of code:
    function sapUrMapi_initLinkStatus() {
      var oNodes = document.getElementsByTagName("A");
      for (var n=0;n<oNodes.length;n++) {
        if (oNodes[n].href.indexOf("javascript:void")>-1) {
          oNodes[n].attachEvent("onmouseover",sapUrMapi_resetStatus);
          oNodes[n].attachEvent("onfocus",sapUrMapi_resetStatus);
    Also on selection from the combo box the below error is displayed.
    SCRIPT438: Object doesn't support property or method 'createEventObject'
    File: sapUrMapi_ie6.js, Line: 2193, Column: 2
    Code:
    oComboBoxSCEvent = document.createEventObject( oEvt);
    The above mentioned errors are being pointed to sapUrMapi_ie6.js file.
    Is there any solution to over come these issues other than setting "user agent string" value in the browser?
    Can this be resolved with any changes in the application or is there any SAP provided solution?
    Please help me to resolve this issue.
    Similar issues are also pointed to popup_ie6.js files at "window.attachEvent("onload",sapPopup_init)" and
    "window.document.attachEvent("onmousemove",resetMouseOver)".
    Thankyou.

    Hi Karthika,
    It is mentioned in Ervin's famous doc, that NWDS version must match that of RunTime System.
    NWDI vs. NWDI content
    I thought the NWDS must be updated via update sites, but surprisingly I could find the patch in service market place.
    I do not know how to get the download link directly for you.
    Perhaps you can spare a few seconds and navigate to
    http://service.sap.com/swdc
    Support Packages and Patches
    A-Z Index
    N
    SAP NetWeaver
    EHP1 for NetWeaver 7.0
    Entry by Comopnent
    Developer Studio
    BR, Tom

  • Reducing memory use in large Java application

    Hello,
    I've read through many of the threads on memory optimization in Java and am still puzzled about one thing:
    I've got a large Java application that uses around 45,000 kb of memory (according to the Windows Task Manager) when it first starts up. If I reduce the program window and then restore it, the memory use comes down to about 25,000 kb, and stays down, even when the program is in regular use.
    Two questions about this:
    1) Why does reducing and restoring the program have this effect?
    2) Is there any way I can duplicate this effect automatically, so that the program starts off using the smaller amount of memory?
    And a final question: does anyone have any recommendations regarding the several commercial products that are available for optimizing memory use in Java apps?
    Many thanks!
    David Porter

    this effect (minimize application window, rsize it again) is not a Java but a Windows problem. It also works for pure WIndows applications - try it out!
    reducing memory size is not a question of 3rd party java apps or APIS but the JVM and the coding style of the application programmer.

  • Multi-threaded java application and deadlock down in Oracle library

    Hello,
    I was running our Java (JDK 1.6_14) application from Windows XP hitting an Oracle (10g) instance on Linux and came across a deadlock issue with two (of 10) threads. Below is the stacktraces (based on Java thread-dump at the command line). This code I've run 30-40 times with no problems of deadlocks.
    The Oracle library that we're using for our Java application is ojdbc14.jar and sdoapi.jar (for spatial).
    We create our Connection as follows (for each thread -- 10 of them):
    public class Worker implements Runnable
    private Connection _Conn;
    public Worker(...)
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    _Conn = DriverManager.getConnection(url, username, password);
    _Conn.setAutoCommit(false);
    The code that is already executing these same lines below was already executed by other threads (in their own instance of Worker). So this is very confusing.
    Any ideas? Version of the .jar files? Place how we're calling "DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());"?
    Thanks, Jim
    Found one Java-level deadlock:
    =============================
    "WORKER_1":
    waiting to lock monitor 0x02b50d8c (object 0x22e8af80, a oracle.jdbc.driver.T4CConnection),
    which is held by "WORKER_0"
    "WORKER_0":
    waiting to lock monitor 0x02b50d24 (object 0x22f6d258, a oracle.sql.StructDescriptor),
    which is held by "WORKER_1"
    Java stack information for the threads listed above:
    ===================================================
    "WORKER_1":
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3410)
    - waiting to lock <0x22e8af80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:1516)
    - locked <0x22f6d258> (a oracle.sql.StructDescriptor)
    - locked <0x22eabd80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:1408)
    at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:892)
    at oracle.sql.STRUCT.<init>(STRUCT.java:148)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:2954)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:3777)
    .......... <our package/class>
    "WORKER_0":
    at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:1494)
    - waiting to lock <0x22f6d258> (a oracle.sql.StructDescriptor)
    - locked <0x22e8af80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:1408)
    at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:892)
    at oracle.sql.STRUCT.<init>(STRUCT.java:148)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:2954)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:3777)
    ..........<our package/class>
    Edited by: Jim Atharris on Aug 24, 2009 6:23 PM

    Thanks Toon for your reply.
    Yes each Worker (executing in their own thread) has their own instance of Connection as per the Constructor (shown in original post). That is why this is weird.
    I'll check the v$session when I get into work.
    Based on our code that I put in the original email, Connection is a non-static variable. We have a per Thread per instance of Worker of which that Worker instance has its own instance of Connection. So I'm wonder if the following needs to occur:
    Both of these lines (from original email) need to happen in the main thread as follows:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    for (i=0;i<NUM_OF_WORKERS)
    _Conn = DriverManager.getConnection(url, username, password);
    new Worker(_Conn);
    Thanks,Jim

  • Auto print out report for java application

    <p>Hi, </p><p>Now i&#39;m using eclipse 3.2 to develop a java application and using crystal report to create report.</p><p>I would like to directly printing out the report from the java application.</p><p>what the installer or plugin i need?</p><p>What the setting i need to set? </p><p>Can you give me the sample coding to directly print out the report from java application by passing parameter?</p><p>Thanks,</p><p>Hui Bee</p>

    There is a Consulting Solution called BOInterface that Business Objects Global Services sells and that helps you to achieve what you describe very easily.
    A description is <a href="http://www.mnsoft.org/bointerface0.0.html">here</a>.
    Particularly, see the <a href="http://www.mnsoft.org/boxinterfacedocs/com/bo/boxinterface/boreport/scheduler/BOReportSchedulerPrinter.html">BOReportSchedulerPrinter</a>. BOInterface comes with a complete example on scheduling to printer; that example can even itself be scheduled.
    Contact me via direct email for more information if this is interesting for you.
    HTH,
    M
    Matthias Nott -  Business Objects
    Service Line Leader Products EMEA
    [email protected]

  • Cannot open MSWord while running java application

    Hi everyone
    I'm not sure if anyone has encountered this problem before.. I'm running a java application under Windows NT and when I try to open an office document it won't run until that java application has been shutdown. I don't even get an error message for this. Nothing happens at all until the application is shutdown and then MSWord just opens as if nothing had ever happened.
    Anyone have any ideas as to what this problem might be?

    As a guess.....
    1. Run a "hello world" java application. Use task manager and take a snap shot of the processes window.
    2. Run nothing else but the java application. Use task manager and take a snap shot of the processes window.
    3. Compare the two and eliminate any that are the same.
    4. Run nothing else but word. Use task manager and take a snap shot of the processes window.
    5. Compare it with 3. Note the ones that appear both times.
    6. Run the java application - use task manager to kill what you found in 5. Run word.
    Step 6 will probably cause the java app to fail in some odd way. But now you know why it doesn't work.
    Of course if nothing is the same in 5 above then that would be odd.

  • What should be done in certmap.conf for 2-way SSL support from a standalone Java application to an SSL enabled LDAP Server

    To support certficate based client authentication using 2-way SSL from a standalone java application which uses JNDI and JSSE1.0.2 to connect to an SSL enabled LDAP Server how do we configure the certmap.conf?Is there any additional setup required at the LDAP Server side apart from enablinf SSL with the option"Required Client Authentication" enabled.The 2 way SSL handshake goes through but the access log file (After configuring the certmap.conf for the issuer DN of the client certficate etc..)shows SSL failed to LDAP DN?But inspite of this access log error the Java client does get an SSL Connection object with which it is able to connect to the LDAP.IS the certmap.conf file being looked up by the LDAP Server at all?

    have you out.flush() and out.close() before you call connection.getInputStream()?

Maybe you are looking for

  • Updates are not downloading on 4 Gen iPad

    Is anyone having trouble downloading app updates? I had no problem till about a week or so. Now when I go to the update screen, nothing happens. My wife also has a ipad and checked her update screen and she also has the same problem.

  • Prevent SO create in BAPI_SALESORDER_CREATEFROMDAT2 if pricing incomplete

    Am using BAPI_SALESORDER_CREATEFROMDAT2 to create sale order. I need to prevent the sales order from being created, if PR00 or like condition does not exist for any material. I have set the required parameters for incompletion procedure (PRSOK etc).

  • Problem with my keyReleased method in KeyListener

    Hey all, I heard this was the place for these kinds of questions. OK so a bit ago I created my own class KeyEventListener that implements KeyListener. I just recently got it to work and it does in fact get input from the keyboard. private class KeyEv

  • WIP on Repetitive Manufacturing

    Hi, I’ like to have your help for the following situation: I have the material VIDRO001 on plant IC created to be used in Repetitive Manufacturing. It has assigned a REM profile and a production version. For it, I created the material cost estimate.

  • ERROR MESSAGE: ## Unequal Stereo Regions Corrected

    "## Unequal Stereo Regions Corrected" ...where ## is a number. In this case, "2 unequal stereo regions corrected". This is an old error message going back to Logic 3.x and I'm still at a loss as to why it occurs. Any ideas? Situation: just re-opened