• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

"ln -sf" equivalent in eclipse

 
Ranch Hand
Posts: 85
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 2 files Accounts-JBOSS-TEST.xml and Accounts-WAS-TEST.xml in /www/inf/xxxx/config. My java code is written in such a way that,
Accounts-JBOSS-TEST.xml is used when it is running in JBOSS container;
Accounts-WAS-TEST.xml is used when it is running in JBOSS container
Accounts-TEST.xml is used when it is not running in any container (java main class).
But there is no Accounts-TEST.xml file in /www/inf/xxxx/config. I want to link Accounts-JBOSS-TEST.xml to Accounts-TEST.xml and remove the file later. I know I can do this in linux using "ln -sf" command.
ln -sf /www/inf/xxxx/config/Accounts-JBOSS-TEST.xml /www/inf/xxxx/config/Accounts-TEST.xml
rm -f /www/inf/xxxx/config/Accounts-TEST.xml
Please let me know if there is an equivalent way of doing this in eclipse using VM arguments.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know any way of doing it with VM arguments,

But you can create linked file elements in Eclipse with the Advanced options in the "New File" wizard.
Just File:New -- select Other..., and then the option is under General:File.

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-45.htm

 
Marshal
Posts: 4018
549
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could pass the name of the test file using a system property. If present, that file would be used, otherwise the production file would be used.

Simple example:
In Eclipse you would set the VM arguments line something like:
    -Dtest-file-name=/www/inf/xxxx/config/Accounts-TEST.xml
 
swathi bairu
Ranch Hand
Posts: 85
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stefan Evans wrote:I don't know any way of doing it with VM arguments,

But you can create linked file elements in Eclipse with the Advanced options in the "New File" wizard.
Just File:New -- select Other..., and then the option is under General:File.


Thank you for your help. I do not know until now, we can link to a folder/file in eclipse. This is something new I learned here. But my problem is, I don't have that file there. It has to be created if it does not exist and should be linked to another file and then gets deleted after the execution of my program.
 
swathi bairu
Ranch Hand
Posts: 85
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:You could pass the name of the test file using a system property. If present, that file would be used, otherwise the production file would be used.

In Eclipse you would set the VM arguments line something like:
    -Dtest-file-name=/www/inf/xxxx/config/Accounts-TEST.xml



Thank you for the solution. This should serve my purpose.
 
Marshal
Posts: 76888
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wouldn't you use the same instruction at the command line?
 
Good night. Drive safely. Here's a tiny ad for the road:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic