Write java prog

Hello everone,
I am new to java. Can anyone tell me what program should i download if i want to write & compile small java programs. please provide me link if you can.
Thanks

download the j2se :
http://java.sun.com/j2se/1.4.2/download.html
if u want a convenient & free IDE (java programming env) you can go to :
www.netbeans.org

Similar Messages

  • Launching another prog from java prog

    Hi!
    I'm striving to format floppy disk from a java prog.
    format, like many other commands/applications, sends some messages back to the terminal and waits for user input. I need to handle communication with such programs.
    So far it doesn't go smooth - please look at the code below, there must be number of bugs:private static void execute(String command) // command="cmd.exe /c format A:"; (Win2k)
         try {
         String outp_line;
            Process process = Runtime.getRuntime().exec(command);
         // put process input in BufferedReader
         BufferedReader normalBR =
              new BufferedReader(new InputStreamReader(process.getInputStream()));
         // "format A:" on win2k sends to console 2 lines:
         // 1. Insert disk in drive A:
         // 2. and press ENTER
         // but I see only one(first) line. Why?
         while ((outp_line = normalBR.readLine()) != null)
                        System.out.println(outp_line);
         // assign an output stream to the process
         BufferedOutputStream bos = new BufferedOutputStream(process.getOutputStream());
         // assign input from user to BufferedInputStream
         byte[] bytes = new byte[12];
         BufferedInputStream bis = new BufferedInputStream(System.in, 12);
         // read user's input
         bis.read(bytes);
         // write user's input to the process
         bos.write(bytes);
         }catch(IOException ioex){ioex.printStackTrace();}

    Don't know about the first thing, but I saw this in the API:
    "The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Microsoft Windows, or shell scripts. The created subprocess does not have its own terminal or console. All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock."
    I'd suggest googling for a workaround.
    Re: the second item, I think another thread makes sense. Perhaps a thread that reads all the error output and stores it in a buffer, which could then be queried.

  • Calling Servlet from a java prog?

    Hi all,
    I am calling servlet from a java prog (Java Agent in Lotus Notes) by using URL and URLConnection object. how can i trigger the Servlet By using doPost method .I have to send some parameter also.
    Thanx
    Muthu

    you need to open a connection to the servlet. Then you must call getInputStream() and getOutputStream() and use them in any way you see fit. I was trying this before and could not get POST to work unless I openned the input stream from the servlet. Strange... but doGet worked without openning the input stream???
    // open a connection....
    // write to the servlet
    servletConnection.getOutputStream().write("whatever");
    servletConnection.getOutputStream().flush();
    servletConnection.getOutputStream().close();
    // grab what the servlet sends back, required to do a post.
    byte [] in = new byte[100];
    servletConnection.getInputStream().read(in);
    servletConnection.getInputStream().close();

  • Through a java prog how to execute a unix script ?

    Hi !! I am a Java Developer . I have to work in Unix and Java in combination. Can you plz suggest me a solution for the below queries --
    1. Through a java prog how to execute a unix script.
    2. How to send the o/p of the script to a java prog so that it can be used in the java program to the prupose of display etc..

    Try this
    Process process = Runtime.getRuntime().exec("ps -ef");//write Your command here
                   InputStream in = process.getInputStream();
                   BufferedReader bufReader = new BufferedReader(new InputStreamReader(in));
                   String data=null;
                   while((data = bufReader.readLine())!=null)
                        System.out.println(data);   //do whatever you want to do with the output

  • Java prog is very slow

    hai
    i am beginner level in java prog
    i insert data in ms sql server 2000. i am insert 5000 record in database . but i am application take long time .pls give advise for me
    very quick
    import java.sql.*;
    public class SqlDatabase
              public Connection connection;
              public boolean openConnection(String strServerIPAddress, String strDatabaseName, String strUserName, String strPassword)
                   String url = "jdbc:microsoft:sqlserver://" + strServerIPAddress + ":1433" +";DatabaseName=" + strDatabaseName;
                             try
                             //Loading the driver...
                             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
                             //Buiding a Connection
                             connection = DriverManager.getConnection(url, strUserName, strPassword);
                             if(connection== null )
                             return false;
                             //catch( java.sql.SQLException e )
                             catch (SQLException e)
                             System.out.println(e.getMessage());
                             return false;
                             return true;
              public void SqlDataInsert(String Random_num,String Check_Sum)throws Exception {
                   //DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
                   //Connection connection = DriverManager.getConnection( "jdbc:microsoft:sqlserver://202.146.65.221:1433;DatabaseName=MMS_Gateway","Tech","tech32132");
                        if (connection != null)
                             try {
                                  Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
                                       ResultSet resultSet = stmt.executeQuery("select * from Random_CheckSum where 1=2");
                                       resultSet.moveToInsertRow();
                                       resultSet.updateString("Random_Number",Random_num);
                                       resultSet.updateString("Check_Sum",Check_Sum);
                                       resultSet.insertRow();
                                       System.out.println("Data Sroted in Database");
                                  } catch (SQLException e) {
                                       System.out.println(e.getMessage());
    }

    now my java prog is very fast . now take 15 sec to 20 sec for insert 5000 records
    now i have change my code is
    import java.sql.*;
    public class SqlDatabase
              public Connection connection;
              public boolean openConnection(String strServerIPAddress, String strDatabaseName, String strUserName, String strPassword)
                   String url = "jdbc:microsoft:sqlserver://" + strServerIPAddress + ":1433" +";DatabaseName=" + strDatabaseName;
                             try
                             //Loading the driver...
                             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
                             //Buiding a Connection
                             connection = DriverManager.getConnection(url, strUserName, strPassword);
                             if(connection== null )
                             return false;
                             //catch( java.sql.SQLException e )
                             catch (SQLException e)
                             System.out.println(e.getMessage());
                             return false;
                             return true;
              public void SqlDataInsert(String Random_num,String Check_Sum)
                   if (connection != null)
                              try {
                                   String Sql="INSERT INTO Random_CheckSum (Random_Number, Check_Sum) VALUES(?, ?)";
                                        PreparedStatement pstmt =connection.prepareStatement(Sql);
                                        pstmt.setString(1, Random_num);
                                        pstmt.setString(2, Check_Sum);
                                          pstmt.executeUpdate();
                                       System.out.println("Data Sroted in Database");
                                  } catch (SQLException e) {
                                        System.out.println(e.getMessage());
    } Thank for all

  • Writting java graphics and textual data from java application into MS word

    By using POI API, I could write textual data into MS word by using
    java application. Could any one help me out how to write
    Java graphics(i.e. Writting JPanel) and textual data(i.e.IOStream data) both into MS word document.
    Thank you for time spent.
    Thanks with regards,
    Mallik

    hi:
    Can any one help me out how to read and write in to the MsWord using POI...plz it is very urgent...plz give ur reply to [email protected]

  • Where do i write java code

    I am a java beginner. i need to know which interface i can use to write java code

    Hi ,
    u can write java code in many places
      notepad,
      edit plus ,
      eclipse ,
      netbeans ,
      NWDS (in j2ee perspective thisis for sap side )
    all the thing u need to install jdk first ...
    set your class path .
    go to command promt -> type cmd
    ur command prompt opens .
    open note pad write some code
    execute in command promt  by typing javac  abc.java
    i fno errors  type  java abc
    ur code will be executed and result displayed
    regards ,
    venkat p

  • Can i write java in JSF

    i need to write java code in JSF. can i use scriptlet <%%> as i use in JSP? if not than How can i write?
    thanks..

    The short answer is no.
    The medium answer is yes you can, no you may not.
    The long answer is that there is always a better way to do it than writing code on the page. Its very tempting, it can be fast, it may even work. Either you or whoever comes after you will regret the decision. The problem is you'll probably end up not knowing what decisions your code is making and where they are being made. Force yourself to do it the "right" way and coming back to your pages to make changes will be a much more pleasant task.

  • How to write Java Scripts in Apex

    Hi All,
    Can any on tell me how to write Java Scripts in Apex.
    Thanks in Advance,
    Mukund

    If you want to link your custom JavaScripts to an Apex page, you have several options:
    1. Add an HTML Region on Page 0 (Script will be written to every page) called something like "JavaScript & CSS". In this region add your Script to the region source like this:
    <script language="JavaScript">
    function hell ()
    alert ("Hello World");
    </script>
    2. Add a similar region to the page you are working on (can only be accessed on this page)
    3. Create an external JavaScript file and either load it into the WORKSPACE or into the images (/i/) directory on the server. You can then link the JS into you page via modifying the Page Template.
    Hope that makes sense. Let me know if you want any further help with option 3.
    Duncs

  • Can I write java/EJB in forms 6i builder

    Can I write java/EJB in forms 6i builder? As I want to know except PL/SQL, what other programming languages can be used in forms 6i

    There are a couple of different ways - You can use ORA_FFI to call out to other foreign functions. You can use the Java Importer which creates PL/SQL wrappers to call Java. You can also integrate Java on the client side (Java Beans and Pluggable Java Components).
    Info on this can be accessed from the on line help and there are a couple of good papers on OTN about the Java integration.
    Regards
    Grant Ronald
    null

  • Erase a file from a java prog?

    Hello.
    Is it possible to erase an image in a directory from a java program? Or do I have to create a shell script that I call in the java program?
    I saw somewhere on the web that it wasn't possible to call a shell script from a java prog, so if there's a method in java that does it, I would be glad to know it. Any help would be appreciated.
    Many thanks
    Philippe

    thanks, guys.
    But I get a io.FilePermission... with the two methods.
    I checked my permissions, and it's all right
    what's happening?What do you mean by "I get a io.FilePermission" ?
    What exactly do you get ?
    Which two methods are you talking about ?
    If the file can't be deleted the file may be used by another ( hanging) process.

  • What is the best IDE to write java?

    I was wondering if somebody can tell me what is the best IDE to write java?

    Search the forums for "Best IDE", which has been asked a zillion times.

  • What happen when i compile a java prog.

    I, to an extend know how to code using java. However I don know what really happens after compiling a java prog and what happens when i run it.. what is JVM, JDK, JIT etc., means.. What is a class file and a jar file and a war file.. I'm confused.. ANy help is really appreciated..
    Thanks in advance..
    regards.

    Java source is compiled into "portable byte code" (a class file).
    The JVM (virtual machine) interprets the "portable byte-code" into "machine instructions"... The actual instructions may vary from platform to platform, but the contract is they will allways have the same effect.
    JIT stands for "Just In Time"... as usually means "JIT-compiler"... which is fancy pants name for an interpreter.
    Google will tell you more.

  • Anybody write Java assembly code?

    I recently stumbled onto the Jasmin (http://jasmin.sourceforge.net/) and BCEL (http://jakarta.apache.org/bcel/) projects and have a question for all the Java developers out there.
    Have any of you ever written Java assembly/byte code directly instead of writing Java source code? You're probably asking "why the hell would someone write Java bytecode when they have a great high-level language like Java?" Well that's what I want to find out. Why would you write Java assembly code? What cool things have you done with Java assembly code?

    -insert tracing instruction before every executable statement of code for dynamic coverage analysis.
    -insert timing instructions at the top and bottom of every method for dynamic profiling
    -generate dynamic stubs/ adapter code
    Folks generally don't program using java assembly, as far as I know, but use these tools to programmatically create/alter code.

  • How to write java code to read the pixel color in some place of screen?

    Hello all:
    How to write java code to read the pixel color in some place of screen?
    The java application iteself doesn't have any GUI.
    thank you
    -Danel

    See java.awt.Robot

Maybe you are looking for

  • Setting Default Views of Mounted Server Shares

    In OS X 10.5 server, how do I change the owner of a volume? So I can do the stuff below? Do I change the owner in the Finder...? Or do you use the OS X Server admin utility type programs? Thanks Re: Setting Default Views of Mounted Server Shares Post

  • Help my MacBook Pro is stuck on blue screen

    I open my MacBook Pro running on lion os and its stays stuck on a blue screen, how do I reboot or get out of it? Thanks,

  • Characteristics values for material and plant

    Hi Experts, I need to fetch characterstic values from a class Y-xx . I belive badi BAPI_CLASS_GET_characteristics will give the result but my problem is in selection screen I am passing material no and plant for this material and plant i need to fetc

  • WCF-SQL Debatch and Map: Error

    I am using WCF-SQL to poll and fetch a bunch of records. I then debatch them. (Tested the output and it's ok). As a next step, I applied a map between the debatched schema and my canonical schema. Testing the map worked well. On deploying and running

  • Customer contact in collections

    Hi gurus, I have created in customer master data information about customer (name, fax, email...). When I transfer a customer to a business partner this information appears. My question is: In UDM_SUPERVISOR, how can you see this information that I i