Restart java application

Hi,
I am busy making a gui and I run in to a problem, because I have an option in the settings menu. The application is fullscreen and therefore we have an option in the settings menu made with radiobuttons to choose if you want the application to run in fullscreen mode of windowed mode. Now the thing is people always start the application in fullscreen even if they had chosen the windowed mode before. so when people select the windowed mode I would like to restart the application (onl this time NOT fullscreen).
Only my problem is that I dont know how I can restart the gui without doing it manualy. is there some code for restarting?

Why not have the radio buttons call methods, say
fullScreenButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
        if(fullScreenButton.isSelected())
            frame.dispose();
            new MyWindow.setMode(this.FULL_SCREEN_MODE);
});The main thing here is to atach an ID with the buttons. On clicking, dispose the frame and reload a new one with the new ID

Similar Messages

  • Restart java application by itself after a while

    Hi,
    I have a Java application that runs on a Time clock (Hand held device). This app. has to be up and run all the times 24/7. After few days the app goes to hung stage, where we need to restart it manually. Is there a way, I can code within the app. itself, that restarts every night or so ....
    Appreciate your helps.
    Thanks
    Sath

    tjacobs01,
    thanks for your response. i should withdraw the word (hand held). this is an external device but connected to the network (ethernet). Hence the app. is started via a shell script and the app. runs on the device. I will work on something with timer or look into the shell script to accomodate this ...

  • How to restart java application

    Hi ,
    I have an application which have some parameters ( These parameters are configured in APP )
    I want if the config values changes then our application should be restarted .
    How can I do it programmitically
    Thanks and regards
    Anshuman

    Let your program detect the changes and exit with a defined return code.
    If the running script detects the Java program's having stopped with this return code,
    it restarts the program.

  • How to restart Java Application from state when system crash

    I want to know about the API that provide mechanism to save your program state peroidically or any specific task completed of application and if system crash and next time when application restart it should be started from previous state.
    I required solution urgently plz. replay as soon as possible

    write it yourself.
    Serializable Interface, FileOutputStream, ObjectOutputStream ... that'd be a start for you.

  • Restart  MS windows by java application ?

    hi
    i need to help you.......
    how can i restart windows by java application?
    thanks

    execute the command "shutdown -r" with runtime.exec

  • My 2700c restarts when I open java applications

    My 2700c restarts when I open java applications. I can't play game or use opera mini.

    Hi tony1112,
    Thank you for your message and welcome to the forums!
    Please try these two things to resolve the problem:
    Reset your phone to "out of the box" state by dialling *#7370#, followed by your security code (the default code is 12345, unless you have changed it). It's highly recommended to back up your phone with Nokia Suite prior to this, as it will remove all data on your phone. After the reset, restore your phone with Nokia Suite (remember to untick settings) and reinstall the applications from my stuff folder on Nokia Store.
    Should this not resolve the issue, reinstall or update your phone software using Nokia Suite by selecting Tools > Software update. If the problem persists visit your local Nokia Care Point and let them have a look.
    Hope this helps,
    Puigchild
    If you find this post helpful, a click upon the white star at bottom would always be appreciated.
    If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users!

  • Problem while deploying a webdynpro java application in NWDS 7.1 version

    HI All,
            I got the below error when i deploying the  webdynpro java application in NWDS 7.1 version..help me out...........................................
    Exception:
    com.sap.ide.eclipse.deployer.api.APIException: ConnectionException,cause=[Ecc]
    NameNotFoundException.The SAP J2EE ENGINE service 'tcbldeploy_controller' is not available
    because of deployment or down engine( service ).
    Reason: Object not found in lookup of
    tcbldeploy_controller.
         at
    com.sap.ide.eclipse.deployer.dc.ComponentManagerImpl.getDeployProcessor(ComponentManagerImpl
    .java:64)
         at com.sap.ide.eclipse.sdm.threading.DCDeployThread.run(DCDeployThread.java:118)
    Caused by: com.sap.engine.services.dc.api.ConnectionException: [ERROR CODE DPL.DCAPI.1118]
    NameNotFoundException.The SAP J2EE ENGINE service 'tcbldeploy_controller' is not available
    because of deployment or down engine( service ).
    Reason: Object not found in lookup of
    tcbldeploy_controller.
         at
    com.sap.engine.services.dc.api.session.impl.SessionImpl.createCM(SessionImpl.java:320)
         at
    com.sap.engine.services.dc.api.deploy.impl.DeployProcessorImpl.<init>(DeployProcessorImpl.ja
    va:136)
         at
    com.sap.engine.services.dc.api.deploy.impl.DeployProcessorFactoryImpl.createDeployProcessor(
    DeployProcessorFactoryImpl.java:26)
         at
    com.sap.engine.services.dc.api.impl.ComponentManagerImpl.getDeployProcessor(ComponentManager
    Impl.java:46)
         at
    com.sap.ide.eclipse.deployer.dc.ComponentManagerImpl.getDeployProcessor(ComponentManagerImpl
    .java:58)
         ... 1 more
    Caused by: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object
    not found in lookup of tcbldeploy_controller.
         at
    com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:649)
         at
    com.sap.engine.services.jndi.implserver.ServerContextRedirectableImpl.lookup(ServerContextRe
    directableImpl.java:80)
         at
    com.sap.engine.services.jndi.implserver.ServerContextImplp4_Skel.dispatch(ServerContextImplp
    4_Skel.java:555)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200)
         at
    com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136
         at
    com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.pro
    cess(ApplicationSessionMessageListener.java:33)
         at
    com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

    First check is Java stack is running ?
    make sure J2EE_ADMIN user not locked.
    Ans please check password in secure area. check password in secure store should be correct.
    may be you can try with restart of SAP and DB.
    All the best
    regards
    nag

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • Debug a Web Dynpro Java Application.

    Hi All,
    I am trying to debug a Web Dynpro for java application, however I am getting this error whenever i try to do
    Failed to connect to remote VM. connection refused.
    I tried the following options that were suggested in few Threads
    1) I have the J2EE server running in Debug mode,
    2) I also ensured that there is no one else using the NWDS in debug mode
    3) I restarted the NWDS and the portal server several time.
    Are there any other suggestions apart from the ones mentioned above?
    the following thread talks about locking of port [link|NWDS: Debug: Failed to connect to remote VM. Connection refused.;. I doubt if that could be the issue.
    Can someone suggest how to identify the port is locked and how to unlock it?
    Thanks
    Bharath mohan B

    Hi Bharath,
    1) Check if you are following the procedure as mentioned at the following link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/849170e3-0601-0010-d59e-ddfce735fac5
    2) Please do check whether the Server Instance Debug Mode is "ON"
    You can check it from NWDS >J2EE Engine View>Server Instance>server0
    If its not then you need to change it and any Basis Team can help you.
    3) If it is running in the debug mode then please ensure that there is no one else debugging on the same server node. Generally there is only one instance configured for debugging. If someone is using the same server node instance for debugging then you might have to ask for closing that debug session to continue with your debugging.
    4) Check whether you are using the correct server for debugging. Most of the we make mistake while configuring the debug server
    5) Check this discussion:
    NWDS: Debug: Failed to connect to remote VM. Connection refused.
    Regards.
    Rajat

  • When deploying the webdynpro java application , showing error message

    Hi Masters,
    when deploying the webdynpro java application , showing error message. Please reply why this problem showing and what is the solution
    But Iogin to sdm tool ( remote gui .sh) with same password, which password  i am using for deploy the webdynpro java application.here in sdm tool i am able to login. and i restart the sdm , and again trying to deploy the same problem it showing.
    URL to deploy : file:/C:/DOCUME1/ppuser/LOCALS1/Temp/temp30925rupa.com~sales.ear
    Result
    => deployment aborted : file:/C:/DOCUME1/ppuser/LOCALS1/Temp/temp30925rupa.com~sales.ear
    Aborted: development component 'sales'/'rupa.com'/'LOKAL'/'0.2010.02.13.14.32.39':Caught exception during application deployment from SAP J2EE Engine's deploy API:com.sap.engine.deploy.manager.DeployManagerException: ERROR: Cannot connect to Host: [devsap] with user name: [J2EE_ADMIN]                     Check your login information.                     Exception is: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.services.security.exceptions.BaseLoginException: No login module succeeded.] (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).DMEXC)
    Deployment exception : The deployment of at least one item aborted
    Edited by: sujana mullapudi on Feb 13, 2010 2:52 PM

    Hi Sujana,
    For deploying Web Dynpro for Java application, J2EE_admin correct password must be stored in the scured area of config tool.
    Your error show that J2EE_admin information is not correct.
    So, Please ask your basis team to update new J2EE_ADMIN password or you can do it in scured area of config tool.
    Hope this will helps you.
    Thanks
    Arun Jaiswal

  • Patching/updating Java Applications in the WebLogic environment.

    Hi All,
    I'd like to get some feedback on our process and hear if there is some better/different
    ideas out there on how to handle patching/upgrading java applications in the WebLogic
    environment.
    Here is our process:
    1) We build using ANT our Enterprise application.
    2) We deploy our application using InstallAnywhere to drop the structure into
    an environment.
    If a patch or update is needed, we again build the Patch/Update using ANT, generating
    checksums for each file in every ear/war/jar file as well as any supporting files
    (.xml, .properties, .sh, etc.) used in the production structure. We then compare
    checksums against what is in production and come up with PATCH_(ear/war/jar) files
    with only the changed classes and duplicate production structure with the changed
    supporting files.
    Using ANT scripts and InstallAnywhere, we backup the files to be replaced in production,
    overwrite supporting files, extract packages (ear/war/jar), overwrite classes
    with new ones, re-package the ear/war/jar files into production environment and
    restart the server.
    We patch at a class level due to the configuration settings internal to the package
    files (ear/war/jar) that we don't want the customer to have to re-configure everytime
    we do a partial release.
    Right now, the whole process is automated except the creation of the Patch ANT
    script that extracts, overwrites updated classes, updates manifests, then re-packages.
    Any ideas on improvements or complete re-engineering of our process to help so
    we can get closer to 100% automation?
    Thanks,
    John

    The chances of two applications running at exactly the same time are miniscule. If they each have a connection to the database, and are both trying to modify the same table, then chances are one will be slightly after the other its changes would be committed last. In the case where one might delete a row just before another tries to access that row, you're going to have some sort of problem. However, those circumstances are pretty rare, and even so, some small amount of exception handling can deal with them gracefully.

  • Error while Restarting weblogic application server

    Hi,
    While Restarting weblogic application server (10.3 installed on linux) we are getting following error :
    <Aug 10, 2010 2:47:08 PM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>
    <Aug 10, 2010 2:47:08 PM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for CR376251 Wed Aug 06 09:19:34 PDT 2008
    WebLogic Server Temporary Patch for CR371247 Sat Aug 09 20:10:38 PDT 2008
    WebLogic Server Temporary Patch for CR377673 Tue Aug 12 20:39:50 EDT 2008
    WebLogic Server Temporary Patch for CR377673 Tue Aug 12 20:39:50 EDT 2008
    WebLogic Server Temporary Patch for CR376759 Thu Aug 14 14:53:02 PDT 2008
    WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967 >
    <Aug 10, 2010 2:47:11 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <Aug 10, 2010 2:47:11 PM IST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
    <Aug 10, 2010 2:47:12 PM IST> <Notice> <Log Management> <BEA-170019> <The server log file /usr/ebiz/bea/user_projects/domains/portal_dmz_domain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.>
    Exception in thread "VDE Transaction Processor Thread" java.lang.OutOfMemoryError: Java heap space
    at com.octetstring.vde.Entry.readBytes(Entry.java:506)
    at com.octetstring.vde.Entry.<init>(Entry.java:98)
    at com.octetstring.vde.backend.standard.TransactionProcessor.run(TransactionProcessor.java:234)
    <Aug 10, 2010 2:48:03 PM IST> <Error> <EmbeddedLDAP> <BEA-000000> <Error opening mapping file: /usr/ebiz/bea/user_projects/domains/portal_dmz_domain/servers/AdminServer/data/ldap/conf/mapping.cfg>
    <Aug 10, 2010 2:48:03 PM IST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.InternalError
    java.lang.InternalError
    at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:752)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    Truncated. see log file for complete stacktrace
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    at java.util.jar.JarFile.<init>(JarFile.java:133)
    at java.util.jar.JarFile.<init>(JarFile.java:70)
    at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:643)
    Truncated. see log file for complete stacktrace
    >
    <Aug 10, 2010 2:48:03 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
    <Aug 10, 2010 2:48:03 PM IST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
    <Aug 10, 2010 2:48:03 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
    x86_64 is not a supported Linux hardware platform for Autonomy.
    Please suggest. Its liitle urgent. Any help will be appriciated.
    Thanks and regards,
    Minal Bhatte

    May be all classes cant be loaded.
    Do you have any application which is deployed your manage server? If you say Yes:
    There are three ways:
    1)If Sun JVM is used, then add:
    set MEM_ARGS=-Xms1280m -Xmx1280m -XX:PermSize=128m -XX:MaxPermSize=256m
    *** -XX:PermSize and -XX:MaxPermSize should be equal and quarter of -Xmx. (-Xmx should also be equal to -Xms)
    If BEA JRockit JVM is used, then add:
    set MEM_ARGS=-Xms1280m -Xmx1280m
    2) If you still get that error, increase your real memory of system.
    3) For last choice, contact with your developer to tune your application.

  • The Sun Java Application Server 8.1 could not start anymore

    Very incredible I was working fine from may days with Stydio Creator 2
    but yesterday I run the project and it does not work anymore, please can you suggest something:
    The Sun Java Application Server 8.1 could not start.
    from the Output console:
    C:\Sun\Creator2\SunAppServer8\bin\asadmin.bat start-domain --domaindir C:\Sun\Creator2\SunAppServer8\domains\ creator
    Failed to start server localhost:4848
    Deployment error: Failed to start server localhost:4848. See the server log file for details.
    Exception=Deployment error: Failed to start server localhost:4848. See the server log file for details.
    Deployment error: Failed to start server localhost:4848. See the server log file for details.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:198)
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:75)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:242)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
    Caused by: Failed to start server localhost:4848
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:152)
    ... 10 more
    and in the log file:
    [#|2006-02-24T11:49:51.296+0100|WARNING|sun-appserver-pe8.1_02|
    javax.enterprise.system.core|_ThreadID=25;|CORE5061: Exception :
    com.sun.appserv.server.ServerLifecycleException: [C4073]: A JMS destination limit was reached.
    Too many Subscribers/Receivers for Queue :
    temporary_destination://queue/192.168.0.159/3376/2 user=admin, broker=127.0.0.1:27676(2403)
         at com.sun.enterprise.jms.JmsProviderLifecycle.onTermination(JmsProviderLifecycle.java:476)
         at com.sun.enterprise.server.ApplicationServer.onTermination(ApplicationServer.java:454)
         at com.sun.enterprise.server.Shutdown.startShutdown(Shutdown.java:42)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeShutdownEventListener(AdminEventMulticaster.java:1445)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.handleShutdownEvent(AdminEventMulticaster.java:1434)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:443)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
         at com.sun.enterprise.admin.server.core.channel.AdminChannelServer.sendNotification(AdminChannelServer.java:90)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:595)
    thanks

    I just had the same problem this morning. I believe the app server starts and if you browser directly to your app you'd get it, but the connection between the appserver and the IDE is somehow lost. An easier solution than completely reinstalling for me was to delete the .Creator folder in my home directory (C;|Documents and Setting\<username>\.Creator) and restart Creator

  • Slow starup of Java application - best practices for fine tuning JVM?

    We are having problems with a java application, which takes a long time to startup.
    In order to understand our question we better start with some background info. You will find the question(s) after that.
    Background:
    The setup is as follows:
    In a client-server solution we have a win xp, fat client running java 1.6.0.18.
    (Sun JRE). The fat client containt a lot of GUI, and connects to a server for DB access. Client machines are typical 1 to 3 years old (there are problems even on brand new machines). They have the client version of JRE - standard edition installed (Java SE 6 update 10 or better) Pretty much usual stuff so far.
    We have done a lot of profiling on the client code, and yes we have found parts of our own Java code that needs improving. we are all over this. Server side seems ok with good response times. So far, we havent found anything about shaky net connections or endless loops in the java client code or similiar.
    Still, things are not good. Starting the application takes a long time. too long.
    There are many complicating factors, but here is what we think we have observed:
    There is a problem with cold vs. varm starts of the application. Apparently, after a reboot of the client PC - things are really, really bad - and it takes (sometimes) up to 30-40 secs to start the application (until we arrive at the start GUI in our app).
    If we run our application, close it down, and then restart
    without rebooting, things are a lot better. It then usually takes
    something like 15 - 20 sec. which is "acceptable". Not good, but acceptable,
    Any ideas why?
    I have googled it, and some links seems to suggest that the reason could be disk cache. Where vital jar are already in disk cache on th warm start? Does that make any sense? Virus scanners presumable runs in both cases.
    People still think that 15 - 20 sec in start up on the warm start is an awful long time, even though there is a lot, a lot, of functionality in the application.
    We got a suggestion to use IBMs JRE - as it can do some tricks (not sure what) our SUN JRE cant do concerning the warm and cold start problem. But thats is not an option for us. And noone has come up with any really good suggestions with the SUN JRE so far?
    On the Java Quick Starter (JQS) -
    improves initial startup time for most java applets and applications.
    Which might be helpful? People on the internet seem more interested
    in uninstalling the thing than actually installing it though?
    And it seems very proprietary, where we cant give our Jar files to it?
    We could obviously try to "hide" the problem in some way and make it "seem" quicker. Where perceived performance can be just as good as actual performance. But it does seem a bad solution. So for the cold start we will probably try reading the jar files and thereby have them in disk cache before startup of our application. And see if that helps us.
    Still, ok the cold start is the real killer, but warm start isn't exactly wonderfull either.
    People have suggested that we read more on the JVM and performance.
    java.sun.com.javase/technologies/performance.jsp
    java.sun.com.docs/hotspot/gc5.0/gc_tuning_5.html
    the use of JVM flags "-Xms" "-Xmx" etc etc.
    And here comes the question .. da da ...
    Concerning various suggested reading material.
    it is very much appreciated - but we will like to ask people here - if it is possibe to get more specific pointers. to where the gold might be buried.
    I.e. in a an ideal world we would have time to read and understand all of these documents in depth. However, in this less than ideal world we are also doing a lot of very timeconsuming profiling in our own java code.
    E.g. java garbage collection is is a huge subject - and JVm settings also. Sure, in the end we will probably have to do this all very thoroughly. But for now we are hoping for some heuristics on what other people are doing when facing a problem like ours..?
    Young generation, large memory pages, garbage collection threads ect. all sounds interesting - but what would you start with?
    If you don't have info to decide - what kind of profiling would you be running and then adjust what JVM setting in your trials?
    In this pressed for time scenario. Ignorance is not bliss. But makes it hard to pinpoint the or those JVM parameters to adjust. So some good pointers from experienced JVM "configurators" will be much appreciated!
    Actually, If we can establish that finetuning of these parameters is a good idea, it will certainly also be much easier to allocate the time for doing so. - reading, experimenting etc. in our project.
    So, All in all , what kinds of performance improvements can we hope for? 5 out of 20 secs on the warm start? Or is it 10 % nitpicking? Whats the ball park figure for what we can hope to achieve here given our setup? What do you think based on above?
    Maybe someone out there have done some finetuning of JVM parameters in a similiar PC environments like, with similiar fat clients...? Finetuning so and so - gave 5 secs. So start your work with these one-two parameters?
    Something like that - some best practices? Thats what we are hoping for.
    best wishes
    -Simon

    Thanks for helpful answer from both you and kajbj.
    The app doesn't use shared network drives.
    What are you doing between main starts to get executed and the UI is
    displayed?
    Basicly, Calculating what to show in the UI. Accessing server - not so much, there are some reads from a cache, but the profiling doesnt indicate that it should be a problem. Sure, I could shift the startup time to some other slot, but sofar I havent found a place where the end-user wouldnt be annoyed.> Caching of something would seem most obvious. Normal VM stuff >seems unlikely. With profiling i basicly find that ''everything'' takes a lot longer in the cold start scenario. Some of our local java methods are going to be rewritten following our review. But what else can be tuned?You guys dont think the Java Quick Start approach, with more jars in disk cache will give something? And how should that be done/ what does people do?I.e. For the class loader I read something about
    1.Bootstrap class loader
    2.Extensions class loader
    3.System class loader
    and is wondering if this has something to do with the cold start problem?
    The extensions class loader loads the code in the extensions directories (<JAVA_HOME>/lib/ext
    So, we should move app classes to ext? Put them in one jar file? (We have many). Best practice about that?
    Otherwise it seems to me that it must be about finetuning the JVM?
    I imagine that it is a question about:
    1. the right heap size
    2. the right garbage collection scheme
    Googling heap size for XP
    CHE22 writes:
    You are right; -Xms1600M works well, but -Xms1700M bombs
    Thats one best practice or what?
    On garbage collection, there are numerous posts, and much "masters of Java black art" IMHO, And according to profiling GC is not really that much of a problem anyway? Still,
    Based on my description I was hoping for a short reply like "try setting these two parameters on your xp box, it worked for me" ...or something like that. With no takers on that one, I fear people are saying that there is nothing to be gained there?
    we read:
    [ -Xmx3800m -Xms3800m
    Configures a large Java heap to take advantage of the large memory system.
    -Xmn2g
    Configures a large heap for the young generation (which can be collected in parallel), again taking advantage of the large memory system. It helps prevent short lived objects from being prematurely promoted to the old generation, where garbage collection is more expensive.
    Unless you have problems with pauses, try granting as much memory as possible to the virtual machine. The default size (64MB) is often too small.
    Setting -Xms and -Xmx to the same value increases predictability by removing the most important sizing decision from the virtual machine. On the other hand, the virtual machine can't compensate if you make a poor choice.
    The -XX:+AggressiveHeap+ option inspects the machine resources (size of memory and number of processors) and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs]
    So is Setting -Xms and -Xmx and -XX:AggressiveHeap
    best practice? What kind of performance improvement should we expect?
    Concerning JIT:
    I read this one
    [the impact of the JIT compiler is obvious on the graph: at startup the time taken is around 500us for the first few values, then quickly drops to 130us, before falling again to 70us, where it stays for 30 minutes,
    for this specific issue, I greatly improved my performances by configuring another VM argument: I set -XX:CompileThreshold=50]
    The size of the cache can be changed with
    -Xmaxjitcodesize
    This sounds like you should do something with JIT args, but reading
    // We disable the JIT during toolkit initialization. This
    // tends to touch lots of classes that aren't needed again
    // later and therefore JITing is counter-productiive.
    java.lang.Compiler.disable();
    However, finding
    the sweet spots for compilation thresholds has been tricky, so we're
    still experimenting with the recompilation policy. Work on it
    continues.
    sounds like there is no such straigth forward path, it all depends...
    Ok, its good, when
    [Small methods that can be more easily analyzed, optimized, and inlined where necessary (and not inlined where not necessary). Clearly delineated uses of data so that usage patterns and lifetimes are apparent. ]
    but when I read this:
    [The virtual machine is responsible for byte code execution, storage allocation, thread synchronization, etc. Running with the virtual machine are native code libraries that handle input and output through the operating system, especially graphics operations through the window system. Programs that spend significant portions of their time in those native code libraries will not see their performance on HotSpot improved as much as programs that spend most of their time executing byte codes.]
    I have the feeling that we might not able to improve performance that way?
    Any comments?
    otherwise i was wondering about
    -XX:CompileThreshold=50 -Xmaxjitcodesize (large, how large?)
    Somehow, we still feel that someone out there should have experienced similiar problems? But obviously there is no guarantee that the someone should surf by here!
    In c++ we used to just write everything ourselves. Here it does seem to be a question about the right use of other peoples stuff?
    Where you are kind of hoping for a shortcut, so you dont have to read endless number of documents, but can find a short document that actually addresses your problem ... well.
    -Simon
    Edited by: simoncpm on Mar 15, 2010 3:43 PM
    Edited by: simoncpm on Mar 15, 2010 3:53 PM

  • File association on Windows for Java application?

    Sorry for the Windows-related question, but I thought maybe some fellow Java hackers had run into the same problem...
    We have a Java application targeted for multiple platforms, including Windows. We also have a certain file extension for our data files, call it .abc. Our customers would like the following functionality in Windows Explorer when the app is installed on Windows:
    1 - custom description for .abc files
    2 - custom icon for .abc files
    3 - double-click an .abc file to open it in our application
    It's easy enough to get this functionality by setting appropriate registry keys:
    HKEY_LOCAL_MACHINE\Software\Classes\.abc: @ = OurApplication.abc
    1 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc: @ = An abc file for OurApplication
    2 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc\DefaultIcon: @ = <path>\OurApplication.ico
    3 - HKEY_LOCAL_MACHINE\Software\Classes\OurApplication.abc\shell\open\command: @ = "<path>\OurApplication.exe" "%1"
    This works great, except you have to restart Windows to get the changes to take effect. Does anyone know how to get the Windows shell to update itself to reflect these new Registry keys without restarting Windows? I've seen the SHChangeNotify function, but I can't call Windows API functions easily from the installer.

    rundll32.exe may be of use...
    Here are some samples of how to use it: http://dev.remotenetworktechnology.com/cmd/rundll32.htm
    Google for more.
    - K

Maybe you are looking for