Skip to content

Classpath and Native lib linking

July 13, 2007

I was trying to run moyosoft java outlook connector today. One I had a problem of linking the native libraries to the running code. It was giving me a linkage problem. So created the env variable named java.library.path and referred it to C:/mydoc/lib/moyosoft.dll. Turned out this variable should refer to the directory only.

In eclipse – in project build path you need to link the sub item of the jar referenced – Edit native libraries linked to refer to the dll – this one took some time…

Then tried to run the code from command line. Set the classpath in the env variable to bin or you can do that from command line -cp and then the lib path using -Djava.library.path
If you have spaces then need to put in double quotes.

C:\>java -Djava.library.path=”C:\Documents and Settings\shivanic\workspace\outlook\lib” -cp “%CLASSPATH%;C:\Docume
nts and Settings\shivanic\workspace\outlook\bin” test.TestOutlook

Outlook oA= new Outlook();
FoldersCollection fc = oA.getFolders();
Iterator itr = fc.iterator();
while(itr.hasNext())
{
OutlookFolder folder = (OutlookFolder)itr.next();
System.out.println(folder.getName());
if(folder.getName().startsWith(“shiv”))
{
FoldersCollection fcInbox = folder.getFolders();
Iterator itrfc = fcInbox.iterator();
…………………….

Okay it executed correctly but need to have outlook client installed on the machine. Which is not required,
So RM suggested to use a tool called FetchMail or any POP3 client to fetch mail from the server and then push the messages which are in the text format having all the metadata to another location in another server .
What we need to determine is :

a. how to fetch
b. what is the format of messages saved in the different location
c. how to read those messages from the new location using a different client?

šŸ™‚ okay not bad.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: