Passing arguments to JVM from eclipse

When running a program from eclipse, I get an error like java.lang.UnsatisfiedLinkError: no driJNI in java.library.path
I tried the -Djava.library.path={whatever} in the VM arguments. However, I still get the error of unsatisfied link. When try setting the property in the code with:
System.setProperty("java.library.path","{whatever}");
System.out.println(System.getProperty("java.library.path"));
the output remains : null.
anyother suggestions? if i just use command line the problem goes away. however, i'd like to be able to make eclipse work.
Thanks.

It is called a here-document, as in "The Document is Right Here".
anycommand_that_reads_stdandardin <<UNIQUE_STRING
stuff to be
read by the
command via
its standard input
UNIQUE_STRING
The typical convention is to use EOD for the unique string as in End-of-Data, but any string that will NOT occur in the body of the text starting in column 1 is fine. And keep the string simple, no spaces, tabs, funny characters, etc...
This is similar to putting all of the text between the <<EOD and EOD into a file and then invoking the command with:
anycommand_that_reads_stdandardin <file.with.data
The advantage of the here-document is that you do not need to have a separate file, or do a bunch of echo statements into file so you can pass it as input to the command, and then remember to clean up the temp file later.
In addition, the here-document allows shell substitutions to occur, which is just what you needed for your osascript work.
If you are intrested in shell scripting, you might spend some time in a book store, drinking coffee while browsing some of the books on learning bash, or if you can find it, "Learning Unix for Mac OS X Tiger". If you enjoy it and find any of the books useful to you, grab your credit card and head to check-out

Similar Messages

  • Pass arguments to javascript from plug in...

    Hi,
    I m using InDesign CS3 on MAC OS...
    I have a plugin calling a javascript. I need to pass a string value from the plug in to the script...
    I found that there is a parameter in the method RunFile in IScriptRunner.h for this purpose... But i don kno how to use this...
    virtual ErrorCode    RunFile(const IDFile& idFile, IScriptEventData* data,  bool16 showErrorAlert = kTrue, bool16 invokeDebugger = kFalse) = 0;
    where,
    @param data is used to pass arguments and return the result IN/OUT
    What does this  IScriptEventData* data carry???
    How to pass a string value as argument to javascript from plugin code and how to retrieve and use it there...
    Is there any sample code for this?
    Someone pls guide me...
    Thank you.

    Are there other command line options with extendscript, like compile to jsxbin etc.. Where is this documented?
    UDevp wrote:
    I used the below command to run script from command prompt, I'm able to run the script but not able to pass arguments to the script.
       "C:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit CS4\ExtendScript Toolkit.exe" -run "C:\Program Files\Adobe\Adobe InDesign CS4\Scripts\test.jsx"
    Any suggestion would be helpful..
    It may be possible to edit prefs file with command line and to check file in script.

  • How to pass arguments to script from plugin

    Hello there....
    I want to run a script from my plugin. To do this, I want to pass some arguments to the script. How can I do this? I also want to know how those arguments can be read in script?
    Thanks in advance..

    Here is a simple example of how to run some script code from a plug-in.
    InterfacePtr scriptManager(Utils()->QueryScriptManager(kJavaScriptMgrBoss));              
    if (!scriptManager)
         return;
    InterfacePtr scriptEngine(scriptManager->QueryDefaultEngine());
    if (!scriptEngine)
         return;
    InterfacePtr scriptRunner(scriptEngine, UseDefaultIID());
    if (!scriptRunner)
         return;
    RunScriptParams params(scriptRunner);
    scriptRunner->RunScript("alert('hello from planet script!');", params);
    Replace "alert(...);" with your own script.

  • Passing arguments to osascript from the command line

    I'm just learning how to use the Terminal at the moment and was wondering if anyone knew how to pass parameters from the command line to Applescript via osascript. I'm trying to use this as a function embedded in my .profile file so I don't have to type out the whole line each time I want to use an Applescript.
    Just as an exercise, I'm trying to get osascript to pass a string of text to a dialog box using 'tell application "Finder" to display dialog "$1" '. But all this does is open a dialog box with "$1" in it! Anyone know how to get this to work?

    Neyüm wrote:
    I'm just learning how to use the Terminal at the moment and was wondering if anyone knew how to pass parameters from the command line to Applescript via osascript. I'm trying to use this as a function embedded in my .profile file so I don't have to type out the whole line each time I want to use an Applescript.
    Just as an exercise, I'm trying to get osascript to pass a string of text to a dialog box using 'tell application "Finder" to display dialog "$1" '. But all this does is open a dialog box with "$1" in it! Anyone know how to get this to work?
    http://discussions.apple.com/forum.jspa?forumID=735

  • How to pass argument to the Java Plugin JVM w/o using the Control Panel?

    I want to deploy an applet to be loaded by the Java Plug In
    and fix some settings of its Java Virtual Machine.
    The JPI Control Panel offers two ways to pass arguments to the JVM,
    none satisfactory.
    1. while interactive via the Control Panel Window.
    This cannot be a solution for a deployed applet.
    or
    2. by editing the system generated file that stores
    the settings of the Plugin Control Panel, using a property
    named javaplugin.jre.params.
    The problem with this method is that if forces to access
    and edit this property file which is stored at various locations
    depending the client platform. Then, it may collide with other
    settings for other applets.
    Is there a way to pass the arguments to the JVM
    from within the html file?
    Has anyone found a solution to this question?
    JPS

    I am interested in this issue as well.
    Did anyone find a reliable way to specify the runtime parameters that should be used by the Java Plug-in in order to execute a given Java applet?
    I believe a good place to specify these runtime parameters would be the applet's JAR manifest: only digitally signed applets should be able to set the desired runtime parameters...
    Any comments / suggestion would be greatly appreciated.
    Regards,
    Marco.

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • How to execute adobe air app & pass argument from Flex ?

    Helo everyone,
    May i ask a question, How to execute adobe air app & pass argument from Flex ?
    Thanks in advanced.
    Jacky Ho.

    Hello Jacky,
    You can find an example here
    http://spreadingfunkyness.com/passing-parameters-to-adobe-air-at-startup/

  • How to pass arguments from PAPI to the process

    Can any one tell me How to pass arguments from PAPI to the process.

    The link Creating a new work item instance in a process using PAPI shows how to create instances on PAPI and pass in the variable information as they are being created.
    Provide some additional detail if you're interested in seeing how to pass in variable information using PAPI for scenarios other than instance creation.
    Dan

  • Passing arguments to the jsx file from command line

    Thanks for taking my question.
    I am using the following to be able to run my script from the command line.In case you were wondering on why i would be doing this- i would need to invoke the javascript from a server side code(like java,php etc. in my case it is java)
    "c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx"
    Anyways, i have been successful in running the myscript.jsx from the command line but i am not able to figure out how i could pass arguments to "myscript.jsx" from the command line, and be able to refer to these arguments within the script.
    I have tried the following
    "c:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" "c:\path to script\myscript.jsx" "argument1" "argument2"
    and tried to refer these arguments within the script using arguments[0] and arguments[1] . But looks like this does not work.
    Any thoughts?????

    To run JavaScript from the prompt using ExtendScript Toolkit 1.0.3 or 2.0.2 you need to do the following:
    Add the line #target indesign to the top of your script otherwise ESTK will open without executing the script. Example:
    #target indesign
    //MakeDocumentWithParameters.jsx
    //An InDesign CS2 JavaScript
    //Shows how to use the parameters of the document.open method.
    //The first parameter (showingWindow) controls the visibility of the
    //document. Hidden documents are not minimized, and will not appear until
    //you add a new window to the document. The second parameter (documentPreset)
    //specifies the document preset to use. The following line assumes that
    //you have a document preset named "Flyer" on your system.
    var myDocument = app.documents.add(true, app.documentPresets.item("Flyer"));
    //SaveDocumentAs.jsx
    //An InDesign CS2 JavaScript
    //If the active document has not been saved (ever), save it.
    if(app.activeDocument.saved == false){
    //If you do not provide a file name, InDesign will display the Save dialog box.
    app.activeDocument.save(new File("/c/temp/myTestDocument.indd"));
    Ensure Indesign is open. Execute the following command:
    "C:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" -run "[path to script]\script.jsx"
    For example:
    "C:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit\ExtendScript Toolkit.exe" -run "C:\Program Files\Adobe\Adobe InDesign CS2\Presets\Scripts\test.jsx"
    This command can be easily called from Java or any other third party application of your choice.
    It took me a while to find this information, so I thought I'd share it with everyone.
    Good luck!

  • Warning: passing argument 2 of 'setValue:forKey:' from distinct Objective-C

    I want to keep my projects warning free. In the following line
    [tempValues setValue:@"Some Text" forKey:[NSNumber numberWithInt:0]];
    the compiler complains with an
    "warning: passing argument 2 of 'setValue:forKey:' from distinct Objective-C type" warning.
    tempValues is an NSMutableDictionary.
    Any idea how to resolve this warning?

    Essentially, the typical rationale behind this particular warning is: The compiler must not let you write code that seeks to modify a non-modifiable object without giving some warning.
    Are you in effect trying to modify a non-modifiable object?
    Remember...(and I quote because I'm too lazy otherwise) "When you have a variable of type NSMutableArray*, then anyone would think that the array it points to can be modified. So if this variable contains a pointer to an actual non-mutable array, that would be a recipe for disaster, because any attempt to actually modify the array would fail in some way. For that reason, Objective-C must not just allow an assignment assigning an NSArray* to an NSMutableArray* variable.
    The other way round is harmless: Anyone looking at a variable of type NSArray* would think the array cannot be modified and therefore won't try to modify it. If the actual object is an NSMutableArray, no harm is done."

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

  • Passing arguments from Air to Photoshop jsx script

    I would like to invoke JavaScript file in Photoshop from my Adobe Air application. I managed to call my script with the following code:
    // Create native startup info
    nativeProcessStartupInfo = new NativeProcessStartupInfo();
    nativeProcessStartupInfo.executable = filePhotoshop; // File referencing Photoshop exe
    // Create Vector array to pass arguments
    procarg = new Vector.<String>();
    procarg.push("start");
    procarg.push(jsFileToCall);// String with path to my jsx file
    procarg.push(scriptData); // String with argument to pass to jsx file
    nativeProcessStartupInfo.arguments = procarg;
    // Create native process object for calling  executable file
    process = new NativeProcess();
    // SET ERROR HANDLERS
    process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA ,onError,false,0,true);
    process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR ,onError,false,0,true);
    process.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR ,onError,false,0,true);
    process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR ,onError,false,0,true);
    process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA ,onError,false,0,true);
    // CALL NATIVE PROCESS
    process.start(nativeProcessStartupInfo);
    The Photoshop app is started, my JavaScript is invoked, but the argument is not passed into jsx.
    Is there any method how to pass arguments to script in Photoshop? (I know that I can use the file to pass the parameters, but I do not like that solution.)
    Thanks in advance for any hint.
    Zdenek M

    The only documented way I know of is programming the script as a Photoshop Plug-in that has a dialog. Then record using the script in an action.  The script will record the arguments used in its dialog into the Photoshop Actions step.  Then when the action is used played the action recorded arguments are retrived and the script bypasses displaying its dialog. 
    However In CS3 I looked at Adobe Photoshop  Image Processor JavaScript it internaly used the Fit Image Plug-in Script and passed the width and hight to it. So it is posible to pass arguments from one JSX to an JSX Plug-in Script.
    From CS5 "Image Processor.jsx"
    // use the fit image automation plug-in to do this work for me
    function FitImage( inWidth, inHeight ) {
              if ( inWidth == undefined || inHeight == undefined ) {
                        alert( strWidthAndHeight );
                        return;
              var desc = new ActionDescriptor();
              var unitPixels = charIDToTypeID( '#Pxl' );
              desc.putUnitDouble( charIDToTypeID( 'Wdth' ), unitPixels, inWidth );
              desc.putUnitDouble( charIDToTypeID( 'Hght' ), unitPixels, inHeight );
              var runtimeEventID = stringIDToTypeID( "3caa3434-cb67-11d1-bc43-0060b0a13dc4" );
              executeAction( runtimeEventID, desc, DialogModes.NO );
    If You can write a file from Adobe Air you could also write the jsx file to pass the args you want to pass a to plug-in script via the ActionManager.

  • Cannot debug from Eclipse (Mac OS 10.7, Drive 3.01)

    I piggy-backed this on another discussion three days ago, but perhaps creating a new thread will get more attention.
    I recently downloaded the Adobe Drive 3 SDK and am having problems debugging the sample connectors from Eclipse.  I've followed all of the instructions in the documentation, but no matter what I try I cannot get my built connectors (both basicftp and helloworld) to show up when I try to initiate a connection in Drive 3.01.
    I am definitely checking (selecting) the bundles for these two samples in the run configuration, as well as all the dependant bundles ("Validate Bundles" passes successfully).  In the console, if I type 'ss' I see both of the samples listed as ACTIVE.  I launch Drive after I see them as active.
    I tried typing 'csstat' in the console but that does not seem to be a recognized command (per the documentation).
    When I launch Adobe Drive 3.01 I only see the two out-of-the-box connectors (DAM and CMIS).
    If I do a proper build and export to the CS5ServiceManager directory, they do show up in Adobe Drive.  However, I really need to be able to run from within Eclipse to debug.
    I've followed the troubleshooting steps and killed the CS5ServiceManager and Adobe drive processes using Activity Manager (I'm on a Mac OS 10.7 Lion) and also deleted the 'data' folder, rebooted, no luck.
    I even tried doing a clean installation of everything on another machine, and had the same problem.
    Please help or suggest something else to try.  Thanks!

    Thanks so much for the suggestions.
    I haven't tried the 32 bit JVM yet, but your comments got me thinking about which bundles I have selected in my run configuration.  When I first tried selecting ALL bundles, I got an error when launching:
    The bundle could not be resolved. Reason: Missing Constraint: Import-Package: com.adobe.versioncue.serialization; version="0.0.0"
    To correct that, I had gone back to the run configuration, cleared all bundles, and pressed the "Add Required Bundles" button.  This only added a small subset of all bundles, but got rid of the validation error.
    I now went back and selected all bundles, despite the validation error, and now I am successfully able to launch the sample.basicftp bundle from Eclipse on one of my two machines.  The other one doesn't work, and when I go type 'ss' I see one of the bundles seems to get stuck in the STARTING state:
    com.adobe.csi.bootstrap_2.0.0.201003221714
    I can probably continue working with my one working machine, but something still doesn't seem right.
    1)  Should I be seeing that "Missing Constraint" error above?  If not, then where do I find the bundle that it is looking for?
    2)  Any idea why the com.adobe.csi.bootstrap is getting stuck in the STARTING state.
    Once again, thanks so much for your help!

  • JVM (from C++) won't recognize security policy

    I can't get the JVM to recognize a security policy file when the JVM is invoked from C++.
    Using the Invocation API of JNI from C++ (in W2K) I am creating a Java object which then sets
    an RMISecurityManager. I am passing the location of my security policy file in the JavaVMOption
    array :
         options[opidx++].optionString = "-Djava.security.policy=\"d:\\jini1_1\\policy\\policy.all\"";
    The JVM starts fine, and the object gets instantiated, but once the RMISecurityManager is set,
    the code no longer has permission to open files or sockets, etc etc. This would indicate that the security policy is not allowing permissions - but the policy file actually has the following:
    permission java.security.AllPermission "", "";
    (This "promiscuous" policy is just for testing.)
    My problem seems to be that in spite of the explicit security policy being passed to the JVM, it is being ignored. This only happens if the code is run from the C++ program. Using the same code and same command line argument for the policy file, everything works fine if it is run as a Java program separately.
    What is the special incantation required to get the JVM to recognize a security policy file when it is invoked using the JNI Invocation API?
    Thanks

    Fixed!
    The problem was the additional, inner set of quotes, which were cut and pasted from the batch file used to call the Java program from the command line.

  • Passing arguments to Managed Server ServerStart when using Node Manager

    Below is the procedure to pass arguments to Managed Server serverstart tab when using Node Manager to start and stop the Managed Server instance
    For passing the JVM arguments we will have to use "-server" which is hotspot and then pass the arguments
    for eg: "-server -Xms2048m -Xmx2048m -verbosegc"
    For adding jar's to the classpath you will have to add weblogic.jar and weblogic_sp.jar from WL_HOME/server/lib directory as well along with the custom jar (In some cases we can ignore weblogic_sp.jar, just adding weblogic.jar will do).
    for eg: "\home\user\debug.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic_sp.jar;"
    - - Tarun

    Hi,
    To me, if you don't wanna use the NodeManager, you won't be able to start your managed servers with WLST.
    I guess the only ways are :
    * through the console / WLST using the NodeManager
    * using the startManagedWebLogic.[cmd/sh]
    Regards

Maybe you are looking for

  • After pacman -Syu upgrade xfce boots black screen cursor

    Hello, I've recently upgraded the system with pacman -Syu and it seem something has gone wrong with new xfce 4.12. I have changed DM from slim to lxdm and can only boot to openbox but not xfce. I also switch to tty2 and try a startx with ~/.xinitrc f

  • Adobe Acrobat X Standard quits unexpectedly after 7-10 seconds

    Adobe Acrobat X Standard quits unexpectedly after 7-10 seconds.  I've tried updating and uninstalled and reinstalled the program.  I can create pdf's but can't view them fpr more than 7 seconds.  Also the check for updates under the help command read

  • Do adcfgclone.pl with datafile divided into multiple disk storage

    hai all , i do adcfgclone.pl in database note , but i confused how to define Target System DATA_TOP Directory 1 : if i have datafile that divided into multiple disk storage. Log file located at /oracle11/PROD/db/tech_st/11.1.0/appsutil/clone/bin/Clon

  • Iphoto won't shut down

    I am unable to get iphoto to quit. It keeps saying there is a burn in process and to please stop burn before quitting. I have completed the very small burn to a CD that I did, ejected the CD to no avail. This is very frustrating.

  • Why is my ipad backup taking over an hour to update to ios 5?

    I have tried for several days now to update my ipad to the ios 5 software.  Each time I plug in to start the process the "Backing up iPad" stops at about 2% of the install.  It's been at that point for 3 hours now with no movement.