How to do "java Program 50 7" when using Eclipse?

If you use the command-line environment to compile and run a java program called Sample.java instead of using Eclipse, you could compile by writing "java Sample 30 5" or replace the 30 and 5 with other numbers (lets suppose the Sample.java needs 2 int inputs). How would you do the equivalent of that when using Eclipse?
Thanks!

In the Run , there is an arguments tab ..

Similar Messages

  • Java program stopped running when using JVMPI

    Hi!
    I'm writting a very simple profiler using JVMPI. I intended to pause/continue it by sending signal, like kill -SIGUSR2 PID, to it, but whenever I did this, the java program that ran with the profiler stopped running, however the profiler kept running properly.
    Here's the code of the simple profiler and the testing java program.
    //myprofiler.cc
    #include <jvmpi.h>
    #include <pthread.h>
    #include <stdio.h>
    #include <signal.h>
    void sig_handler_pause(int);
    static JVMPI_Interface *jvmpi_interface;
    void notifyEvent(JVMPI_Event *event) {
    switch(event->event_type) {
    case JVMPI_EVENT_CLASS_LOAD:
    fprintf(stderr, "myprofiler> Class Load : %s\n", event->u.class_load.class_name);
    break;
    case JVMPI_EVENT_OBJECT_ALLOC:
    fprintf(stderr, "myprofiler>object alloc \n");
    break;
    extern "C" {
    JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM jvm, char options, void *reserved) {
    fprintf(stderr, "myprofiler> initializing ..... \n");
    // get jvmpi interface pointer
    if ((jvm->GetEnv((void **)&jvmpi_interface, JVMPI_VERSION_1)) < 0) {
    fprintf(stderr, "myprofiler> error in obtaining jvmpi interface pointer\n");
    return JNI_ERR;
    // initialize jvmpi interface
    jvmpi_interface->NotifyEvent = notifyEvent;
    // enabling class load event notification
    jvmpi_interface->EnableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
    fprintf(stderr, "myprofiler> .... ok \n\n");
    signal(SIGUSR2,sig_handler_pause);
    return JNI_OK;
    void start(){
              fprintf(stderr,"start...\n");
         jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    jvmpi_interface->EnableEvent(JVMPI_EVENT_CLASS_LOAD,NULL);
    void pause(){
              fprintf(stderr,"pause...\n");
              jvmpi_interface->DisableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    jvmpi_interface->DisableEvent(JVMPI_EVENT_CLASS_LOAD,NULL);
    int status=0;
    void sig_handler_pause(int sig){
         if(status == 0){
              start();
              status = 1;
         else if(status == 1){
              pause();
              status = 0;
    //Test.java
    public class Test {
    public static void main(String[] args) {
         try {
                        int i = 0;
    while(true)
                             Thread.sleep(1000);
                        System.out.println(i++);
              catch (Exception e) {
                        e.printStackTrace();
    Here're some notes:
    1)If I didn't call
    jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    in "start()" function, the java program Test ran properly after I sent signal to the process by using kill command in an command line;
    or
    2) If I delete "Thread.sleep(1000)" in Test.java, then whether I call
    jvmpi_interface->EnableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
    in "start()" or not, the Test program ran properly after I sent signal to the process.
    It seems to be a thread dead lock, but I'm not sure. Can any body help?Thanks very much.

    I should strongly recommend moving from JVMPI to JVM TI if you can. The reason is that JVMPI has been deprecated since 5.0 and can not be used with Java SE 6 and newer.
    Anyway, the issue you have may be due to the signal you are using. I'm not sure which operating system this is but on Linux the USR2 signal is used for the suspend/resume implementation. Have you looked at the Troubleshooting Guide or the Signal Chaining page for details on how signals are used and how to chain handlers? Another idea is to remove the signal handling code implementation and to use the data dump event. This is supported by both JVMPI and JVM TI so that you get an event (via the QUIT signal).

  • How can java programs execute automatically when it connects to network

    Good Day dears...
    How can java programs execute automatically when it connects to network.
    Thanks in Advance friends Shackir

    884924 wrote:
    Good Day dears...
    How can java programs execute automatically when it connects to network.What is "it"? That is, execute when what connects to the network?
    Your computer? If that's what you mean, this is not a Java question. It's an OS operational/administrative question. Executing any program, whether written in Java or not, based on some system event has to do with that system, not with the program. If it's possible to do this, you'd do it exactly the same way for a Java program as you would for any other program.
    Or is "it" the program itself? If this is what you mean, then it's a nonsensical question. For the program to connect to the network and detect that it has connected to the network, it must already be executing, so asking how to execute it at that point is meaningless.
    Finally, I'll point out that "connecting to the network" is a pretty meaningless phrase. Or rather, it has so many potentially valid meanings that it's impossible to know which one you're referring to when you use that phrase. And I'd be willing to bet you don't have a clear picture of that yourself.

  • How to call java program by HTML page

    Hi guys,
    I'm new java programer and want to build an HTML page to access to ORACLE database on NT server by JDBC, Can anyone give me a sample?
    I already know how to access database by JDBC, but I don't know how to call java program by HTML page.
    If you have small sample,pls send to me. [email protected], thanks in advance
    Jian

    This code goes with the tutorial from this web page
    http://java.sun.com/docs/books/tutorial/jdbc/basics/applet.html
    good luck.
    * This is a demonstration JDBC applet.
    * It displays some simple standard output from the Coffee database.
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.util.Vector;
    import java.sql.*;
    public class OutputApplet extends Applet implements Runnable {
    private Thread worker;
    private Vector queryResults;
    private String message = "Initializing";
    public synchronized void start() {
         // Every time "start" is called we create a worker thread to
         // re-evaluate the database query.
         if (worker == null) {     
         message = "Connecting to database";
    worker = new Thread(this);
         worker.start();
    * The "run" method is called from the worker thread. Notice that
    * because this method is doing potentially slow databases accesses
    * we avoid making it a synchronized method.
    public void run() {
         String url = "jdbc:mySubprotocol:myDataSource";
         String query = "select COF_NAME, PRICE from COFFEES";
         try {
         Class.forName("myDriver.ClassName");
         } catch(Exception ex) {
         setError("Can't find Database driver class: " + ex);
         return;
         try {
         Vector results = new Vector();
         Connection con = DriverManager.getConnection(url,
                                  "myLogin", "myPassword");
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery(query);
         while (rs.next()) {
              String s = rs.getString("COF_NAME");
              float f = rs.getFloat("PRICE");
              String text = s + " " + f;
              results.addElement(text);
         stmt.close();
         con.close();
         setResults(results);
         } catch(SQLException ex) {
         setError("SQLException: " + ex);
    * The "paint" method is called by AWT when it wants us to
    * display our current state on the screen.
    public synchronized void paint(Graphics g) {
         // If there are no results available, display the current message.
         if (queryResults == null) {
         g.drawString(message, 5, 50);
         return;
         // Display the results.
         g.drawString("Prices of coffee per pound: ", 5, 10);
         int y = 30;
         java.util.Enumeration enum = queryResults.elements();
         while (enum.hasMoreElements()) {
         String text = (String)enum.nextElement();
         g.drawString(text, 5, y);
         y = y + 15;
    * This private method is used to record an error message for
    * later display.
    private synchronized void setError(String mess) {
         queryResults = null;     
         message = mess;     
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();
    * This private method is used to record the results of a query, for
    * later display.
    private synchronized void setResults(Vector results) {
         queryResults = results;
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();

  • How to call  java program from ABAP

    Hi Experts,
         My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
      Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
    DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
    parameter TYPE string VALUE 'D:java MyFirstProgram'.
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application = command
    parameter = parameter
    OPERATION = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    OTHERS = 8.
    Thanks.

    This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
    Implement an RFC server in 7.0:
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Implement an RFC server in 7.1 or higher:
    http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm

  • How to run java program from website?

    Hello
    I'd like to know how to run java program from my web page.
    I'd like to push some button in this web page so java program that would be on my server
    would pop-up. Can it be done automaticaly upon running this web site? (without any buttons - I just enter website and program pops up).
    Cheers

    I rather thought about RMI. But I could try servlets. So how it would look like?.
    I would make http request in browser (enter address) and program would show up in its window?. And I would not have to change anything in my program?. This program would run then on both boxes?. One remotely and one not?.
    But I would have to learn some basics, I've never worked with servlets. Could you suggest some good sites about it?. With ready examples so I could tweak them to my purpose.
    Message was edited by:
    macmacmac

  • How to run Java program as Daemon Server in linux

    How to run Java program as Daemon Server in linux
    i would like to run the java program on system start up in a redhat linux system
    can any one provide rc.status file

    http://wrapper.tanukisoftware.org/

  • How to reach Java program which is run as individual process

    Hi There .
    My question is if I run a java program as individual process using Runtime , can I reach this process and change some variables up there, like set a boolean variable to false , or stopping running thread properly. whatever. till now I figure out two ways , either kill the PID of my program (if I want to stop it ), or touching a new file and when the program sense that the is been created he will take an action ,like exit or do the things that I want to do, I tried and I googled it but I ends up with nothing , what I understand it's like it's irreversible thing when it's run there is no way back. Thanks in Advance

    No you can't interact with a process you start as if it were just other Java code.
    What you can is interact with it in the same ways you can interact with any other process. For example through the process input and output stream. Or perhaps through Sockets.

  • How to set fetchsize of sql Query when using Database Adapter.

    Hi All,
    I am using DatabaseAdapter to connect to database and retriving huge amount of data.For improvement in the performance I want to set the "fetchsize" of sql query. I know fetchsize can be preset in Java using Jdbc 2.0 API.Please let me know how to set this value in BPEL when using DBAdapter?
    Thanks
    Chandra

    I talked to the developer of the db adapter - and he told me this feature will be available in BPEL PM 10.1.3 (which is supposed to be production later this year, and a public beta soon). If this is an emergency I would recommend going throug Oracle support and have them file an enhancement for 10.1.2.0.2
    hth clemens

  • How to transfer range parameter from vb when using bapi calling

    Hi,everyone.how to transfer range parameter from vb when using BAPI calling?

    Did you get the solution to your problem?  Can you please share it with me. I have a similar problem. I have a VB program that calls RFC function. It works with a single parameter but not with a range of parameters. If you have the solution, could you please share sample codes with me? Thank you so much.

  • How to avoid Java Studio Creator 2 to use the regional settings?

    How to avoid Java Studio Creator 2 to use the regional settings to select the language that will be used to display the IDE in a certain language?
    My country settings are set to Belgium (French) but I want to have my IDE running in English.
    What should I change in the defautl properties of JSC2 to avoid this behaviour?
    Please, don't tell me to change my regional settings, it is not a valid answer :-)
    Best regards,
    Abdelkrim BOUJRAF

    just modify creator.conf in directory etc/
    add: -J-Duser.language=en
    in the netbeans_default_options line:
    like this:
    netbeans_default_options="-J-Duser.language=en -J-Xms96m -J-Xmx384m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled -J-Xverify:none -J-Dnetbeans.javacore.background_scanning=true -J-Dsunappsrvint.home=\"C:\Program Files\Sun\Creator2\SunAppServer8\""

  • How can I show additional tab rows when using many open tabs?

    How can I show additional tab rows when using many open tabs?

    What method (code) did you use to get the Tab bar displaying in the space used for the Navigation Toolbar (location bar)?
    The Tab bar should be displayed above the Navigation Toolbar.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to make a program for backgroung processing used servlet

    how to make a program for backgroung processing used servlet

    well i need the coding part written in servlet ,in which servlet is always ready for accepting a client request.

  • How do images embeded in InDesign link when using Creative Cloud on more than two desktops?

    How do images embeded in InDesign link when using Creative Cloud on more than two desktops?

    If I am understanding your question correctly, you shouldn't have to worry about embedded images in InDesign. Once embedded, the image is stored within the file.
    If you are wondering about linked images... InDesign will follow the path on your computer and, if it does not find the image, you will recieve a notification. Edit: To prevent this, I would suggest packaging your file using File > Package... This will create a folder with all of your fonts and linked graphics so that you need not worry about broken links.  I just remembered that you cannot upload folders directly to Creative Cloud so a packaged folder wouldn't be very helpful unless you wanted to upload each file manually.
    The best solution I see right now is to either embed the graphics in the document, or upload the images with your document to relink.
    I hope this helped,
    Michael

  • How do you update the Bios safely when using onboard RAID mirror? Z87-G45

    How do you update the Bios safely when using onboard RAID with Z87-G45?   I'm using a simple two drive, RAID 1 mirror setup.
    I'm currently at bios 1.4, and want to move up.  However, last time I upgraded the BIOS, the machine rebooted with improper settings for the RAID (they get hosed during BIOS flash) and Windows decided to auto-repair the only boot drive it could see, one half of the mirror, because it couldn't see the RAID array correctly and *POOF*  bare-metal reinstall required.   
    My PC will not let me press the DEL key on bootup to access the bios, even with MSI Fast Boot not installed.  It just ignores the DEL key and tries to load windows which, if that happens, will flame-out my RAID array after a bios flash if I can't catch it to enable the RAID first before windows loads.
    I do not want to rebuild my PC again simply because I do a BIOS update.

    FYI: BIOS 1.4 & 1.8 are using the same RAID version: 12.7.0.1936
    based on this RAID surprise should not hapends.
    But as pandaz says if you have no issues, leave bios update alone.
    there are still risks something to messed up,
    best do a backup of your data just in case if you want to try latest version

Maybe you are looking for

  • Volume buttons no longer work in 10.4.8

    I just updated to 10.4.8, via Software Update. I have tried pressing my volume keys on my Apple Keyboard that shipped with the iMac, and the little grey box comes up with the volume status, and it moves as I press the volume up/down, but the volume i

  • Lost songs on my computer can I sync my iphone

    I Recently upgraded my iMac and lost all of my iTunes songs in the process. Can I recover all of my songs by syncing my iPhone with my new computer or will my iPhone songs get erased?

  • How to do a Report bursting?

    Post Author: anshubit CA Forum: Administration Hi , I have a requirement where I need to design a report (either WebI or Deki) in BO XI R2 environment. When the report is deployed in Infoview, then user's should be able to view only those data which

  • My EHD has disappeared

    After installing OSX 10.9 my Lacie EHD that is connected by USB has disappeared. Can anyone let me know how to fix it?

  • Logical mapping seems not working

    Logical mapping in CF server admin seem not working.. I just created a logical mapping \images with a valid path in the server c:\images. If I try to access http://localhost:8500/images/test.gif.. it shows the image.. But if the same URL is embedded