This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

"idlj" Compiler and Package Names  RSS feed

Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've run into a little quirk using the idlj (idl-to-java) compiler. I'm not sure there's anything that can be done, but maybe someone here can help.

Let's say I'm writing a Hello World application. My development environment directory structure is
and this is where the file Hello.idl resides.

Because my company's domain name is I also have this structure
where all my packages go. So far, so good.

I want to run the idlj compiler so that it creates the app source code in this directory

but with package names in the source code that say[java]package net.SloanVentures.HelloApp;[/java]
so that when I compile this generated source, it will put the classes in a package in this structure
I believe that this is the typical, standardized approach most would follow (I may be wrong about that, by the way...if so I'd love to hear how others do it).

So, I run the idlj compiler as follows:

This results in the correct package names in the generated java source, but puts them in the following new structure:
instead of Development\Hello\HelloApp.

If I eliminate the -pkgPrefix option, then it puts HelloApp in the right structure, but the package names in the source code are wrong i.e. [java]package HelloApp;[/java] so I have to modify all of them before compiling the java source.

So, I can either move HelloApp to the correct directory, or I can modify all the generated source to use the correct package names.

Or is there a better/different way?

Any help would be greatly appreciated.
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ken,

Welcome to Javaranch.

I don't know if my answer is going to be very helpful, but I hope it does. I've recently put together an ant script for this very purpose and I found using -td and pkgTranslate options very useful.

I've been trying to post the relevant part of my script, but the forum software thinks that it has html content and doesn't let me post.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!