Results 1 to 3 of 3
  1. #1
    tommundackal is offline Member
    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Default Need help for jar file exec

    Hey all
    I need to execute a java jar file that is stored in a location using the java code in netbeans. i found many sample codes in many forums and google ...but most of them show error or not properly executing the jar file.IF any one have the code please upload it or reply to my mail tommundackal@gmail.com.
    I want to execute the jar file using java code instead of going to cmd and type java -jar jar file

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,963
    Rep Power
    8

    Default Re: Need help for jar file exec

    What have you tried? Hint: you can either use a ProcessBuilder or you can add the jar to your classpath and call its main method from your code.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default Re: Need help for jar file exec

    I want to execute the jar file using java code
    Do you want the code in the jar file to execute in the same JVM as the code that calls it?
    Or do you want the code to execute in its own, separate JVM by using the java command to execute it?
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. UTF-8 from an Exec
    By Grismar in forum New To Java
    Replies: 2
    Last Post: 12-12-2012, 12:18 PM
  2. App needs to exec script
    By jocala in forum Android
    Replies: 0
    Last Post: 07-06-2012, 04:51 AM
  3. runtime.exec
    By cotede2 in forum Advanced Java
    Replies: 3
    Last Post: 04-17-2009, 05:18 PM
  4. help with Runtime.exec()
    By Lanfear in forum New To Java
    Replies: 18
    Last Post: 12-16-2008, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •