comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Java Bridge Import
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Java Bridge Import [message #60964] Mon, 23 June 2008 07:41
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jun 23, 10:13 am, Nigel Wade <n...@ion.le.ac.uk> wrote:
> humanumbre...@gmail.com wrote:
>> Hey ~~
>
>> So, I'm trying to re-use much existing Java code in this java->IDL
>> rewrite process.  However, if appears that I can only access Java
>> classes if they're jar'd up.  I need to be able to access class files
>> without having to Jar them.  (This is a huge application)
>
> No, you don't need to jar them. Have you read the IDL manual about how to access
> Java objects? Some of the examples there access individual class files.
>
>
>
>
>
>> Here's what I mean:
>> For example, I have a class "HelloWorld.java" and "HellowWorld.class"
>> in D:\IDLResearch\Bridge\
>
>> This code: javaClass = obj_new('IDLJavaObject$HELLOWORLD',
>> 'HelloWorld.java') returns
>
>> "% Class HelloWorld.java not found
>> % Execution halted at: IMPORTER            3 D:\IDLResearch\Bridge
>> \importer.pro
>> %                      $MAIN$ "
>
>> My idljavabrc file contains: D:\IDL\Bridge\ and D:\IDLResearch\Bridge
>> -- I've tried it with each.
>
>> Any thoughts ??
>> Thanks in advance!
>> --Justin
>
> The problem you have there is that you have not named your class file correctly.
> The classloader does not want your java source file. Further, the classloader
> locates classes by package name, and '.' is the separator for packages within
> the package hierarchy. What the classloader will be looking for in your example
> is a file called 'HelloWorld\java.class'.
>
> If your java class in not part of a package then you should include the
> directory in which HelloWorld.class resides in the CLASSPATH and specify the
> class 'HelloWorld' in the obj_new.
>
> If your class is part of package then you need to include the base directory of
> package hierarchy in the CLASSPATH and specify the fully qualified class name
> in obj_new.
>
> --
> Nigel Wade

Yes, I did have a typo -- but the ultimate problem was the
specification of the folder w/ a space.

asdf = obj_new('IDLJavaObject$HELLOWORLD', $
'HelloWorld')

with the proper set up in idljavabrc file works.

Thanks!
--Justin
Re: Java Bridge Import [message #60965 is a reply to message #60964] Mon, 23 June 2008 07:13 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
humanumbrella@gmail.com wrote:

> Hey ~~
>
> So, I'm trying to re-use much existing Java code in this java->IDL
> rewrite process. However, if appears that I can only access Java
> classes if they're jar'd up. I need to be able to access class files
> without having to Jar them. (This is a huge application)

No, you don't need to jar them. Have you read the IDL manual about how to access
Java objects? Some of the examples there access individual class files.

>
> Here's what I mean:
> For example, I have a class "HelloWorld.java" and "HellowWorld.class"
> in D:\IDLResearch\Bridge\
>
> This code: javaClass = obj_new('IDLJavaObject$HELLOWORLD',
> 'HelloWorld.java') returns
>
> "% Class HelloWorld.java not found
> % Execution halted at: IMPORTER 3 D:\IDLResearch\Bridge
> \importer.pro
> % $MAIN$ "
>
> My idljavabrc file contains: D:\IDL\Bridge\ and D:\IDLResearch\Bridge
> -- I've tried it with each.
>
> Any thoughts ??
> Thanks in advance!
> --Justin

The problem you have there is that you have not named your class file correctly.
The classloader does not want your java source file. Further, the classloader
locates classes by package name, and '.' is the separator for packages within
the package hierarchy. What the classloader will be looking for in your example
is a file called 'HelloWorld\java.class'.

If your java class in not part of a package then you should include the
directory in which HelloWorld.class resides in the CLASSPATH and specify the
class 'HelloWorld' in the obj_new.

If your class is part of package then you need to include the base directory of
package hierarchy in the CLASSPATH and specify the fully qualified class name
in obj_new.

--
Nigel Wade
Re: Java Bridge Import [message #60966 is a reply to message #60965] Mon, 23 June 2008 07:07 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
Got it!

OK -- on the idljavabrc file, when you include another path - you
can't put a space after the ;
So:
WILL WORK: $CLASSPATH;D:\IDLResearch\Bridge
WON'T WORK: $CLASSPATH; D:\IDLResearch\Bridge

Hope this helps someone :P

Cheers
--Justin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Java Bridge Import
Next Topic: System.exit from Java class

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:02:27 PDT 2025

Total time taken to generate the page: 0.00596 seconds