Executing notepad from an applet

Is it possible to execute a program on my machine from an applet.
Thanks
Awhittaker

here is a Q&D that works for me in w2k for IE and NS.
I forget how to getParameter hence "notepad" is hardcoded!
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.sql.*;
author: Ron
email: [email protected]
keytool -genkey -alias aSignKey -keyalg RSA
[mchan@v... appletExec]$ keytool -genkey -alias aSignKey -keyalg
RSA
Enter keystore password:  password
What is your first and last name?
  [Unknown]:  ron chan
What is the name of your organizational unit?
  [Unknown]:  pgh
What is the name of your organization?
  [Unknown]:  pgh
What is the name of your City or Locality?
  [Unknown]:  pgh
What is the name of your State or Province?
  [Unknown]:  pa
What is the two-letter country code for this unit?
  [Unknown]:  us
Is <CN=ron chan, OU=pgh, O=pgh, L=pgh, ST=pa, C=us> correct?
  [no]:  yes
Enter key password for <aSignKey>
(RETURN if same as keystore password):
keytool -export -alias aSignKey -file aSignKey.cer
in Windows, double click on aSignKey.cer and install
(in linux, import)
javac *.java
jar -cvf aEXEC.jar *.class
jarsigner aEXEC.jar aSignKey
  console output:
  test: notepad
  simple html,
  <HTML>
<head>
<title>EXEC Applet</title>
</head>
<body>
<h1>EXEC Applet</h1>
<p>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 170 HEIGHT = 150
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=\
1,3,0,0">
<PARAM NAME = CODE VALUE = "AppletExec.class" >
<PARAM NAME = CODEBASE VALUE = "./" >
<PARAM NAME = ARCHIVE VALUE = "aEXEC.jar" >
<param name="prg" value="notepad">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3"  CODE =
"AppletExec.class" CODEBASE = "./" ARCHIVE = "aEXEC.jar" WIDTH = 170
HEIGHT = 150  scriptable=false
pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMB\
ED></COMMENT>
alt="Your browser understands the <APPLET> tag but isn't running
the applet, for some reason."
      Your browser is completely ignoring the <APPLET> tag!
</NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET CODE = "AppletExec.class" CODEBASE = "./" ARCHIVE =
"aEXEC.jar" WIDTH = 170 HEIGHT = 150>
alt="Your browser understands the <APPLET> tag but isn't running
the applet, for some reason."
      Your browser is completely ignoring the <APPLET> tag!
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</body>
</HTML>
public class AppletExec extends Applet
  String prg = null;
  public void init()
    prg = getParameter( "prg" );
    if( null == prg )
      prg = "notepad";
    Label lb = new Label( "hello" );
    add( lb );
    resize(300,300);
    test();
  public Panel getPanel()
    Panel p = new Panel();
    Label lb = new Label( "hello" );
    p.add( lb );
    p.resize(300,300);
    return p;
  private void test()
    try{
      System.out.println( "test: " + prg );
      Runtime.getRuntime().exec( prg );
    catch( Exception e ){
      e.printStackTrace();
  public static void main( String[] args )
    Frame f = new Frame();
    AppletExec aEXEC = new AppletExec();
    Panel p = aEXEC.getPanel();
    aEXEC.test();
    f.add( p );
    f.pack();
    f.show();
}

Similar Messages

  • Calling perl from java applets

    I have problems in executing PERL from a JAVA applet and Swing interface.
    I'm working under Windows 98.
    My aim is the following:
    When I click on the "Analizza" button,
    I want to execute a PERL program and automatically
    close the DOS window after completion. If there
    is an error, this error should be displayed in DOS.
    I wrote this piece of code
    public void actionPerformed(ActionEvent eventoUtente){
         String comandoPulsante = eventoUtente.getActionCommand();
              if (comandoPulsante == "Analizza"){
              Runtime rt = Runtime.getRuntime();
              try{
              Process pr= rt.exec("cmd -c c:\\command /c perl C:\\_webasco\\contatutto2.pl");
              catch(java.io.IOException ioEx)
              System.out.println("IOEx:"+ioEx.getMessage());
    I tried also with a Windows executable, ie I replaced the line
         Process pr= rt.exec("cmd -c c:\\command /c perl C:\\_webasco\\contatutto2.pl");
    with
         Process pr= rt.exec("command /c c:\\windows\notepad.exe");
    but in both cases nothing happens within the applet.
    What am I doing wrong????
    Any suggestions is warmly welcomed.
    Thank you
    Marina

    I know nothing about Perl, but the line
    if (comandoPulsante == "Analizza"){
    compares references not values and will always return false. Try:
    if (comandoPulsante.equals("Analizza")) {

  • [NEWBIE] How to open a frame from an Applet?

    Hi, I'm trying to open a JFrame from an Applet. Basically, I would like that, once the user selects an option from a JMenu, a Frame would be shown with a text box where user could type some content.
    I built both the Applet and the Frame, and singularly they work. When I execute the main method from the JFrame, the window appears, but when I execute something like the following from the applet:
    MyFrame mf = new MyFrame();
    mf.setVisible(true);nothing is shown. I'm sure that I don't know something, but I just started with applets.
    Thanks for any help,
    Marco

    If MyFrame is a subclass of JFrame, then it should not
    make any difference.
    What do you need the JFrame for? Can this be done
    using another "screen" by using a CardLayout?From a menu, when the user selects 'Start game' I need a text box coming out so that the user can insert a word. This word should then evaluate an instance member of the Applet.
    Marco

  • How to writing an image from my applet to my apache webserver

    hi everyone,
    i have a big problem, writing an image from my applet to my apache
    webserver. i tried three way's of writing that file. every way was
    described in forums to solve this problem, but non of them worked and
    i don't know why. i'll give you the code of my writing-methods and
    describe, what happen when i test them, in order someone of you can
    give me an usefull tip, where the problem is.
    as inputparameter i give my method a new URL referring to
    http://localhost/test.jpg (this is the same directory, where my applet
    is loaded from, so i should have reading and writing permission,
    havn't i? while i'm developing, my applet runs on the same pc as my
    webserver, just in case you're wondering about localhost) and a
    selfmade BufferedImage (i already testet if it is not null and shows
    the correct things ... all ok).
    1. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    URLConnection urlConnection = fileURL.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream urlout = urlConnection.getOutputStream();
    BufferedOutputStream out = new BufferedOutputStream(urlout);
    ImageIO.write(img,"jpg",out);
    out.close(); // i also tried without this line -> same result
    // additionally a question: do i need
    out.close()?
    catch( IOException e ){
    e.printStackTrace();
    result:
    test.jpg doesn't appear in the webroot. but some very strange messages
    in the error.log of my apacheserver:
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageOutputStreamSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageReaderSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageInputStreamSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageWriterSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageTranscoderSpi
    i cannot explain this lines to myself, because my apache should have
    nothing to do with java. all my javacode is executed on the client
    side in the browser. do this messages mean i have to add the ImageIO
    package from the sdk to my jar-applet. the jre, used by my iexplorer,
    doesn't contain this files in the meta-inf/services directory of
    rt.jar, but that's version 1.4.2_03, the same as my sdk, and the
    rt.jar contains the corresponding classfiles at javax.imageio.spi. so
    i'm realy confused by this messages.
    2. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    URLConnection urlConnection = fileURL.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream urlout = urlConnection.getOutputStream();
    BufferedOutputStream out = new BufferedOutputStream(urlout);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(img);
    out.close(); // same comments as above
    catch( IOException e ){
    e.printStackTrace();
    result:
    nothing. no error-messages in the error.log, no exceptions in the
    java-console and no test.jpg in the webroot. i searched my whole
    harddrives for it: nothing. isn't this the way, the JPEGImageEncoder
    works?
    3. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    File file = new File(fileURL.toString);
    file.createNewFile();
    BufferedOutputStream out = new BufferedOutputStream(new
    FileOutputStream(file));
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(img);
    out.close(); // same comments as above
    catch( Exception e ){
    e.printStackTrace();
    result:
    the SecurityManager denies this action with "access denied" while
    calling createNewFile(). well, this way was dedicated to run from an
    application, not from an applet. i'd have to sign my applet to get the
    rights to do this, or i can edit java.policy on my client, what i
    don't want, because i cannot do this on every client, the applet will
    run, when i'm finished with it. this brings me to the question: does
    anybody know's how to sign my applet and give it full access to the
    harddrive and the webserver without paying 400$ to VeriSign for a
    commercial CA? i want to do this by myself, without paying anything
    and without giving a lot of information to another company.
    i would realy appreciate, if someone could give me a hint where i am
    wrong or how to do this correct.
    thank you very much
    [email protected]

    You hold several misconceptions. The first is that an applet can write to a server without help from the server. That will never work on a real server (though it might work in testing, if the server is on the same PC as the applet). Applets cannot get a File object that points to any place on the server.
    If you write a servlet designed for accepting image uploads, the applet can communicate back to that servlet and feed it the bytes of the image. There are other technologies that can replace the servlet, of course (PHP, ASP..) but I mention that because you say you are running Apache - and that is very Java oriented.
    For more help on servlets, try the [Web Tier APIs - Java Servlet|http://forums.sun.com/forum.jspa?forumID=33] forum.

  • Reading from the Applet's JAR file.

    Is it possible to read a file stored in the jar file that the (unsigned) applet is being executed in? I have a line that goes like (in is just an InputStream):
    in = getClass().getResource( "/exercise.xml" ).openStream();
    and then, in another class, i do (bulider is an instance of javax.xml.parsers.DocumentBuilder, created from the DocumentBuilderFactory class):
    doc = builder.parse( in );
    but this always results in a security exception (works fine from the applet viewer). I tried specifying the full path to the .jar file as the codebase, but got the same results. I have not tested this from an actual web server, i am only opening the .html file directly in IE.
    Due to the nature of the application, it is not possible to host the file seperately on a webserver.
    It seems to me that there is no reason an applet shouldnt be allowed to load a file from the .jar it is executing in, could this simply be a problem of the file being local, and thus linked to from a file:// tag?
    Thanks for any help.
    Thomas Stephens

    Hi Guys
    I have figured out this problem. It's got to do with classloader.
    Applet uses a separate classloader. So using the static getSystemResource(),
    we never get contents from applet jar files. The following will work nicely.
    It is noted that you must loacate the applet classloader as in the first line
    and use the non-static method getResource();
    ObjectInJar obj = new ObjectInJar(); // create an object with a class in the jar file.
    ClassLoader cl = obj.getClass().getClassLoader();
    InputStream stream = cl.getResource("your_filepath_in_jar").openStream();
    Cheers.

  • Calling a WebService from Java Applet

    Hi all,
    In my application I have 3 projects:
    1. server - for all the business logic.
    2. view - for web app.
    3. swing - for applet.
    In the view project I wrote a WS, and I want to call it from my applet. So I created a WS using the Jdev (10.1.3.2) wizard in the view project (I tested it and it worked fine), and in the swing project I created a proxy for this WS, tested it and it worked fine. Then I created a JAR containing the swing project with the WS proxy classes, opened the Applet and find out that I have some classes missing, so I started adding all the relevant Jars and ended with a ~13MB JAR containing all the swing project jars that in the class path for a simple Applet.
    I know that I'm missing something but I dont know what. Do I really need all those Jars. Is there a simple way to call to a WS via Applet?
    This is the list of all the Jars:
    activation.jar
    commons-logging-api.jar
    commons-logging.jar
    ejb.jar
    http_client.jar
    jaxb-api.jar
    jaxb-impl.jar
    jaxen.jar
    jaxr-api.jar
    jaxrpc-api.jar
    jazncore.jar
    jdom.jar
    jms.jar
    jta.jar
    mail.jar
    mdds.jar
    oc4jclient.jar
    ojdl2.jar
    ojmisc.jar
    ojpse.jar
    oraclepki.jar
    orajaxr.jar
    orasaaj.jar
    orawsdl.jar
    orawsrm.jar
    osdt_cert.jar
    osdt_core.jar
    osdt_saml.jar
    osdt_wss.jar
    osdt_xmlsec.jar
    relaxngDatatype.jar
    saaj-api.jar
    saaj-impl.jar_old
    servlet.jar
    wsclient.jar
    wsdl.jar
    wssecurity.jar
    wsserver.jar
    xdb.jar
    xml.jar
    xmlparserv2.jar
    xsdlib.jar
    By the way at the end of all this annoying process I got the next exception:
    [failed to localize] typemapping.nested.exception.initialization(javax.xml.rpc.JAXRPCException: javax.xml.soap.SOAPException: Unable to create SOAP Factory: Provider com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl not found)
         at oracle.j2ee.ws.client.BasicService.createLiteralMappings(BasicService.java:282)
         at oracle.j2ee.ws.client.BasicService.createStandardTypeMappingRegistry(BasicService.java:244)
         at com.tm.view.ws.misc.runtime.WSMisc_Service_SerializerRegistry.getRegistry(WSMisc_Service_SerializerRegistry.java:26)
         at com.tm.view.ws.misc.runtime.WSMisc_Service_Impl.<init>(WSMisc_Service_Impl.java:26)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:92)
         at oracle.j2ee.ws.client.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:121)
         at com.tm.view.ws.misc.WSMiscSoap12HttpPortClient.<init>(WSMiscSoap12HttpPortClient.java:20)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at client.base.connectivity.ClientRequestAgent.runWS(ClientRequestAgent.java:135)
         at client.base.connectivity.ClientRequestAgent.run(ClientRequestAgent.java:44)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Shachar

    Try this:
    1. open the webService data controll in the Data Controls section and drag the method from the webService onto the method call activity in your task flow. This will overwrite the current method property (the one which pints to your bean, make a copy of this entry if you can't reproduce it by hand). This too will create an entry in the pageDef of the method call activity.
    2. reenter (or paste) the original value in the method property, so that it again points to your bean. The entry in the pageDef will remain!
    3. now in the bean method you can access the method via its binding like you access any other method from the binding:
    // GET A METHOD FROM PAGEDEF AND EXECUTE IT
    // get the binding container
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    // get an Action or MethodAction
    OperationBinding method = bindings.getOperationBinding("YourMethodActionNAME");
    if (method == null)
    // handle method not found error...
    // if there are parameters to set...
    Map paramsMap = method.getParamsMap();
    paramsMap.put("param","value")  ;    
    // execute the method
    method.execute();
    List errors = method.getErrors();
    if (!errors.isEmpty())
       // handle errors here errors is a list of exceptions!
    // no error resume normal workTimo

  • How to open notepad from sql prompt?

    Hi to all
    can anyone please let me know how to open notepad from sql prompt.
    I tried ed command but message appears " Cannot create save file "afiedt.buf"
    thanks in advance

    user13480742 wrote:
    can anyone please let me know how to open notepad from sql prompt.
    I tried ed command but message appears " Cannot create save file "afiedt.buf"Create a SQL*Plus shortcut on your desktop.
    Create a SQL folder on your desktop (in your documents folder, or whatever desktop location you have read and write access to).
    Change the +Working Directory+ of the SQL*Plus shortcut to this SQL folder you have created (via editing the properties of the shortcut).
    Launch SQL*Plus via that shortcut.
    It will now run from that SQL directory. This means that it will have read and write access to the current directory (allowing it to create the +afiedt.buf+ file for example). It also means that you can save your SQL scripts in this directory and execute these from the SQL*Plus command line, without having to specify a path.

  • DOS command from java applet

    Hi, I need to perform a DOS command from Java (using WFC if needed)...
    I have no idea, so please help!
    Thank you.

    OH OH OH WAIT! It is an Applet! i think there will be some security issues here! Sure enough you can't execute commands on the system from an applet unless you make some changes on the java.policy files on the client machine (that means, if your applet is in a web page, every machine which view your page).

  • Create a new file on server from an applet

    Hello!
    I 'm trying to create a text file on server from an applet, i have permissions to write on server and i'm running in apache, my code is
    public void write () {
    try{
    URL url = new URL("http://localhost/bnm/hello.txt");
    URLConnection urlcon = url.openConnection();
    urlcon.setDoOutput(true);
    urlcon.setUseCaches(true);
    PrintWriter pt = new PrintWriter
    (new OutputStreamWriter (urlcon.getOutputStream()));
    String str = new String(URLEncoder.encode("this is output applet ")) ;
    pt.print(str);
    pt.flush();
    catch(Exception e)
    e.printStackTrace();
    The result is nothing, the file isn�t created, but the code don't throw exceptions.
    Ah! in other example, i can read a file of server fro m the applet, the problem is to write
    Anybody, knows the matter??
    Excuse my poor english :P
    Thanks for all.

    I had the same needs and didn't know whether this was possible, due to applets security restriction. So I searched the Web and found some contradictory information. I will explain what I think is the situation, to give you an answer, but also so that other people can tell me whether I understood correctly.
    1) Unless you sign it, an applet cannot write files directly, either client-side or server-side. All what it can do to access a file server-side (except .jar files ?) is opening a http connection, which allows only to retrieve data. When I try to run code such as yours, I get this exception :
    java.net.UnknownServiceException: protocol doesn't support output
         at java.net.URLConnection.getOutputStream(URLConnection.java:679)
    2) As Ares_Man points out, what it can do is opening a http connection not directly with the file you want, but with a server-side script (JSP, PHP, CGI,...) which will be allowed to write files on the server. You can use POST or GET parameters to pass to the script what you are going to write.
    This simple code worked for me (it executed the script toto.php):
              try{
                   URL toto=new URL(getCodeBase(),"toto.php");
                   InputStream f=toto.openStream();
                   f.close();
              catch(Exception e){
                   e.printStackTrace();
    Probably it's a good idea to do a URLConnection.setCache(false) though, to be sure that the script toto.php will be executed.
    3) I don't know how you can pass serialized objects as parameters. So if more than text informations are to be written, I would tend to make the script store them into a database instead of files. That way, you could pass any SQL query as parameter, maybe along with a password parameter for security. I don't know whether this is secure enough.

  • Shutting down an ExecutorService from an applet

    Hi,
    When I tried to shutdown an ExecutorService from an applet, I go "java.security.AccessControlException";. When I wrapped this call in a "PrivilegedAction", I am still getting the same exception.
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
                 pool.shutdown();
                 return null; // nothing to return
         }); The documentation says that I should sign the jars and use "all-permissions" in the jnlp file to be able to execute out of the sandbox. But isn't the previous code an alternative way that should work.
    Thank you

    Gen.Java wrote:
    But isn't the previous code an alternative way that should work.
    No! What would be the point of having Applet and WebStart security restrictions if it were trivial to bypass them.

  • Set VM parameters from an applet

    Hi all,
    When I run an applet I need to start the VM with this parameter:
    -Djava.rmi.server.hostname=localhost
    How can I set this parameter from an applet to correctly start the VM?!?!?
    Thanks in advance!!

    Hi all,
    When I run an applet I need to start the VM with this
    parameter:
    -Djava.rmi.server.hostname=localhost
    How can I set this parameter from an applet to
    correctly start the VM?!?!?
    Thanks in advance!!You can't do it from the applet, since the vm is already started when you execute the applet. But I think you can do this after your applet has started.
    System.setProperty("java.rmi.server.hostname", "localhost");I'm not sure if an applet is allowed to do that (It can throw an security exception), but you could give it a try.
    /Kaj

  • Run applicaton from an applet

    I am writing applet for the first time so don't know much about it. My applet has only one button which when clicked executes a simple application. The application contains the user interface where users can enter various search string. The application creates an url from the string and the result is shown using 'showDocument()' method. I passed AppletContext to the application to call this method. This works fine when I run it in local machine as all the class files and html file are saved locally.
    I want to know if it is ok to execute an application from an applet like this or will it cause problem? I mean when the applet is run from a browser, will it be able to execute the application residing on the server? Or do I have to write all the code in the applet and not use application?

    I don't understand your question.
    Applet: application with HTML-embedded GUI that is deployed on a server but runs on the client.
    Please explain what you mean by "application" and how you call it.
    You can package the application classes together with the applet classes in one JAR, so the applet will be able to use them, if that's what you want.

  • Launching applications from an applet

    How do you launch applications from an applet? For example,launch a notepad exceutable when you click on a button (an awt component)?

    Hi,
    you can launch an application from the applet using the Java RunTime environment.
    Runtime.getRuntime().exec(applicationName);
    But to do this the applet needs permissions.It should be a trusted applet.

  • Launching from an applet

    Does anyone know if its possible to Launch the likes of a notepad file from an applet?.My problem is that I need to assign a help menu to the applet but it will be considerable length. Can anyone help?

    Launching an application from an applet is a security violation. There may be ways around this (signing, JNLP) but there's an easier solution.
    You can use the web browser that launched the applet to show .HTML pages. If your help is in text files, open them with Open Office (free DL if you don't have it) and save as .HTML. (Don't, uh, make that DON'T! use MS Word for this. Test MS Word on a copy of a bit of your text if you don't just take things on faith.)
    Then launch the .HTML in the browser, this way:
    http://java.sun.com/docs/books/tutorial/applet/appletsonly/browser.html

  • Executing genstat from java

    hi all
    Sorry if my posting appears to b silly...All i want to do is to execute the statistial s/w GENSTAT from an applet after user is allowed to select data file and procedure file. Is this possible to do in java?? PLease help me out. I have to finish this work TODAY!!!!!
    Thanx
    Bharthi

    Hi Bharthi,
    I have tried something. I do not know it will directly help you. There is a class called Runtime in the APi's of which there is a method exec().
    You can write any command which you write on the console. This method will execute the same. What i have done is i created a simple java file Test and kept it in c:\downloads directory. My aim was to compile the same thru a program..i.e Bharthi.
    Just compile the same after creating a java file and then run Bharthi. This program will compile the Test program at c:\downloads.
    I hope you got the basic logic. Tell me if you could get thru.
    Bye
    Tushar
    import java.lang.Runtime.*;
    public class Bharthi
    public static void main(String[] args)
    try
    Runtime R1= Runtime.getRuntime();
    String filepath="javac c:\\Downloads\\Test.java";
    System.out.println("filepath : = " + filepath);
    Process p1= R1.exec(filepath);
    catch(Exception e)

Maybe you are looking for

  • HT4858 I lost an important video and want to get it back.

    hey everyone I have the Iphone 5s. I took a video that was 28 min. long. I had it on my phone intending on putting it on my computer. However, when I went looking for it last night it had vanished. I had not deleted it. is there anyway to get it back

  • CS4 serial number invalid on new Macbook Pro

    I have CS4 and a new Macbook Pro. My old apps will not launch with old the serial number. Is there a way to get my old apps to work?

  • Quicktime Deleted! What happens to my library?

    I was cleaning up my computer drive and I forgot that I needed QuickTime to run iTunes. Now when I upload iTunes it prompts me to reinstall it. If I do so, what happens to my entire library? I can't resave my library because without QuickTime it won'

  • Please save me(rac on windows)

    Hi Hey guys I am into Oracle Real Application Cluster Setup on widows 2000. I am doing it for demo purpose only so I am not using high-end hardware devices like SAN box (Storage Area Network) or RAID etc. What I am using is two desktop machines with

  • Ipad 2 3g can be used in Singapore?

    Hi I'm currently quite interested in getting ipad 2 from US. But I would like to ask if 3g could be used in Singapore by Singtel service provider?