Running my java program on another machine

Hi
I have built my program using the much maligned Borland JBuilder, so being quite proud of my new programe i want to run it on other machines, ie i want to put it on a cd and distribute it.!! So how do i do this, i understand that another machine will have JVM installed however is there somthing similar to .exe. Appreciate this may have been covered before but i think i may be confusing myself.. which aint hard
in anticipation many thanks
Nige

exes? What for? How do you run an exe under UNIX?Something you may very well have to do is grant execute permission on the executable file that was thus created. UNIX and Linux do not automatically grant execute privileges on files the way Winblows does.
PS.

Similar Messages

  • How to run a java program in another folder

    Hello!
    I want to run for example the java class file in the path ./sourcecode/javafile.class. It works fine if I do the following:
    cd sourcecode
    java javafile
    but it cannot work if I do:
    java sourcecode/java
    The error it outputs is NoClassDefFoundError.
    Can someone tell me how to run a java program in another folder
    thanks a lot.

    You need to specify the classpath using the -cp flag when running. so instead of
    "java sourcecode/javafile"
    Try
    "java -cp sourcecode javafile"

  • 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 to start a java program on another machine from one on my machine.

    During the next few weeks, I will be designing a grid computing system for a research project I am working on. The grid will be written entirely in java using java 2 SE. The question I have is, is there a way for the main program to remotely start the other programs on the other machines? I am very familiar with most networking concepts, but java is not my primary language so I was having trouble tracking down this feature if java even has it. Any suggestions you have would be greatly appreciated.
    thanks

    The administrators of each machine have agreed to install my java programs so that I may run my software. Worst case scenario I can have them manually start my program on each machine. The grid is to be the backbone of a very large simulation software to simulate around 18 million ISO shipping containers and the boats and ports they are on. The simulation will be used to test several security system designs. Because of the large scale of the problem, the solution has been decided to be a distributed system so that we can spread the load over a large number of systems. I understand the whole start a service on the other machines concept. I am looking for a way to start an already installed java program with as little human intervention as possible. The service idea will work. What I was looking for more specifically was a way to start the java virtual machine and run my code without having to leave a program running on their machine because like i said earlier they are personal machines. anyways if it is not do able I understand. Like I said, java is a second language and I don't yet know its limits or restraints.

  • Running a java program in another java code

    Hello,
    I have a question.I wrote a java server code named server.java. In this server code, I receive another java class code called "HelloWorld.class" from another node. What I want to do is to execute the class HelloWorld inside server.java.
    Briefly, I would like to run a compiled java code (class code)in another executing class code. How can I achieve this?
    Thanks in advance
    �ebnem Bora

    Hi,
    Sorry but your terminology isn't that clear. Are you trying:
    1. To call methods on another class or
    2. To launch a separate process that will run another class?
    If it's either of these then they're not 'Advanced Language Topics' but simple:
    // Scenario 1
    // in Server class
    HelloWorld hw = new HelloWorld();
    hw.sayHello(); // or whatever the method is
    // Scenario 2
    Runtime.exec(new String [] {"java", "HelloWorld"}); // or whateverIs that of any help?
    Dom.

  • How to run the java program from another directory?

    Hi
    Assumption:
    data.java is in a package suncertify.db and place in a directory c:/code/suncertify/db/ directory
    data.class file: is in c:/code/suncertify/db/ directory
    current directory: c:/
    How can execute the data.class directly in c:/ directory without changing directory to c:/code/ ?
    Thanks in advance,
    Adrian

    Yes. You can use the -classpath and -sourcepath options to specify where to look for source files, and the -d option to specify where to generate the class files. Look up the usage of those options in the javac documentation:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

  • Help needed in running a  java program

    hi
    how to run a java program using another java program.
    i have tried a litte to run the notepad,mspaint applications sucessfully using the Runtime class,but how to specify a java program init . the program is given below
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("notepad" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }to run another java program how to modify the exec() or any other way to do this.

    thank u
    its working without any error but it doesn't print any thing on the screen.
    the program is
    this program to be run by cls.java
                                             // hello.java
    import java.io.*;
    public class hello
    public static void main(String[] args)
        System.out.println("hello world");
      }cls.java is given below
                                                    //cls.java
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("java  hello" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }

  • Running java program in other machines

    i want to run my java program file in other machines , how i can do this without installing jdk1.3 on them?

    install the JRE instead.

  • How to compile and run a .java file from another java program

    hello,
    can any one tell me how to compile and run a *.java* file from another java program which is not in same directory?

    Well a smarter way of implementing this is by using a solution provided by Java Itself.
    If you are using J2SE 6.0+ there is an in built solution provided along with JDK itself and inorder to go ahead with solution the below are set of API which you;d be using it for compiling Java Programs (Files)
    http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html
    How do i do that ??
    Check out the below articles which would help you of how to do that
    http://www.ibm.com/developerworks/java/library/j-jcomp/index.html
    http://www.javabeat.net/javabeat/java6/articles/java_6_0_compiler_api_1.php
    http://books.google.com/books?id=WVbpv8SQpkEC&pg=PA155&lpg=PA155&dq=%22javax+tools%22+compiling+java+file&source=web&ots=XOt0siYe-f&sig=HH27ovuwvJgklIf8omTykUmy-eM
    Now once we are done with compilation.In order to run a Specific class all you ought to do is create an object and its specific methods of a specified class included in the CLASSPATH which you can manage it easily by usage little bit reflections.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Running Java API on another machine

    Hello everyone...
    Machine-1
    I have ifs 1.1.9 installed on 8i 8.1.7 with win 2000
    Machine-2
    I have 8i Client and JDeveloper 3.2
    Now i want to run ifs Java API's on machine-2 using JDeveloper 3.2 and want to login to ifs repository on machine-1 using the standard login jsp as provided by Oracle Sample
    I have set my classpath in machine-2 to the machine-1 oracle ifs settings folder. and added libraries in JDeveloper pointing to the jar fils of ifs on machine-1
    now when i try to run login jsp it trows following error....
    any one can help me out.....
    thank you in advance
    oracle.ifs.common.IfsException: IFS-10620: Unable to construct connection pool
    oracle.ifs.server.S_LibraryService oracle.ifs.server.S_LibraryService.startService(java.lang.String, java.lang.String)
    oracle.ifs.server.S_LibrarySessionInterface oracle.ifs.beans.LibraryService.connectLocal(oracle.ifs.common.Credential, oracle.ifs.common.ConnectOptions)
    oracle.ifs.beans.LibrarySession oracle.ifs.beans.LibraryService.connect(oracle.ifs.common.Credential, oracle.ifs.common.ConnectOptions)
    boolean pkg_onflow.conexion.abrir()
    void prj_onflow_html.Login._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext)
    void oracle.jsp.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int, oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.HTTPServer.process(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream)
    boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, oracle.lite.web.JupOutputStream)
    void oracle.lite.web.SocketListener.process(java.net.Socket)
    void oracle.lite.web.SocketListener$ReqHandler.run()
    null

    First of all, you should change the code so that IfsException.setVerboseMessage(true) is called somewhere at the top.
    I have a feeling the reason for your error is an inability to connect to the database on machine-1 from machine-2 -- have you configured a TNS alias on machine-2 that points to the database on machine-1? Can you SQL*Plus into the database on machine-1 from the client on machine-2? If you used the "database is on the same machine" option when you configured iFS on machine-1, then you will need to set the LOCAL (on NT) or TWO_TASK (on unix) environment variable to the TNS alias you define on machine-2.
    Do you know how Oracle Net8 and TNS works, especially with respect to JDBC?
    Can you write a simpler application that just connects to iFS and make sure to include IfsException.setVerboseMessage(true) at the top? Then we'll know for sure what the problem is.

  • Running a java program over network

    Hi,
    How a java program on a machine can be run without having JRE on the same machine, rather interpreting bytecode over network having JRE on another machine?

    Rahul.Kumar wrote:
    well, so my java program is running on x. Initialy X had JRE and on invoking java program from command prompt, it had looked for JRE at path, set in environmental settings. Now I moved JRE to another machine Y and connected these two machines (X and Y). You have two machines X and Y.
    "Connected" or not has nothing to do with this discussion.
    In X path is set to the JRE on Y. The path on X has absolutely nothing to do with anything on Y.
    Now execute java program on X, theoretically it should work or what is wrong with this?This makes no sense. Presuming you meant Y in the above then the following must be true.
    1. You must have a JRE on Y.
    2. You must have a java application on Y (or one accessible via the file system on Y.)
    3. You must be on Y and start the JRE passing the java application that is on Y to it.
    Notice in the above there is no mention of X. There can be no mention of X.

  • Running a java program from an icon

    I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
    Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?

    Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
    not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE?

  • How to run a java program in command prompt

    hi i want to run a java program from in command prompt from another directory
    i want to run a file named First in C:\Program Files\Java\jdk1.6.0_07\bin
    so when i give the command
    java "C:\Program Files\Java\jdk1.6.0_07\bin\First"
    it doesnt works it shows
    C:\>java "C:\Program Files\Java\jdk1.6.0_07\bin\First"
    Exception in thread "main" java.lang.NoClassDefFoundError: C:\Program Files\Java
    \jdk1/6/0_07\bin\First
    Caused by: java.lang.ClassNotFoundException: C:\Program Files\Java\jdk1.6.0_07\b
    in\First
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: C:\Program Files\Java\jdk1.6.0_07\bin\First. Pro
    gram will exit.

    but it prints
    C:\>java -cp "C:\Program Files\Java\jdk1.6.0_07\bin\" First
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    C:\>

  • Not able to execute one Java program from another one via. exec()

    Hi,
    I am new to this forum, so I might be asking a very trivial quetion.
    My program Ap1 is :
    class Ap1
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    p=rt.exec("javac,Pr.java");
    Runtime.getRuntime().exec("javac,Pr.java");
    When I run the above program, I get below error at the line 7(bold one):
    D:\batchwe>javac Ap1.java
    D:\batchwe>java Ap1
    Exception in thread "main" java.io.IOException: CreateProcess: javac,Pr.java err
    or=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at Ap1.main(Ap1.java:7)
    Path is set as below(which seems correct):
    D:\batchwe>path
    PATH=C:\Program Files\Java\jdk1.5.0_05\bin
    I am just wondering how to call one Java program from another one?!
    Please help.
    thanks
    Rashmi

    Hi diptaPB,
    Thanks for your suggestion.
    Here is how I tried it again, but not getting the desired output:
    Class Pr looks like below -->
    class Pr
    public static void main(String a[])
    System.out.println("hi from process");
    When I run 'Pr' from command prompt, i get the desired output:
    D:\batchwe>java Pr
    hi from process
    However, when I call 'Pr' from another program Ap2.java, it seems that it does not call 'Pr':
    class Ap2
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    String[] cmd=new String[2];
    cmd[0]="javac";
    cmd[1]="Pr.java";
    p=rt.exec("cmd");
    D:\batchwe>javac Ap2.java
    D:\batchwe>java Ap2
    ************* no output appears here***********************
    Looking forward for your help.
    regards
    Rashmi

  • To run a java program via a batch file,when called from a web server

    REM This batch file runs the Spider with the [-v] option.
    REM Lines 51 through 54 are simple DOS commands..they call the Spider
    REM The location of the Spider package is the important piece of information here...
    REM a batch file has access to the whole computer where the server resides.
    setlocal
    set JDK=C:\j2sdk1.4.1_01
    set PATH=%JDK%\bin;.;%PATH%
    CLASSPATH=%JDK%\jre\lib\*.jar;.;%JDK%\jre\lib\ext\*.jar;.;%CLASSPATH%
    java spiderpackage.EntryPoint -v
    endlocal
    I am trying to run this batch file from my web server.I can see nothing on my browser.I can run the same program from my machine but unable to run from web server.what should I do?

    I am making my question more clear...
    I have a Windows batch (*.bat) file that echoes some html, then calls a java program the output of which is html as well, then echoes the final html.
    To make sure that the java program gets properly executed, I set the necessary environment variables (e.g., JDK, PATH, CLASSPATH, etc.). The script looks something like this:
    setlocal
    set JDK=path_to_JDK
    set PATH=path_to_java
    set CLASSPATH=path_to_java_classes
    echo ^<html^>^<body^>
    call java foo
    echo ^</body^>^</html^>
    endlocal
    The idea, of course, is to call this script through a browser, on a web server.
    Curiously, both echo lines return to the browser just fine, but any output from
    the java program (which just writes html to STDOUT) does not make it back.
    Can someone explain to me why this is happening? How do I set things up so that the output (STDOUT and STDERROR) from the java program make it back to the browser?

Maybe you are looking for

  • How to upgrade the hard disk of the nomad jukebox

    I read the FAQ of nomad on nomadness.net, I wanna know how to upgrade the hard disk of old nomad jukebox with a bigger one? I also read a artical on tom's hardware about this, http://www7.tomshardware.com/mobile/20000/mp3-3.html but he gave a link ht

  • Mail not recognizing new certificate, recognizing old expired certificate.

    Recently the Thawte certificate for the SSL mail server at work expired and Mail could no longer connect to our mail server. No one else in the office uses a Mac and no one else seemed to be affected. IT claimed all their certs were up to date. I con

  • Need somne information about some packages.

    Hi I am trying to understand a script where some packages are used. dbms_sql.open_cursor dbms_sql.parse dbms_sql.define_column Can someone explain me what theses packages do? FOR cur_source_rec IN cur_source LOOP lv_version_cursor_num := DBMS_SQL.OPE

  • Why can't I copy text from these types of webpages (usually Korean blogs)?

    I want to copy the text on Korean blogs, but I can't even select the text... or anything on the page (not even pictures). Anyone know a workaround for this? I'd really appreciate it! Example blogs: http://blog.daum.net/design11111 http://blog.naver.c

  • How to review all questions in a question pool ?

    Captivate v4 I have created projects each with a question pool of approx 15 questions from which 5 random questions with answers shuffled will be drawn at the end of the project. I find that creating questions in v4 is very hit and miss and the forma