Can i invoke a function of a compiled script from java?

Hi,
Can i invoke a function of a 'CompiledScript' from java with parameters?
TIA

sabre150 wrote:
I don't know about anyone else but I don't understand what you are trying to do.<Goldie mode>
Bwahahaha, you are one of the oligarchs here and yet you don't know what Compiled Scripts are? Even Chaucer wrote about them, which the Queen of England told me when we shared a kebab in my working-class pals' kebab shop.
</Goldie mode>

Similar Messages

  • Calling C Functions in existing DLL's from Java

    Hi Guys ,
    The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
    regards
    murali

    What you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
    The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
    If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
    Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
    You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-)

  • Invoking a bash shell script from Java code

    Hi All
    I am trying to invoke a Bash shell script using java code. The arguments required are "source wmGenPatch <source dir> <destination dir> no_reverse.
    in the code I have specified the arguments considering the cannonical paths of the files as the code may run on Unix or windows platform.
    I am getting a error while invoking Runtime.getRuntime().exec(args). The error is as follows :
    "The Error Occurred is: CreateProcess: source D:\Package4.0\workspace\DiffEngineScripts\v4a02\wmGenPatch D:\Package4.0\workspace\fromImageFilesDir\ D:\Package4.0\workspace\toImageFilesDir\ no_reverse error=2"
    It seems that error=2 indicates that the 'file not found' exception. But i can see the directories referred to in the error at place in the workspace.
    Kindly advice.
    Thanks in advance.

    Hi All
    I am pretty new to invoking bash shell scripts from java and not sure if i am progressing in right direction.
    The piece of code tried by me is as follows
    try {
                   currentDir = f.getCanonicalPath();
              } catch (IOException e) {
              if (currentDir.contains("/")) {
                   separator = "/";
              } else {
                   separator = "\\";
              String args[] = new String[7];
              args[0] = "/bin/sh";
              args[1] = "-c";
              args[2] = "source";
              args[3] = currentDir + separator + "DiffEngineScripts" + separator
                        + "v4a02" + separator + "wmGenPatch";
              args[4] = sourceFileAdd;
              args[5] = destFileAdd;
              if (isReverseDeltaRequired) {
                   args[6] = "reverse";
              } else {
                   args[6] = "no_reverse";
              try {
                   Process xyz = Runtime.getRuntime().exec(args);                              
                   InputStream result = xyz.getInputStream();
                   InputStreamReader isr = new InputStreamReader(result);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   while ( (line = br.readLine()) != null)
                        System.out.println(line);
                   int exitVal = xyz.waitFor();
                   System.out.println("Leaving Testrun.java");
              } catch (Throwable t) {
                   t.printStackTrace();               
    and on running the same i am getting Java.io.IOException with the stack trace
    java.io.IOException: CreateProcess: \bin\sh -c source D:\Package4.0\workspace\DiffEngineScripts\v4a02\wmGenPatch D:\Package4.0\workspace\fromImageFilesDir\ D:\Package4.0\workspace\toImageFilesDir\ no_reverse error=3
    kindly advice
    Thanks in advance

  • Invoking unix shell scripts from java?

    Hi,
    could someone explain to me how one wuld invoke unix shell scripts from java.
    Also, could you invoke Visual Basic scripts from java.
    Finally, could you do this from an EJB?
    thanks for any help....
    sudu

    I just posted a snippet of this solution in the topic about widows commands chech it out it works just fine for unix shell scripts.
    --Ian                                                                                                                                                                                                                                                                                       

  • Can i use malloc function while using DLL created from C program

    Hi,
    I have written a simple program in C , which uses malloc function for allocating memory for the array.When iam calling that DLL using call library function node in labview, it is not giving any output, my doubt is can we use malloc function in C program from which we will create DLL and is called in labview? I am attaching my C code and DLL and also labview file please tell me where i am doing wrong?
    Thanks & Regards,
    Vishnu
    Attachments:
    first.zip ‏1010 KB

    Hi Vishnu,
    There's no problem using the Malloc function in C and call it as a DLL in LabVIEW.
    But LabVIEW has a different memory management than C.
    It is probably not recommended to allocate array memory in C for labVIEW arrays
    You can use initialize array in LabVIEW instead.
    Good luck
    Van L
    NI Applications Engineer

  • How to call c functions that expects c structs from java program?

    i need to call from my java program to c functions that get
    c structs as a parameters in their prototype.
    as you probablly know java is not working with structs (classes only), so my question is how can i do it , i mean call the c functions that gets structs as parameters form java????

    i believe your c function can accept a jobject and then inside your c function you have to translate that jobject into a c struct by using the jni methods.
    the only reason your c function cant accept structs from java is because java does not have such structures. your c function can accept any data type that has been defined and a jobject has been defined.
    if you have no control over the c functions that are being called, you need to write a wrapper function for those c function. the wrapper functions do the translation from jobject to a struct...then call the c other c functions.

  • Need to create a function to receive binary files from Java WebDynpro

    Hey,
    I need to recieve files from java Webdynpro and save them as a file on the backend
    system. After that, the file will be loaded to the documentum.
    In a function module, I only can get the files as a String. Therefore (I think), I need the
    binary file as base64 encoded. Otherwise I can´t get it as a string.
    Now I need to decode it in the backend, but how? I know, there are HTTP-classes
    in newer system, but not in the 4.6C System, I have here.
    Any idea, how I can recieve the files in the function module and transfer it as binary
    file to the backend system?
    If I load a file from the gui with gui_upload, I get the binary file as an internal table
    and can transfer it to the backend filesystem now. Maybe I can get the binary file
    in this way in the function?
    Thank You for Your help!
    Arne

    http://jakarta.apache.org/commons/net/

  • Invoking JavaFX script from Java

    Hi,
    Just started working on javafx and got the error below while trying to invoke javafx from java.
    /******************** my java code *************************/
    package fxexamples;
    import javax.script.Bindings;
    import javax.script.ScriptContext;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineManager;
    import javax.script.SimpleScriptContext;
    import javax.swing.SwingUtilities;
    public class RunFX {
         public static void main(String[] args) {
              final DataObject myObj = new DataObject();
              Runnable fxScript = new Runnable() {
                   public void run() {
                        ClassLoader loader = Thread.currentThread()
                                  .getContextClassLoader();
                        ScriptEngineManager manager = new ScriptEngineManager(loader);
                        ScriptEngine engine = manager.getEngineByExtension("fx");
                        String script = "import fxexamples.FXtoJava;";
                        try {
                             engine.eval(script);
                        } catch (Exception ex) {
                             ex.printStackTrace();
              SwingUtilities.invokeLater(fxScript);
    /*****************my fx file **************************/
    import javafx.stage.Stage;
    Stage {
    title: "Die, Ajax! - Hello World"
    width: 250
    height: 50
    /*******************stack trace********************/
    javax.script.ScriptException: compilation failed
         at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:260)
         at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:149)
         at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:140)
         at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
         at fxexamples.RunFX$1.run(RunFX.java:30)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thanks in advance.

    I too, am having problems with using JSR-223 to use JavaFX script from within Java, specifically using Java FX 1.1 and Java 6. Please see:
    http://forums.sun.com/thread.jspa?threadID=5373145

  • How i can set the selected item of a dropDown component from java code

    Hi
    Thank you for reading my post
    How i can set the slected item of a DropDown component from backing beans java code ?
    it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
    In back code i have both value and display values to use them .
    can some one give me some help ?
    Thanks ,

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • Invoking Shell Script from JAVA Stored procedure

    I am trying to invoke shell script using Java Stored procedure.
    When I run my java class outside of oracle using oracle user
    account it works but as soon as i load it into database and try
    to inovoke that class using PL/SQL wrapper it runs java class
    but is not able to invoke the shell script. Any ideas would be
    greatly appreciated.

    Pleass search the forums for "runtime" as there are many threads and examples already posted.

  • Invoke a shell script from java

    hi all
    does anyone know how to invoke a shell script from your java program?
    thanks
    udam

    Use Runtime.exec(), make sure your script is executable, and make sure it starts with something like #!/bin/sh

  • How can I compile Javascript from Java??

    Hi all,
    I am facing a problem, problem is I have to compile JavaScript code in Java. JavaScript code will given in Text field, those code i have to compile and i should display a message saying this is valid Java script code or Invalid code.Can anyone help on this...

    JavaScript code interpreting but not compiling... I need to compile, but not Interpret the code. How can i Compile the JavaScript Code...

  • Can't perform any functions on my new drive from Raid admin?

    I had a drive go bad in my Raid, (amber light) raid admin stated that the array was degraded and the drive was unknown.
    I ordered a new drive (same type of drive) inserted new drive and a red light was above disk slot and the data would not rebuild automatically. In Raid admin it stated that the drive was not installed but that the disk was online in the events log. (that seemed conflicting to me)
    I placed the old disk back in just for giggles to see if I could do anything with rebuilding parity data and none of the functions in the utility will let me do anything, Raid admin only shows that I have 3 disks in my array. It will not include the 4disk as part of the array. It says alredy belongs to ma raid set but will not let it be included with raid 1
    If I have another disk go bad I am sunk.
    I am fairly new at messing with raid set ups. I know we are set up with a RAID 5 with 4 disks.
    I am just nervous to do anything with the data I already have thinking I am gonna wipe something out.
    Any suggestions would be great.

    Have you read this post?  may help you
    https://discussions.apple.com/message/18149044#18149044

  • How can I invoke a JSP using a URL instance from another JSP?

              Hi all.
              I've been developed a J2EE application using Oracle 9iAS.
              Now I'm migrating to WL Server and I have the following problem.
              I was using the following code to read a URL contents from another JSP:
              URL url = config.getServletContext().getResource("/path/to/url/of/textfile.xsl");
              This was working fine in a expanded directory project structure (typical during
              development time) and Oracle 9iAS.
              When I execute this code from my WL packed .ear file I get a URL not found exception.
              Which is the right way to get a resource available from the same context root?
              Thanks in advance for your answers (and sorry for my bad english ;-))
              

    The previous owner of that machine should have wiped it and install the original OS that shipped with the system leaving the system at the point where the new owner takes over and enters all there own information.
    Before you go much further with this machine you should seriously consider backing up any new stuff you have done and wiping it and starting from scratch. If you keep the system like it is you  will be plagued with problems. Even doing OS updates will prove frustrating.
    Right now the best you can do is to move the Aperture that is on the system into the trash, log into the App Store using your ID and buying Aperture. That should work but to be honest I have never had to do it so can;t say for sure.
    You might want to look at this What to do before selling or giving away your Mac from Apple to read what they recommend.
    good luck
    regards

  • Calling a function in an EXE file from Java Program

    Hi Im having a function which is written in c program.i need to call that function from my java program, if i create a shared library (DLL) for my C code then it works but my requirement is i dont want to create that DLL , like in it would be an executable and my java code should access that function in that C program

    I understand the usage od a DLL but the thing is if i convert the exe to a DLL
    the server doesnt start at all so what i need is that i dont want to change
    that .EXE into a .DLL,let it be an executable. that executable is in running mode
    and through my java program i need to call a function in that EXE file.
    Is ther any way to do it?Nope, but you have another problem: why can't you separate your server program
    into a .dll part and a startup part? Both, when properly linked against each other
    should give you an executable file.
    kind regards,
    Jos

Maybe you are looking for