Archiving a java project, then running on other machine

Hello all. I have created a java project (with main.java as starting point) using the eclipse IDE. I have then exported the project into a jar file (using various settings) and I have sent the jar file to another machine. On the other machine I have java installed, but not eclipse. How do I expand the jar file, and evoke the main method via command line on the other machine?
Thanks In Advance

mateobus wrote:
Hello all. I have created a java project (with main.java as starting point) using the eclipse IDE. I have then exported the project into a jar file (using various settings) and I have sent the jar file to another machine. On the other machine I have java installed, but not eclipse. How do I expand the jar file, and evoke the main method via command line on the other machine?
Thanks In AdvanceYou may not need to expand it.
java -jar [myjar.jar] may work (if you have the Main-Class attribute set in the manifest)
Otherwise, you can run (from the console):
jar -xf [myjar.jar]

Similar Messages

  • Why Mac crashes when I run the clean speech ring of osx and then run the RestoreTime Machine?

    Why Mac crashes when I run the clean speech ring of osx and then run the RestoreTime Machine? Could it be that I run restore the setup from a usb drive. I've done thisbefore and when it has not been a problem.
    Does anyone have a good answer on this so I'm happy.

    kjell-einar wrote:
    Why Mac crashes when I run the clean speech ring of osx
    What is that?
    run the RestoreTime Machine?
    What are you restoring? 
    Do you mean a full system restore?  Or something else?
    When does your Mac crash -- during the restore, when you try to start up afterwards, or ?

  • Java FX application not loading other machine

    Hi all,
    I have faced the problem when run the simple jafaFx sample application
    The code below :
    <html>
    <head>
    <title>EffectsPlayground</title>
    </head>
    <body>
    <h1>EffectsPlayground tttt</h1>
    <script src="http://dl.javafx.com/dtfx.js"></script>
    <script>
    javafx(
    archive: "EffectsPlayground.jar",
    draggable: true,
    width: 600,
    height: 560,
    code: "effectsplayground.Main",
    name: "EffectsPlayground"
    </script>
    </body>
    </html>
    It's Working fine in my machine
    Not working in other machine in Network
    I deployed in Tomcat
    Plz help me
    Navaneeth
    Edited by: Navaneethakrishnan.Shanmugam on Apr 22, 2009 6:56 AM

    Can't say much, based on the (lack of) information you provide. Except: ensure the other browser has JavaScript enabled, and uses the right version of Java.

  • LISTENER RUNNING IN OTHER MACHINE

    Is it possible to have a listener process running in a server and the instance(s) running in other server?
    For example, server SDBORA01 has two instances (ORA_DEV and ORA_PROD) and server SDBLSNR05 has one listener process to the former two instances.
    Thanks.
    Oracle 10G (10.2.0.3) / SO Linux RedHat 4

    NO.. we should have Listener running from same oracle home where DB exists.
    --Girish                                                                                                                                                                               

  • How to archive a Java project that uses an Oracle XE DB?

    Hi,
    As the title suggests, I have a small Java application that uses Oracle XE as the database. Now that I have finished working on the application, I want to archive it and email it to friends and coworkers to test it. However, I know that none of these people have any database software installed. I also can't have them connect remotely to the one on my development machine.
    Is there any way to include the database in my application archive, so that all they have to do is run the application without worrying about its back-end? Should I use another back-end?
    Any help is appreciated.
    Thanks

    Unless your database server is on a remote machine that they can connect to then you can't package the WHOLE DATABASE, software and all and send it via e-mail.
    You can package your application, and also export the contents of your database into a .dmp file and send that.
    The user will NEED Oracle software then to import the contents of your .dmp file.

  • How to specify a file path in java code to run on Unix machine?

    Hi
    I have a problem when running my project Swing on Unix machine.
    In my code, the user will press a button and then the program will look for the file "ReadMe" in the folder "Documentation" , and reads the content of this file. My code is "Documentation\\ReadMe" and it works well on PC. (The folder "Documentation" is in the same directory with my Java code).
    But when I try on Unix, the program can not read the file. It can only read the file "ReadMe" if I take this file and put it in the same directory with my Java code ( this means not through another folder). So how can we make it read the file in a folder ? It seems that "Documentation\\ReadMe" does not work in Unix, or the symbol "\\" does not work.
    I would be thankful if anybody can help me with this.
    Thank you very much

    You really shouldn't use any path method, as neither are very consistant or platform independent. The JVM provides a way to grab resources from the classpath. These resources can be any data at all, in fact, it's how java itself locates classes. Here's an example how you would do this in a non-static method.
    public URL getReadMe() {
      // In this context the forward slash is universal
      String docDirectory = "Documentation/"
      // We have to use the classloader to grab the resource
      ClassLoader cl = this.getClass().getClassLoader();
      // Next we get the resource 
      URL readMeURL = cl.getResource(docDirectory + "ReadMe");
      return readMeURL;
    }The URL can be used in whatever way you need to get the information out of the resource. If it was an image you might use the "Toolkit" to make an image object out of it. The great thing about this method is it will work even if your loading the program out of a Jar file. The resource paths start at the top of the classpath, just like classes.

  • How to make my java project install in my cient machine using a setup file.

    how can i create a setup file using java, such that when i give the project to my client ,the client simply installs it my double clicking the setup icon.As in the case of windows applications.

    Hi,
    You can make a batch file for this purpose.
    Thanks,
    Mansoor

  • TOC disappears when run from other machines

    I'm running RH8 for Word. We have a file that when I compile - looks great. We copy the hlp and cnt files to any ftp site and the TOC disappears. All topics are there; links work, graphics fine, etc. but the Table of Contents has vanished. We're using RoboHelp for Word and have been since v5.
    If I run the AutoGenerate TOC function, the TOC disappears completely from the working file. Bear in mind, this is the same file we've been working from for the last 3 years and up until now has been working. We recently updated to v7 and upgraded again to v8 today.
    I really appreciate any guidance anyone can give.
    Here's a shot of the TOC in RH8 (and how it's appeared for quite some time in the compiled hlp file.)
    RH8 view when Autogenerate TOC is run
    Expansion of MerchantAG TOC
    Incidentally, when other users run the file, they see the Welcome Topic, no TOC.
    Kerry

    Did you solve this issue?  I am having a similar problem.  We use a shared network drive to store our files so updates are instantaneous.  When I first update, generate, and save the TOC is visible.  When I go back later it is not visible, and not every user is having this issue.  I am running RH 8 on XP using Office 2007.
    Thanks,
    Melanie

  • How to use BO SDK in local java project?

    Hi,
    I am trying to connect BO system using below mentioned code
    public void main(String args[]) throws SDKException {
         try
              System.out.println("main");
              /ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();/
              IEnterpriseSession boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( "Administrator","","BOSAP","secEnterprise");
              IInfoStore boInfoStore =(IInfoStore) boEnterpriseSession.getService("InfoStore");
              ChangePWD(boEnterpriseSession, boInfoStore);
         }catch(Exception e)
              System.out.println("Exceptions in main");
              System.out.println(e);
    This code was taken from below mentioned thread:
    Force all users to change their Enterprise passwords with a batch operation
    I have created standalone java project and running as JAVA application in eclipce. I am getting class def not found error for these BO SDK jar files. I have added
    cecore.jar
    celib.jar and
    cesession.jar files as external lib to java project
    I am using following imports
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.desktop.user.IUser;
    Does any one know solution to fix class def not found error?
    Thanks
    Nitesh Shelar

    I did some mistake few dependent jars were missing in project build path. After adding those missing BO jar files. Now its giving server connection error. Which I am trying to resolve.
    Thanks for your help.
    Nitesh Shelar

  • Running ssh command from java and then answering password prompt

    Hi,
    I have a situation that has not solved yet. I am running ssh command from unix terminal without any problem, and then i enter password.
    For example :
    [oracle@fuata]:/export/home/oracle> ssh -N [email protected] -L 9901:127.0.0.1:9999
    Password:
    It is working. I have question that how can i perform this in java? I am thinking that i can run ssh command by using Runtime Class, it is ok. But how can i answer the password? I am a bit confused. Is there any example looks like this?
    Thanks for responses.

    futi wrote:
    Thanx. Firstly i insisted to do this without jsch but actually this is harder than jsch. I edit some of code pieces PortForwardingL.java and could run it. It works problem-free. Could you say why you "insisted" on this approach. It can't be for speed+ since jsch is very fast. It can't be for portability+ since jsch is portable but the use of Runtime.exec() requires the installation of ssh software. It can't be because of limitations+ since jsch is a fully featured library. It can't be for security+ since jsch is secure. It can't be for ease of use+ since jsch is much easier to use than ssh with Runtime.exec(). Unless it's a licensing issue, it can't be for commercial+ reasons since jsch is free. The only reason I can think of why one would "insisted" on this approach is if it is for some college project.

  • Java is not running in Firefox, but runs in other browsers.

    I am trying to run java in my Firefox 3.6.13 browser.
    Java works perfectly in Internet Explorer, but I rather use fire fox.
    I have java installed, and it appears in my (about:plugins) page as all enabled.
    yet when I go to the java website to detect java, I end up watching the swirling bar go on forever and then it reports I have no java installed.
    Every page that uses java appears blank, the page loads around the java perfectly, but its just an empty space where anything java is.
    I made sure to check the control panel and make sure it is enabled for mozilla family as well as the next gen java is selected. unfortunatley no matter how many times I uninstall java/fire fox, and re install, Java will not work

    The ''' "Search" ''' box isn't going to do you any good, you need the '''Run''' box. There isn't a "file" in the Firefox Program Files folder that you can use to launch the Firefox SafeMode. ''Firefox 4.0 has a fix to get around this problem in Vista and Win7, so you won't have to activate the '''Run''' box.''
    See if this works in Windows 7: <br />
    http://blogs.msdn.com/b/tims/archive/2006/09/18/windows-vista-secret-3-bringing-back-start-run.aspx

  • How to run a java project based on x86 Windows XP on Windows CE?

    I am a freshbird of J2ME and i am very confused these days.I beg you can look this topic thoughout.
    I used to configurate a Java Project File about SIP&VOIP successfully,and I can run it well on my PC .
    Now I want to migrate the project to a Mobile OS,and problems comes.
    I have installed the Windows CE 5.0 Evalution Edition on my machine(Windows XP SP2) and it works fine.I search it online for days ,and I download almost all related including CLDC(j2me_cldc-1_1-fcs-src-winunix.zip),MIDP(midp-2_0-fr-spec.zip<==Maybe this is not the right one beacuse it don't have a bin folder),and J2ME Wireless Tool KIt(j2me_wireless_toolkit-2_2-ml-windows.exe).
    I have configrate the enviroment-variable already , but I don't kown what to do next . Do you kown? I would be very thankfull.

    You need to completely rewrite the app to use the mobile APIs as they're very different from the PC ones, I suppose.

  • How to run a Java project in NWDS...

    Hi All,
    First of all , i dont know if i am writing in the right forum for this question.
    I am new in NWDS.
    My question is, how can i run my java project in NWDS without  having any portal available (we had some problems running projects in EP 2004 and so we will install a new version EP 2004s )?
    Thank you!
    Regard,
    Ari

    Hi Lohi,
    Thank you for your help.
    Yes i am creating Ear file by using the Java programs with NWDS .
    You mean to deploy mannualy with SDM inside my server?
    How can i than, utilize that into IE?
    Can i run ear without using EP.
    Sometimes i want to run my project in my house where i dont have acess in any SDM or everything else.
    Can you give me please more step by step instruction because i am new with these technologies.
    Thank you ,
    Ari

  • Running eclipse java project on command prompt

    Hi all,
    I have one simple java project and that is very well running in eclipse. I have added some external JARs to that project. It performs this job- it creates connection to server, and listens to the signals from server.
    My question is - how do I run that java project on command prompt?*
    I want to run that using ANT or simply I want to make a JAR file so I can execute JAR on command prompt. I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.
    Can you please tell me any of the method - using ANT or by making JAR?
    Also can you be little bit more explanatory in reply?
    Thanks

    I want to make a JAR file so I can execute JAR on command prompt.This is very likely a good way to proceed. It is explained in great detail in Sun's Tutorial in the section on [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html].
    I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.Yes - the jar file you create has to know about the classes and other resources in that external jar. Otherwise, at runtime, the program will not be able to get at the stuff it needs. Usually you don't include that other jar (or its contents) in the jar file you are creating. Instead you provide your jar file with a manifest that describes the other jar's location. Details are also in the tutorial.
    One thing to note is that Sun's tutorial provides a lot of explanatory, conceptual, material. To that end it keeps the context simple and transparent by describing the steps as they would be carried out by someone working at the command line. The Eclipse documentation and forums might provide a more click-this-drag-that "explanation". If you do follow the method in the Tutorial and get stuck, post a description of the actual commands you used and their outcome.

  • Make Java program run on other pc's

    Good afternoon,
    So I have this Java program compiling on my pc through NetBeans.
    Now if I want this program to run on other pc's on its own (without NetBeans or any other program), preferably through a GUI, do I have to convert it to a JAR file? How does this exactly works out?
    Thanks for your help.

    alley wrote:
    So I have this Java program compiling on my pc through NetBeans.And Netbeans does it using the JDK. it is always the JDK, no matter how many tools you wrap around it on top. You don't need Netbeans to run your stuff either, it is merely a development convenience that Netbeans provides you.
    >
    Now if I want this program to run on other pc's on its own (without NetBeans or any other program)Impossible - you need at least a compatible Java runtime.
    , preferably through a GUIYou mean by double clicking on the program icon through the OS?
    , do I have to convert it to a JAR file? That would be an easy way yes - an executable jar to be more precise
    How does this exactly works out?Netbeans builds the jar automatically, just check out the folders of your project to find it. If you set a main class in the project properties, it is even an executable jar. Double click it and if the Java runtime is properly setup (which tends to be the case when it installs succesfully, but many people manage to screw it up in a way I can't imagine anyway), it will run.
    For further guidance, check the online netbeans manual and research executable jars.

Maybe you are looking for