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 8 of 8

Thread: calling jar in url ??

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post calling jar in url ??

    Hi, I just want to ask some help,can i call the jar in url like this

    http://localhost/mytestsite/myjar.ja...mfile=view.php

    and when it is called it will read the url and write it on the textfile?..I want to store only the view.php in the textfile...is this possible?


    Thank you in advance.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: calling jar in url ??

    What exactly are you trying to do? Pass arguments into the jar? Run the jar automatically when you visit a website? Something else?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,603
    Thanks
    50
    Thanked 2,235 Times in 2,207 Posts

    Default Re: calling jar in url ??

    If that URL is used in a browser to get a page from a server site, does the server know what to do if the file that is being referenced is a jar file? Often the server will return the jar file to the browser which will save it on the local disk.
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Junior Member
    Join Date
    Jun 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: calling jar in url ??

    @KevinWorkman,@Norm,


    How do i call my "myjar.jar" and to look up in the url and see the parameter and execute it...sorry about this silly question,I just want to act my "myjar.jar" as a services.and i just want to ask if this is possible.


    Thank you in advance.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,603
    Thanks
    50
    Thanked 2,235 Times in 2,207 Posts

    Default Re: calling jar in url ??

    How do i call my "myjar.jar"
    What do mean by "call"?
    Do you mean how to start the execution of the class files in the jar file?
    Open a command prompt window, change to the folder with the jar file and enter the command:
    java -jar myjar.jar


    Did you see post#3?
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Jun 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: calling jar in url ??

    Hi Norm,

    Thank you for the quick reply...yes i see,...okay i understand now.I will change my logic

    by the way Norm,does the jar can look up the url if use the command java -jar myjar.jar ?

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,603
    Thanks
    50
    Thanked 2,235 Times in 2,207 Posts

    Default Re: calling jar in url ??

    There can be special code written to execute on the server to execute the contents of the jar file. For example servlets or cgi-bin code or maybe php.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #8
    Junior Member
    Join Date
    Jun 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: calling jar in url ??

    Hi Norm, Thank you,I am not familiar with the servlets,I'll just give a try on those options you provided.

Similar Threads

  1. Calling jar from different directory
    By buttcrackbil in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 26th, 2013, 11:16 AM
  2. Url Image stream? Getting an Image url.
    By turtlemaster in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: June 30th, 2012, 09:43 AM
  3. [SOLVED] jar file Built(clean and build) perfectly, but not running as jar
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: July 11th, 2011, 11:41 AM
  4. [SOLVED] Download a JAR from URL
    By bgroenks96 in forum Java Theory & Questions
    Replies: 2
    Last Post: July 9th, 2011, 10:02 AM