• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java archive notation

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am trying to figure out what the qualified name of an import is. For instance I am trying to determine what the file of this jar: "import org.mc4j.ems.connection.ConnectionFactory;" should be. Any help greatly appreciated.
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I extract the jars and search for class name.
I don't know if any other way is available for that.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am trying to figure out what the qualified name of an import is. For instance I am trying to determine what the file of this jar: "import org.mc4j.ems.connection.ConnectionFactory;"


What are you looking for exactly ? Which jar file org.mc4j.ems.connection.ConnectionFactory is ?
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks for the quick reply. To be more specific about the problem, I have a piece of code that references libraries I don't have. I need to know what to look for when I am searching for these resources. Thanks.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Christophe, yes that is exactly what I am looking for! Thanks.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Going by the way it is packaged, it sounds like http://mc4j.org/confluence/display/mc4j/Home
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maneesh, thanks for the quick reply! I have been to the URL you mentioned but have yet to find classes or the standalone MC4J jars. I am guessing from what you and others have told me that once I get either the MC4J jar or the classes inside, I can include it (them) in my build path. Is this correct thinking? Were you able to locate the MC4J jar? Thanks very much, Maneesh, Dan.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have scoured the sourceforge MC4J website with no luck finding the source jar MC4J. I assume the authors have checked the code into the sourceforge software repository...?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you see this line on the link I provided?

The current release, MC4J 2.0 alpha 1 is available for Download.


Clicking on it took me to a page and I got options for Win,Mac etc. Hovering my mouse over one of those options told me it was a jar.
Is it the same jar you are looking for? No idea.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maneesh, Yes I did follow your link (thanks for that) and downloaded the latest from there but trying to open it gives me a "Manifest not found error". I am assuming that the authors included all necessary resources in their self-extracting jar but I having trouble even getting that open. Thanks again for your continued help.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Source: http://sourceforge.net/projects/mc4j/develop

How are you trying to open the jar? I opened it without any issues.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All, I did finally get the jar org-mc4j-ems-1.2.2.jar unzipped by using the command line unzip. No mc4j resources but plenty of mcxj resources. I suppose this is because the bundled mcxj resources make up the mc4j resource. Duh! on me. I know I need to drop this puppy somewhere in the classpath. So I am looking at the import statements and for example "import org.mc4j.ems.connection.ConnectionFactory;" looks a remote sort of invocation. So now that I have found the jar file I should be able to change the import statement to, for example, "import org-mc4j-ems-1.2.2.connection.ConnectionFactory;", right? Thanks, Dan.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this thread as too difficult a question for "beginning".
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dan Grindstaff wrote:[...] now that I have found the jar file I should be able to change the import statement to, for example, "import org-mc4j-ems-1.2.2.connection.ConnectionFactory;", right?


Highly unlikely, as package names can't have dashes. And it's not necessary to un-jar a jar to use its classes.

In the org-mc4j-ems-1.2.2.jar I see an org.mc4j.ems.connection.ConnectionFactory -- is that not what you're looking for?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't exactly know this argument, but regarding to "Java archive notation" I think you misunderstood the concept (or maybe I misunderstood you ^^)
Usually you package your classes in a jar file and users (client developers) don't need to extract that jar. They simply add the whole jar to the CLASSPATH, and the best is when you use an IDE (such NetBeans) which let you introspect the jar for finding what you need. Do you use an IDE?
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raffaele, Thanks for the reply. I am trying to figure out what the best way to create a jar file would be based on dependencies. What I am wondering is if it is wiser to explode all jars the target jar depends on and add those exploded files to the target jar, or simply make sure all the dependent jars are on the build path. TIA
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dan Grindstaff wrote:TIA


Sorry for nitpicking, but please UseRealWords. Don't use acronyms not everybody knows.
 
Raffaele Sgarro
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it basically depends on you
You could deploy your application as a single jar, which is my preferred way if you can't use alternate deploying technolgies such as WebStart. Using a single jar you can take advantage of certain Java facilities accomplished by manifests and OS-related behaviors
But you may prefer using multiple jars when you are developing a "library" and not all modules are needed by the client developer

Also, I could have misunderstood your post one more time, since it's not clear enough to my not-so-well-trained English :P
If you wonder WHAT TO DO with jars downloaded from the net, well, the answer usually is: don't touch them. They are packaged to be used as-is, without any further extraction, renaming, ect. You should also look at online documentation to know what you are intented to do with all those jars
But most of the times you simply add the whole jar to your classpath (or "library path" if you're using an IDE, which is my suggestion ;)) so that needed classes/packages are on your build path

[offtopic]
May I ask you why do you need mc4j?
[/offtopci]
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic