Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Load Jar from system variable
Load Jar from system variable [message #481374] Thu, 20 August 2009 16:38 Go to next message
Rahul is currently offline RahulFriend
Messages: 64
Registered: July 2009
Member
Hi All,

I have developed an Eclipse RCP product which makes connection to
oracle,db2 and other databases. I have packaged all the jars in the
product itself every thing works fine.
But now I can't pack the jars in the product I have to read it from the
system on which the product is running. Even i cannot make jar as plugins.
I can ask the user to specify the location of the jars. But my problem is
how the jars will be loaded to make contentions. Currently I tried putting
the jars path in environment variable but i did not get any success.

please help me on how this can be achieved.

Thanks,
Rahul
Re: Load Jar from system variable [message #481446 is a reply to message #481374] Fri, 21 August 2009 05:46 Go to previous messageGo to next message
Rahul is currently offline RahulFriend
Messages: 64
Registered: July 2009
Member
Even if some can tell the place where i can put jars after making a
product. So that the product reads the jars and make connection to the
databases.

Please suggest some way...
Re: Load Jar from system variable [message #481481 is a reply to message #481374] Fri, 21 August 2009 08:14 Go to previous messageGo to next message
Jeeeyul Lee is currently offline Jeeeyul LeeFriend
Messages: 117
Registered: July 2009
Location: Seoul
Senior Member

Sorry, my english is too ugly.
Are you questioning about this?

http://www.javaworld.com/javaworld/javatips/jw-javatip70.htm l

Rahul wrote:
> Hi All,
>
> I have developed an Eclipse RCP product which makes connection to
> oracle,db2 and other databases. I have packaged all the jars in the
> product itself every thing works fine.
> But now I can't pack the jars in the product I have to read it from the
> system on which the product is running. Even i cannot make jar as
> plugins. I can ask the user to specify the location of the jars. But my
> problem is how the jars will be loaded to make contentions. Currently I
> tried putting the jars path in environment variable but i did not get
> any success.
>
> please help me on how this can be achieved.
>
> Thanks,
> Rahul
>
Re: Load Jar from system variable [message #481483 is a reply to message #481374] Fri, 21 August 2009 08:25 Go to previous messageGo to next message
Jeeeyul Lee is currently offline Jeeeyul LeeFriend
Messages: 117
Registered: July 2009
Location: Seoul
Senior Member

I made some test code and it looks work.
But I can't sure What are you trying to.

// class pathes
URL[] url = new URL[] {
new URL("jar:file:C:\\Program Files\\Java\\jre6\\lib\\rt.jar!/")
};

// I gave parent class loader as this class's class loader
URLClassLoader myClassLoader =
new URLClassLoader(url, getClass().getClassLoader());

Class<?> stringBufferClass =
Class.forName("java.lang.StringBuffer", true, myClassLoader);

// creates StringBuffer instance from external jar
StringBuffer buffer = (StringBuffer) stringBufferClass.newInstance();

buffer.append("It works!");
System.out.println(buffer);


Rahul wrote:
> Hi All,
>
> I have developed an Eclipse RCP product which makes connection to
> oracle,db2 and other databases. I have packaged all the jars in the
> product itself every thing works fine.
> But now I can't pack the jars in the product I have to read it from the
> system on which the product is running. Even i cannot make jar as
> plugins. I can ask the user to specify the location of the jars. But my
> problem is how the jars will be loaded to make contentions. Currently I
> tried putting the jars path in environment variable but i did not get
> any success.
>
> please help me on how this can be achieved.
>
> Thanks,
> Rahul
>
Re: Load Jar from system variable [message #481508 is a reply to message #481483] Fri, 21 August 2009 10:36 Go to previous message
Rahul is currently offline RahulFriend
Messages: 64
Registered: July 2009
Member
Thanks for the reply,

I got success in connecting to oracle and db2 but when i connect to main
frame it give me some error.

Actually for connection to db2 and oracle we just need to load one jar for
each but for connecting to mainframes we to load three jars one normal and
other two license jars. I am able to connect to mainframe when i add jars
to run time class path for the plugin. But for actual purpose I cannot do
that as i have to read the jars from the location provided by the user.

Thanks,
Rahul
Previous Topic:ProgressMonitorDialog cancel button not listening by progress monitor
Next Topic:PropertTester
Goto Forum:
  


Current Time: Fri Jan 24 19:07:33 GMT 2025

Powered by FUDForum. Page generated in 0.03075 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top