• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

how to access the resources(methods,fields of a class) of a jar file in other program

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a program wch contains a single method.I compiled the program and kept the class file in a folder(package)and created the jar file. Now i want to access the method of a class in the jar file from another program. How can i achieve this.
 
author
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the jar file in the runtime classpath on your system (and/or add it to the classpath for the program you are using to start the application). You also will need it as an available library for building. Is this a java program?
[ March 29, 2006: Message edited by: Scott Selikoff ]
 
Scott Selikoff
author
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off, I'd prefer to discuss this in the forum instead of private e-mails so others may benefit.

Is the program you are trying to call it from a java program? You should read up on classpaths (just ask google) and it will tell you a lot about them. Otherwise, if it is not a java program, then you may have limited ability to use a method since java programs generally require a running jvm to be invoked from. Please tell us more about your situation after reading about classpaths.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic