• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

"reverse engineered" package name?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My goal is to start using JDemo so I can preview Jdialogs. I am using IntelliJ IDEA 5.1.2

The project I have inherited has one jar file with no package name. I want to add a package name to it so I can refer to the JDialogs in my Demo app. I am not in a position to change the directory structure of the code which is stored in a path like :
C:\Product\Version\Component\JavaApplet\src. I know the package name normally follows the directory hierarchy, but I'm not sure where one starts from (root) and I haven't been able to choose anything that is recognised.
[
C:\Product\Version\Component\JavaApplet\classes\myapplet.jar is added to the classpath.

I'm not concerned about prefixing the name with the reverse domain name as it will not be distributed. My only goal is to have a package name so I can use the JDialogs in JDemo. What is my "reverse engineered" package name? [Note I use this in quotes as I have full access to the code and want to put in the package name myself, but how not sure what's allowed as the name given the consraints of the existing stucture.]
[ October 11, 2006: Message edited by: Tom Corcoran ]
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't change the package name on an already compiled class. You will need to take the source code that this jar was created from, factor in the approriate package in each of the java files, recompile it, and repackage the jar. After that, the jar can be placed in the same place it always was, because the directory structure representing the packages is contained within the jar itself, and not in the directory path leading to the jarfile.
 
reply
    Bookmark Topic Watch Topic
  • New Topic