CLASS_PATH and environment variables

General discussions about code engineering

Moderator: Moderators

CLASS_PATH and environment variables

Postby etienne_f » Mon Apr 16, 2012 8:45 am

Hello,

In the context of a Java reverse I would like to add some jar files to the existing CLASS_PATH. The problem is that the path is different for different users. Im my context the path is K:\dev\distribution\framework\lib\framework.jar and for some developpers it will be C:\dev ... I have an environment variable named DEV_HOME that is set by the user to define his home development directory. The value is C:\dev or K:\dev. When I define my CLASS_PATH in MD, I would like to give the following value $DEV_HOME\distribution\framework ... but I can't.

It is possible to do that ? And if yes how ? And if no, is there a workaround to do the same thing ? Is it possible to use the "path variables" ? How to use environment variables in the path variables ?

Best regards

Alain
etienne_f
Forum Newbie
Forum Newbie
 
Posts: 16
Posts Rating:1
Joined: Fri Aug 19, 2011 8:08 am

Re: CLASS_PATH and environment variables

Postby egiva » Thu Apr 19, 2012 7:47 am

Hello Alain,

You need to go to Options-> Environment-> Path Variables and declare DEV_HOME in MagicDraw as path variable. Then if you declare CLASS_PATH for MagicDraw java reverse engineering, this variable will be automatically suggested for use.
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am

Re: CLASS_PATH and environment variables

Postby etienne_f » Thu Apr 19, 2012 9:46 am

Hello Egidijus,

Sorry, but I don't understand. Maybe my explanation was not clear.
If I define a new "path variable" like DEV_HOME, MD asks me a value. I can enter a string or select a path on my file system. I my case, I would like to set the value with the content of the environment variable with a $DEV_HOME or %DEV_HOME% or env.DEV_HOME, but I don't know what I have to do do. What is the syntax, if it is exist, to retrieve the content of a environment variable ?

I saw that if I add a new value in the CLASSPATH of the "Java language Option", MD suggests me a variable named <install.root>\DEV_HOME. But when I reverse my java classes, I see that the CLASSPATH is not good because dependencies are reversed in the "Default" package. I suppose that it is because the value of the DEV_HOME "path variable" is not good. So what is the syntax to retrieve the value of an environment variable to set the path variable.

I hope that it is more clear than before.

Thank you for your answers

best regards

Alain
etienne_f
Forum Newbie
Forum Newbie
 
Posts: 16
Posts Rating:1
Joined: Fri Aug 19, 2011 8:08 am

Re: CLASS_PATH and environment variables

Postby egiva » Fri Apr 20, 2012 5:52 am

Alain,

Variables from the system are not supported in MagicDraw. The only way is to open Options-> Environment-> Path Variables and declare path variable there. This variable is understandable by MagicDraw application and loaded projects. If project is shared among users then each user must define this path variable with value related by their file system in each MagicDraw application.
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 1 guest