Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • 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.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4007
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 4007
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic