Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Download a JAR from URL

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Download a JAR from URL

    I am writing a simple system to auto-update my program and I need to be able to download jar files from a URL.

    I'm not sure I quite understand the JarURLConnection/Jar-streams in the docs. Could someone give me some example code on how to do this?

    Also, how do you run them? Desktop.getDesktop.open(jar) ?

    P.S: Before anyone suggests it, yes I know about JWS. No I don't want to use it with this program


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Download a JAR from URL

    Do you want to download the jar file as a file or do you want to read the contents of the jar file?

  3. #3
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Re: Download a JAR from URL

    Quote Originally Posted by Norm View Post
    Do you want to download the jar file as a file or do you want to read the contents of the jar file?
    Just download it as a file. I think I'm okay now. I was under the impression that it required special treatment but I had just missed a variable statement in my downloading code.

Similar Threads

  1. How to Download a file via FTP
    By JavaPF in forum Java Networking Tutorials
    Replies: 1
    Last Post: December 24th, 2011, 11:56 AM
  2. Cache Download problem
    By frozen java in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 27th, 2011, 08:04 PM
  3. Help needed in excel download...
    By tester in forum Java Servlet
    Replies: 2
    Last Post: February 9th, 2010, 08:14 AM
  4. KB/s download speed calculating
    By Koâk in forum Java Theory & Questions
    Replies: 2
    Last Post: December 16th, 2009, 03:05 PM
  5. How to Download a file via FTP
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: June 5th, 2009, 05:49 AM