The Artima Developer Community
Sponsored Link

Java Answers Forum
"idlj" Compiler and Package Names

2 replies on 1 page. Most recent reply: Mar 16, 2007 7:42 AM by Ken Sloan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Ken Sloan

Posts: 35
Nickname: sloan
Registered: Sep, 2003

"idlj" Compiler and Package Names Posted: Mar 9, 2007 2:05 PM
Reply to this message Reply
Advertisement
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
Development\Hello
and this is where the file Hello.idl resides.

Because my company's domain name is SloanVentures.net I also have this structure
Development\net\SloanVentures\
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
Development\Hello\HelloApp

but with package names in the source code that say
package net.SloanVentures.HelloApp;

so that when I compile this generated source, it will put the classes in a package in this structure
Development\net\SloanVentures\HelloApp\
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:
idlj -fall -pkgPrefix HelloApp net.SloanVentures Hello.idl

This results in the correct package names in the generated java source, but puts them in the following new structure:
Development\Hello\net\SloanVentures\HelloApp
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.
package HelloApp;
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.


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: "idlj" Compiler and Package Names Posted: Mar 12, 2007 8:53 AM
Reply to this message Reply
Use a IDE.
The usually offer some ways to refactor your code.

Ken Sloan

Posts: 35
Nickname: sloan
Registered: Sep, 2003

Re: "idlj" Compiler and Package Names Posted: Mar 16, 2007 7:42 AM
Reply to this message Reply
Thanks. Not a bad idea. I'd been thinking of doing that anyway. I developed this entire app just using a text editor. It was pretty tough in the beginning (especially since I was/am a Java newbie), but I have it so far along now, that any new development is mostly just a cut-and-paste exercise.

Is there a particular IDE anyone would recommend? I strongly prefer free/shareware.

Flat View: This topic has 2 replies on 1 page
Topic: "idlj" Compiler and Package Names Previous Topic   Next Topic Topic: Help with multi dimensional array

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use