Acees JAVA program through JavaScript

Am working on to develop a mozilla extension that has something to with the history of urls browsed.
I did the backend coding in JAVA.
The tutorials I looked on the web for developing mozilla extensions use JavaScript as the language to program the backend.
Please suggest me a way out to use my already developed program module which is in JAVA. My program contains external libraries like WordNet and Lucene.
Is there anyway I can access the program in JAVA through JavaScript
Thanks

I heard that this app can make this
sigh Of course. Some magic that can let the servlet execute Javascript code that doesn't even exist yet because it still has to be produced and served, and that can help Javascript on the client to access an object on the server that's long GCed.
Same answer applies, even with J2J: the Javascript has to talk to an applet.

Similar Messages

  • How to call java program from javascript

    Hi,
    I have an java program which will transform one xml to another xml using XSLT.
    I want to call this java program from Javascript? Is this possible? Please suggest me.
    Thanks,
    Gopal

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • Running Java programs through a GUI

    Hi All.
    I have a Java GUI which compiles and runs other Java programs through the use of JButtons.
    The user clicks one button to compile and another to run. Compile is running fine but Run is slightly odd.
    When I click the Run button the Java program does not run until I minimize the GUI or switch to another window or application.
    So for example I click the Run button, nothing happens, I then alt+tab or minimize to say NetBeans (which I am using to develop it) or an IE window. The program then runs successfully
    My method for running the program is:
    public void clickRunProgram() {
            try {
                Runtime r = Runtime.getRuntime();
                r.exec("cmd /c java Testing");
            catch (IOException ex) {
                Logger.getLogger(ProgrammingEnvironmentGUI.class.getName()).log(Level.SEVERE, null, ex);
        }Any ideas?
    Cheers.
    Edited by: lobrien9 on 25-Mar-2008 12:57

    You must give the process its input and get its output or it won't run. Try something like this:
            // create the process to test
            Process acm = Runtime.getRuntime().exec("cmd /c java Testing");
            // send input
            PrintWriter processOut = new PrintWriter(acm.getOutputStream());
            processOut.print("input");
            processOut.flush();
            processOut.close();
            // get output
            StringBuilder givenOutputBuilder = new StringBuilder();
            BufferedReader processIn = new BufferedReader(
                    new InputStreamReader(acm.getInputStream()));
            String line = processIn.readLine();
            while (line != null) {
                givenOutputBuilder.append(line + "\n");
                line = processIn.readLine();
            }

  • Can we able to run java program inside  javascript

    Hi all
    can we able to run java program inside javascript or integrate java with javascript.....whether its possible...

    No. You can't execute Java code from within a JS script in Acrobat/Reader.

  • How to call java program through ODI

    Hi,
    I have written java program which i want to run though ODI.My questions are as follows:
    1. At which place i need to put my code and jar files i.e. do i need to put my code on the machine where ODI is installed?
    2. which technology to use i.e. jython or java bean shell.
    3. Commands format for jython or java bean shell.
    Is there any book or forum to which i could refer to get a deeper knowledge about these as i am new to ODI.
    Thanks
    Abhi

    881195 wrote:
    Hi,
    I have written java program which i want to run though ODI.My questions are as follows:
    1. At which place i need to put my code and jar files i.e. do i need to put my code on the machine where ODI is installed?You need to place the JAR file at ODI's driver folder.
    2. which technology to use i.e. jython or java bean shell.You can use Jython or Java bean shell . I prefer Jython .
    3. Commands format for jython or java bean shell.In your procedure , set the technology to Jython .
    Write normal java commands ... like
    import <your_class_name>
    <you operation etc>
    >
    Is there any book or forum to which i could refer to get a deeper knowledge about these as i am new to ODI.
    Thanks
    Sutirtha

  • How i load java class through javascript

    Hi,
    i want to load java class file at client side through the java script. Class file wich already at client side(client machine)
    tell me is it possible....
    thanks
    plzz mail
    [email protected]

    From your post it is not very clear what you want to do.
    1. Even if it was possible to load client classes using javascript, how on earth are you going to execute them ??? JavaScript and java are entirely different cups of tea.
    2. If it was an applet, then probably you can access some classes from the client machine. Definely the default packages. However, I don't know whether you can access other classes. That might lead to a security issue. Please check with a java securities expart.
    3. Loading a class from the client machine is DEFINITELY A BAD PROGRAMMING PRACTICE Use the codebase property on your applet tag to load the classes from the server.

  • Accessing java objects through javascript

    anybody know a how to get an image from java to javascript... example you get an image from a scanner through java... and then want to use it in javascript

    anybody know a how to get an image from java to
    javascript... example you get an image from a scanner
    through java... and then want to use it in javascripthttp://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/java_js.html

  • How can I open a java program through another program?

    Can someone tell me what's wrong with my code?
    <CODE>
    String thisFile = "javaw -classpath D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar directlink.DirectLink";
    try {
    Runtime.getRuntime().exec("cmd /C start " + thisFile);
    catch (Exception e) {
    </CODE>
    This code will handle other programs however I don't know how to write it so it will work with calling another class.

    Yeah, I made sure it was in the path. I even used the
    exact command from a command prompt. Well almost, I
    had quotes around the classpath.
    Eh? Quotes around the classpath? Sorry if I was being unclear. What I mean is when I call this from a command prompt I put double quotation marks around the classpath like so:
    javaw -classpath "D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar" directlink.DirectLink
    In the code on top I wrote it as a string and there were no quotation marks around the classpath.
    However, I'm not
    sure if I can use single quotes with java to simulate
    this or whether I can use a \" in it's place.
    I'm not sure what you're saying...but note that when you call exec you're not passing control to the shell, ?>so shell metacharacters are not interpreted.Once again sorry for not being clear. What I meant was I didn't know if I could write it like this:
    tempString = "javaw -classpath \"D:/DirectLink/classes;C:/JBuilderX/jdk1.4/jre/lib/rt.jar\" directlink.DirectLink"
    And whether this would work. All I really was asking is how can I pass the command to cmd so it will interprete it as it did when I entered it in manually before. I wanted to pass the command to cmd with double quotation marks around the classpath because that's how I did it earlier. I just wasn't sure how to do it.
    What I'm wondering is since it's a java class is there a
    better way to call it especially since executing
    commands seems to be different between different OS's?
    You can invoke it directly. Why did you decide to create a new process?Frankly, I don't understand the command very well. I haven't had to use it before and I'm really just trying to get a feel for it. I usually like to get something working, play around with some options, get more of a hands on feel. Then I usually will do more research on it. I was looking at some posts on the exec command and I tried a few of them and this one worked for me when it came to opening apps so I decided to give it a try.

  • How execute java program through crontab in linux

    i have written in crontab like
    * * * * * cd /usr/java/jdk1.5.0/bin;pwd;echo $PATH; ./test2.sh 2>logjava1
    test2.sh contains
    java samle
    in logjava1 the error is java :command not found
    Please help me .this is not working

    Is . in your path?
    I'd add the JDK Bin folder into your path

  • Running Java Program Through Terminal

    Situation in Eclipse:
    package name: test
    class name: example
    I go into the package and after compiling, I do... java example, but I get an error. Then I take it out of the package and it works. How do you do this with the package name?

    Error message:
    Exception in thread "main" java.lang.NoClassDefFoundError: Welcome (wrong name: chapter1/Welcome)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)I am in ..eclipse_workspace/my_projects/chapter1 where the compiled classes are.

  • How Can I execute a java program using java code?

    {color:#000000}Hello,
    i am in great trouble someone please help me. i want to execute java program through java code i have compiled the java class using Compiler API now i want to execute this Class file through java code please help me, thanks in advance
    {color}

    Thanks Manko.
    i think my question was not clear enough.. actually i want to run this class using some java code . like any IDE would do i am making a text editor for java, as my term project i have been able to complie the code usign compiler api and it genertaes the class file but now i want to run this class file "THROUGH JAVA CODE" instead of using Java command. I want to achive it programatically. do you have any idea about it.. thanks in advance

  • Calling java program in bipublisher

    Hi,
    Like we have datamodel types in BIPublisher as SQL Query, Webservice, Answers, File etc,, Can we call java program through bipublisher.
    The requirement is:
    A java program will generate BARCODE image based on the customer number given.
    We need to create a template in bipublisher which shows the customer name and that barcode image and other details.
    We have calling javaprograms in ibots in analytics, is there any such thing in bipublisher.
    Thanks.

    You can call PL/SQL programs from OWB either by defining transformations or as expressions. From PL/SQL you can call a java stored procedures in the database as follows:
    1. Define the java stored procedure. For example, let's suppose that you store the following Java class in the database:
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class Adjuster {
    public static void raiseSalary (int empNo, float percent)
    throws SQLException {
    Connection conn = new OracleDriver().defaultConnection();
    String sql = "UPDATE emp SET sal = sal * ? WHERE empno = ?";
    try {
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setFloat(1, (1 + percent / 100));
    pstmt.setInt(2, empNo);
    pstmt.executeUpdate();
    pstmt.close();
    } catch (SQLException e) {System.err.println(e.getMessage());}
    2. The class Adjuster has one method, which raises the salary of an employee by a given percentage. Because raiseSalary is a void method, you publish it as a procedure using this call spec:
    CREATE PROCEDURE raise_salary (empno NUMBER, pct NUMBER)
    AS LANGUAGE JAVA
    NAME 'Adjuster.raiseSalary(int, float)';
    3. Call procedure raise_salary from an anonymous PL/SQL block, as follows:Long postings are being truncated to ~1 kB at this time.

  • A Webservice and  a Standalone Java Program Integration

    Hi!
    I need a JAX-WS webservice that would invoke methods of a standalone java program .
    Is it possible to implement it?
    Is there a better way than communication with the standalone java program through RMI?
    Thanks!

    javax.swing.JEditorPane

  • Running Java programs ?

    Hi,
    I have installed jdk1.1.8 on my win xp pro machine. I have set the classpath in the enviroment varibles like this..
    CLASSPATH=C:\JDK1.1.8\lib\classes.zip
    when i run a java program through an IDE program like JBuilder it works fine, but when i try to run it through the command promt with
    java myprogram
    it says that java isn't a commando or something....
    What to do ???
    Thanks
    Robin

    Hi, may you explain in detail what are the steps in setting the path & classpath in order to use JDK1.1.8 ?
    i tried using the following steps for JDK1.3.1_06 in my WinXP it works, but not for JDK1.1.8 in winXP where error compiling occurs. I'm restricted to use JDK1.1.8..please kindly advise.
    Setting use for JDK1.1.8 (in winXP) but with ERRORs in compiled:
    set JAVA_HOME=c:\jdk1.1.8
    set PATH=%PATH%;%JAVA_HOME%\bin
    set CLASSPATH=c:\jdk1.1.8\dev;
    [For JDK1.3.1 (in winXP) i use similar to above except chging to Jdk1.3.1 and no error in compiling]
    Error encountered for JDK1.1.8 :
    java.lang.NullPointerException
    at java.util.Hashtable.put(Compiled Code)
    at java.util.zip.ZipFile.readCEN(Compiled Code)
    at java.util.zip.ZipFile.<init>(ZipFile.java:61)
    at java.util.zip.ZipFile.<init>(ZipFile.java:71)
    at sun.tools.java.ClassPath.<init>(Compiled Code)
    at sun.tools.javac.Main.compile(Compiled Code)
    at sun.tools.javac.Main.main(Main.java:465)

  • Getting java program to run (really basic)

    Hi,
    I'm used to running java programs through the programs I write with, like Eclipse, but now I'm trying to run a program on a compuyer without those things and I'm stuck.
    I'm running Windows XP and have downloaded the SDK Version 1.4.2, The java.com website says I have the latest software, everything is up to date.
    All the sites I see say that the way to run a program is to use the 'javac' command from the command prompt. However, doing this (with or without a file name appended) gives me the error: 'javac is not recognized as an internal or external command, operatable program or batch file.'
    What do I need to do to run a simple java program from a bunch of .java files?
    Help much appreciated, thanks.

    All which instuructions?
    1. I've followed all the instructions at 'Installation Instructions', http://www.java.com/en/download/help/5000010300.xml. They have instructions to
    .A: Download and Install: All done.
    .B: Enable and Configure: They say it only relates to browsers and applets
    .C: Test installation: Test comes out positive.
    2. The files that were downloaded: Contain no instructions
    3. All the 'Enable' instructions found here: http://www.java.com/en/download/help/index_configuration.xml
    These relate to:
    .A:Switching between Microsoft VM and JRE
    .B:Enabling JRE for browsers and Applets
    .C: Clearing the cache
    .D: Viewing the console,
    etc etc. None of them seem to be about setting a path.
    Can you tell me which instructions you mean?
    Thanks

Maybe you are looking for