How to execute mimetex in java program

hi,
I am working with an application which has a chat window with a feature of displaying mathematical equation with the help of mimetex. Basically I want to know that how I can call a program like mimetex with some parameter that it takes and find the output for same.
thanx
manoj

You may be able to call WsImport's main() method from your code, something like this:
import com.sun.tools.ws.WsImport;
String[] args = {"put", "your", "arguments", "here"};
WsImport.main(args);(Make sure that the webservices-tools.jar file is on the classpath, since that's the one containing the WsImport.class file - you'll probably need the other webservices jars too).

Similar Messages

  • How do i run a java program an another directory?

    How do I run a java program that's in a different directory?
    I have been doing this in the command line:
    java "C:\Document and Settings\freeOn\Desktop\Java\Test\test"
    and I get
    Exception in thread "main" java.lang.NoClassDefFoundError:
    C:\Document and Settings\freeOn\Desktop\Java\Test\test
    I just thought there might be a quick way to do this and not
    have to cd to the following dir evertime i want to run an app in
    console.
    The test.java file is this:
    import java.io.*;
    public class test {
        public static void main(String args[]) {
          System.out.println("Testing.....");

    Ok I looked in the java help and found the classpath, this makes it alittle easier.
    java -cp C:\DOCUME~1\freeOn\Desktop\Java\Test\ test
    At least i can run this in the run dialog which makes it easier thanks for you help kota balaji

  • How can you get a java program working on a cell phone?

    I was thinking of making some stuff for cell phones so i was wondering how you get a normal java program to work on cells.

    its all j2me - midlet package....Huh? The jsr-118 MID profile alone has 11 packages, one of which is javax.microedition.midlet. Notj2me - midlet.
    works best on nokia phones.Sez who? You seem to be confusing Java ME with Symbian C.
    you can use net beans midlet packge add-on.Only it's called the NetBeans Mobiliity Pack.
    Its easy to use and has lots of tutorials.Ditto for the Wireless toolkit for CLDC.
    just search on google.Yes, but with which keywords?
    @OP:
    NetBeans mobility pack comes with a short tutorial and several samples, you also need to download the latest WTK as the ver. 2.2 which comes bundled with NetBeans is just too buggy to work with. Then there are the manufacturer-specific SDKs from Nokia, Motorola, Sony Ericsson and (maybe) others.
    If and when you get started in Java ME aka j2me, it will be appropriate to post any questions you might have on the mobility forums, not here.
    Google "j2me tutorial" for many good hits.
    luck, db

  • How can i  apply this  java program for  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }//my text file name is: "input.eqn" (given below)
    input:Enter Value1:arg1
    input:Enter Value2:arg2
    input:Enter Value3:arg3
    constant:arg4
    constant:arg5
    Equation:arg1+arg2+arg3
    result:

    how can i apply this java program for a jsp pagewhy do you want to do this ?
    Your program reads from a file on the disk and formats based on a patterm.
    Jsp is not intended for such stuff.
    ram.

  • Methode who execute an other java program

    Hi!
    Is there anyone who know a method who can execute an other java program from an applet?
    Thanks
    Julien

    Depends where the classes of the other program are located. A java program is just a collection of classes, with one particular one regarded as the main one. If you know the main class of the other program at compile time you can just invoke it like any normal method.
    Something like:
    MyOtherProgram.main(new String[]{"first parameter", "second parameter"});(assuming that it's just a standard "command-line" kind of program.)
    If you don't know the class name at until runtime it's still farly straightforward:
    something like
    import java.reflect.*;
    String theOtherProgram = ......
    Class otherP = Class.forName(theOtherProgram);
    String [] params = {"first parameter", "Second parameter"};
    Method theMain = otherP.getMethod("main", new Class[]{params.getClass()));
    theMain.invoke(null, params);

  • How can i run my java program with out java language

    Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
    any one can help me??

    Hai to every one ..Iam new to java language ...am
    using windows xp operating system , i did not
    installed java language in my system .. how can i run
    a java program with out installing java language...
    you ... can ... not ... do ... this
    Which files is requied to run java program..?
    any one can help me??a JVM. Download it from sun's website.
    [url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here

  • How can I use a Java program to write an executable Applescript

    I'm using a PC with Windows XP. I'm a private developer. I've written a project in Java and wish to deploy it to other people using email. I've written an Install program (the Main-Class) and successfully packed this in a jar file with the project class files and some data files all as described in the deployment trail in the Java Tutorials. A recipient with a Mac with OS X downloads the jar file and runs it to install the project class files and some data files. The install program then writes an Applescript file (Vocab.scpt shown below) on the Desktop to make starting my downloaded program easier but it doesn't seem to work and I think it may be because the script file is not "executable". Could this be the case? If so, how could I change my install program to make the script file executable or alternatively use some other system to start the downloaded program?
    Vocab.scpt:-
    # Script to start: Vocab Version: 1.0.0
    do shell script "cd /Applications/Vocab; Java Vocab"
    Many thanks for your interest. Unfortunately I don't have a Mac to experiment with this problem and although I have spent some days on and off trying to find an answer in the mass of information available on Apple's website I can only find small clues here and there to answer my problem (which I would have thought was quite a common one). In Windows a batch file (eg. Vocab.bat) is automatically executable.

    I didn't expect you to have your customer run the command. I would expect you to create the executable and install it. However, there wouldn't be any difference in what you are creating and the .jar file. Either way it is a faceless icon. For that matter, it is no different than a batch file on Windows. I'm not sure what they wouldn't understand with, "copy the Vocab.jar file to wherever you want and double-click it to run the program." In addition, you probably ought to point out that Java is not installed on Mac OS X Lion (10.7.x) and when they double-click the jar file (or whatever you send them), the system will ask if they want to install Java.
    What you really need to do is package up the app inside a Mac application package and provide the user with the application on a .dmg (disk image). Take a look here: http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Jar_Bundle r/Introduction/Introduction.html#//apple_ref/doc/uid/TP40000884
    I also found this which uses ANT to create the bundle: http://informagen.com/JarBundler/

  • How to launch executable from a java program

    In c++ we can use a function WinExec to execute exe from a c++ program.
    Is there a way to launch executables using java program. Lets say I have one executable with name "myexecutable.exe" and a java program "myprogram.java". How can I launch "myexecutable.exe" from the java program.
    Is there a way to do this in Java?
    Vijay

    >>
    class LoadExecutable
    static void loadProcess()
    Runtime r = Runtime.getRuntime();
    Process p = r.exex("winword.exe");
    public static void main(String args[])
    loadProcess();
    }Regards
    - ManikantanBoth of these aren't good ideas - neither of them
    deals with the input or output streams at all.
    Everyone who's posted to this thread should read this.
    None of you knows how to use Runtime.exec properly:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-t
    aps.html
    MOD
    Thanks for the tips
    -Regards
    Manikantan

  • How to execute an external executable in my java program?

    hi,
    i want to write a java program to execute some external executables.
    for example, i had an executable which takes a string as its input parameter, and:
    it writes to stdout a string : "[stdout] hello, "+parameter+"!";
    it writes to stderr a string : "[stderr] hello, "+parameter+"!".
    and it exits with an error code 1.
    my java program looks like this:
    public class Test {
      public static void main(String[] args)
      throws Exception {
        String inputParameter = "heavyz";
        String stdoutOutput = null;
        String stderrOutput = null;
        int exitCode;
        // Do something here to launch the executable,
        // providing inputParameter as its input,
        // getting its stdout output to String stdoutOutput,
        // and its stderr output to String stderrOutput,
        // and its exit code to int exitCode.
        return;
    }anybody can help me to complete the program above?
    thanks a lot.
    heavy ZHENG

    check out Runtime.getRuntime().exec();

  • How do you change a java program to a single file executable file?

    Hey guys I'm back with another new to java question :)
    i would like to have my java program that i made into an executable single file,
    i currently have my project compressed into a JAR file,
    and its working fine when i go click on it in the file that its in, it works fine but it has to be in that file to work... :(, i was wondering is there a way that i can have that file on its own to work, so that i can send it to someone and they just have to have that one file.
    thanks for the help

    If you want a jar file to behave the same way no matter what directory it is in (or is run from) then you have to make sure that all resources it uses are included in the jar. Such resources could include images and sounds that the application uses. Or files that it references.
    For instance thisFile foo = new File("foo.txt");is going to name a file that it is in the current directory (the directory the jarred or unjarred application was run from). If you move the jar, but don't move foo.txt then it won't be able to find the file.
    Any of your code that directly or indirectly uses files will have to change to use resources within the jar archive instead.
    If you get stuck, post some code. Something brief, compilable, runnable which shows what you mean by saying that it doesn't work.

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • How can I stop running java program in console ?

    Hi , my name is Luck , I will explain :
    - I have created java script which execute commands from cmd level
    - In java script I'm starting *. bat file which retrieve information from system example : hostname > C:\test and then I'd like to load from the file C:\test this host name example : MyComputer
    but the problem is that my script execute reading from the file C:\test before any information will be delivered to this file , how can make a system to wait until bat file will finish doing its task , please , if you know the answer post me back , thank you

    I have created java script which execute commands
    from cmd levelI'd be surprised if you did. You probably wrote a Java program. I never heard of Javascript being run from the console.
    - In java script I'm starting *. bat file which
    retrieve information from system example :
    hostname > C:\test and then I'd like to
    load from the file C:\test this host
    name example : MyComputer???
    but the problem is that my script execute reading
    from the file C:\test before any information will be
    delivered to this file , how can make a system to
    wait until bat file will finish doing its task ,
    please , if you know the answer post me back , thank
    youWhat are you talking about? This isn't Java, this isn't Javascript, I have no idea what it is. It's already difficult to understand your problem description.

  • How can I make my java program double clickable?

    I want to make a shortcut on desktop for my java program, in other words, i want to make it double clickable.
    Can someone please give me a step by step instruction on how to do this?
    Thank you very much.

    [Creating executable jar files|http://csdl.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html]
    [create a batch file |http://forums.sun.com/thread.jspa?threadID=5190624&messageID=9978734]

  • URGENT: How do you distribute a Java program??

    I've made a small program using Java and it turned out to work perfectly fine, but now I am wondering how to package it so that anyone can just double-click something and have it run. I tried packaging it into a Jar file, but nothing seems to work (i.e. I get some manifest error) I've looked at tutorials online and I've also used the Jar packager tool that is a part of the JCreator IDE.
    I was also thinking about writing a dos batch file to have the program run from the command line; would that work as well??
    What is the easiest /nicest way to have a Java program packaged?(Sun should really add a java/.class to *.exe converter in a future JDK...)

    So many research-challenged people, and so little time.
    Google for "Java EXE"
    And no, Sun should NOT provide EXE output. EXEcutables are for a specific platform. Bytecode (.class files) are for platform independence, so that you CAN distribute the bytecode to run on any platform (any platform with a Java runtime, that is).

  • How can I run a java program on Linux?

    I have JBuilder's IDE installed on my Linux partition and it works. However I don't know how to compile and test a program without it. Also I tried to install Limewire on Linux and although I've installed the Java SDK on the system. Once before I installed JBuilder and then JBuilder (I guess) installed it again. However it told me it couldn't find the Java Virtual Machine. Isn't this installed with the JDK? I am able to run programs through JBuilder so I can't see why I'd have a problem. Any answers to the above issues would be greatly appreciated.

    Go here and work out how to make a simple app to compile and run on the command line: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/unix.html#2b
    (You should find the JDK from a directory under the jbuilder directory so use that and not the /usr/local/jdk1.4 in the example.)
    Then find the classes or source code of your project and do the same thing to it.

Maybe you are looking for