Java 5.0 x others

Dear Friends:
After some stopped time, I came back my studies of the language Java.
I use as reference the book of the Deitel (Java How To Program - 3� edition). Parallel, I will go to study p certification (Sun Certified Programmer & Developer will be 2 Java Study Guide (Exam 310-035 & 310-027) by Kathy Sierra, Bert Bates).
Although I installed Java 5,0, but the books that I have are based on versions 1,2 and 1,4 of j2se. It would like to know if somebody can inform some to me link where meeting "details" of all the new functionalities of the Java the 5 in relation previous versions.
Thanks

Google is your friend: http://www.google.com/search?q=java%205.0%20changes
and please don't crosspost

Similar Messages

  • How can I run Runtime.exec command in Java To invoke several other javas?

    Dear Friends:
    I met a problem when I want to use a Java program to run other java processes by Runtime.exec command,
    How can I run Runtime.exec command in Java To invoke several other java processes??
    see code below,
    I want to use HelloHappyCall to call both HappyHoliday.java and HellowWorld.java,
    [1]. main program,
    package abc;
    import java.util.*;
    import java.io.*;
    class HelloHappyCall
         public static void main(String[] args){
              try
                   Runtime.getRuntime().exec("java  -version");
                   Runtime.getRuntime().exec("cmd /c java  HelloWorld "); // here start will create a new process..
                   System.out.println("Never mind abt the bach file execution...");
              catch(Exception ex)
                   System.out.println("Exception occured: " + ex);
    } [2]. sub 1 program
    package abc;
    import java.util.*;
    import java.io.*;
    class HelloWorld
         public static void main(String[] args){
         System.out.println("Hellow World");
    } [3]. Sub 2 program:
    package abc;
    import java.util.*;
    import java.io.*;
    class HappyHoliday
         public static void main(String[] args){
         System.out.println("Happy Holiday!!");
    } When I run, I got following:
    Never mind abt the bach file execution...
    I cannot see both Java version and Hellow World print, what is wrong??
    I use eclipse3.2
    Thanks a lot..

    sunnymanman wrote:
    Thanks,
    But How can I see both programs printout
    "Happy Holiday"
    and
    "Hello World"
    ??First of all, you're not even calling the Happy Holiday one. If you want it to do something, you have to invoke it.
    And by the way, in your comments, you mention that in one case, a new process is created. Actually, new processes are created each time you call Runtime.exec.
    Anyway, if you want the output from the processes, you read it using getInputStream from the Process class. In fact, you really should read that stream anyway (read that URL I sent you to find out why).
    If you want to print that output to the screen, then do so as you'd print anything to the screen.
    in notepad HelloWorld.java, I can see it is opened,
    but in Java, not.I have no idea what you're saying here. It's not relevant whether a source code file is opened in Notepad, when running a program.

  • How can i let my java application closes the other opened windows

    how can i let my java application closes the other opened windows: like any other Microsoft Internet Explorer windows ... provided that my java application is not the one i used to open those other windows.... thanks in advance

    you'll have to use JNI to access the windowAPI
    then you need a list of window handles ... I think there was a function called getWindow and in order to close them you use sendMessage .... for details check out msdn (microsoft developer network)
    somwhere I saw a tool called JUtil, which might help you getting started on accessing the win api from java
    regards
    Spieler

  • Need a lot of custom JComponents, but Java just too 'slow', other Solution?

    Hi folks,
    first of all i'll try to explain my problem (although my english is quite bad)
    We're programming a tool for visualising graph algorithms (df search, strong connected components, transitive reduction etc.) For that, we got a drawing area (derived from JLayeredPane) which contains the Nodes and the Edges of a graph (for all that don't know what a graphs is, just imagine these nodes as numbered circles, and the edges as directed lines from one node to another).
    Both parts (Nodes and Edges) are derived from JComponent, because a) need MouseEvents on these Components and b) we need the ability to add them to a container (like JLayeredPane)
    An absolute requirement is that you can directly click on the edges (to mark them, or delete them etc)
    Another point which needs to be mentioned, the edges maintain a (invisible) polygon which lies around their line, this polygon is sensitive for mouseEvents.
    Now there are two main problems:
    * all these edges have (due to JComponent) (possibly) huge invisible rectangles (the only thing that really matters is the line from one corner of this rect. to the other) ...so if i got lets say a graph with 10.000 edges, there are a lot of edges that overlap (nearly 10.000 :) ) ... but only the Edge-object on top receives the MouseEvent (but perhaps the user wanted to cklick a edge that lies below the top-edge!) .. at the moment, the program looks at all edges below that which received the MouseEvent and checks wether the 'mouse'click' hits a polygon, If it does, the top edge dispatches the MouseEvent to that edge. (furthermore, due to the depth-order in a Layer of a JLayeredPane, we only need to look at all edges that are really below the egde that received the mouseEvent)
    This all works great for 'small' numbers of edges (approximately 1000-2000) but with a rising number of edges this attempt gets slower and slower (it takes 1-3 seconds to evaluate a single mouseclick on a Sun Ultra 5/333)
    * the bigger problem is, that if i got 10k+ JComponents in a Container Java gets really slow, just adding these 10k JComps. (to the JLayeredPane) takes some minutes?! Furthermore java consumes up to 200+ MB main memory in this situation.
    One solution we are currently thinking about is to implement these edges as 'pure graphics'-objects (for example the Container just draws all edges).. this probably solves problem # 2 but # 1 gets even worse (no depth-order, some more coordinates hassle)
    So, i hope someone can give me a hint for this problem or someone has had a similar problem before and has a good solution? (if the problem isnt clear, just ask)

    I worked on an application once that had a similar structure as yours, but we were only scaling up to about 1000-2000 components. The problem that we identified (and that you have, no doubt, also identified) is that you are searching all of the child components on every hit test/overlap test. What we did was to subdivide out outermost container so that it had a couple of dozen children, each of which then parented some of the original child components: this cut our search space for every hit test dramatically. We had the advantage of having collections of child componenents that we knew would not overlap so our first level containers did not overlap -- you may need your first level containers to overlap, but even with this, you'll still be able to much more quickly identify components in the immediate region that should be checked individuall.

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • Access mirror site using java, download files and other information?

    Hi, I have 2 nodes/servers on the system both running webservers and having the same interface, but at a time user will access one node at a time from their browser, but this interface will be able to allow the user to get information from the both the nodes. the information that the user can get is DB stored as well as files on the disk of either node.
    i can manage the DB, cuz there is nothing to it, but how do I get files from the other node?
    currently any files/web documents are all stored in a application directory of the web root and protected by htaccess i believe, so when a user logs on to node one he can access all plain text/binary files along with web content since the web server authorizes the user to access anything in that dir. but at the same time from the same session I want to be able to access files in a mirror site using the same username and password and not having him to enter it again. the username/pass combo is replicated on both the servers, it this possible?
    currently i use the http password protection provided by apache to access one node, but can i use the same session on another machine with the same credentials?
    If this is not possible how can i do this programatically using java? can i do can "ls" on the directory i want on another server and display the list to the user and then when he clicks on that file name i fetch it from the backup/mirror server and have him save it using http or ftp?
    It would be great if we can get a solution to this.
    Thank you very much in advance.
    Ankur

    If you install the web server on different machines, It is possible to share the informations between them.

  • Errors in a Java class when calling other methods

    I am giving the code i have given the full class name . and now it is giving the following error :
    Cannot reference a non-static method connectDB() in a static context.
    I am also giving the code. Please do help me on this. i am a beginner in java.
    import java.sql.*;
    import java.util.*;
    import DButil.*;
    public class StudentManager {
    /** Creates a new instance of StudentManager */
    public StudentManager() {
    Connection conn = null;
    Statement cs = null;
    public Vector getStudent(){
    try{
    dbutil.connectDB();
    String Query = "Select St_Record, St_L_Name, St_F_Name, St_Major, St_Email_Address, St_SSN, Date, St_Company, St_Designation";
    cs = conn.createStatement();
    java.sql.ResultSet rs = cs.executeQuery(Query);
    Vector Studentvector = new Vector();
    while(rs.next()){
    Studentinfo Student = new Studentinfo();
    Student.setSt_Record(rs.getInt("St_Record"));
    Student.setSt_L_Name(rs.getString("St_L_Name"));
    Student.setSt_F_Name(rs.getString("St_F_Name"));
    Student.setSt_Major(rs.getString("St_Major"));
    Student.setSt_Email_Address(rs.getString("St_Email_Address"));
    Student.setSt_Company(rs.getString("St_Company"));
    Student.setSt_Designation(rs.getString("St_Designation"));
    Student.setDate(rs.getInt("Date"));
    Studentvector.add(Student);
    if( cs != null)
    cs.close();
    if( conn != null && !conn.isClosed())
    conn.close();
    return Studentvector;
    }catch(Exception ignore){
    return null;
    }finally {
    dbutil.closeDB();
    import java.sql.*;
    import java.util.*;
    public class dbutil {
    /** Creates a new instance of dbutil */
    public dbutil() {
    Connection conn;
    public void connectDB(){
    conn = ConnectionManager.getConnection();
    public void closeDB(){
    try{
    if(conn != null && !conn.isClosed())
    conn.close();
    }catch(Exception excep){
    The main error is occuring at the following lines connectDB() and closeDB() in the class student manager. The class dbutil is in an another package.with an another file called connectionManager which establishes the connection with DB. The dbutil has the openconnection and close connection methods. I have not yet written the insert statements in StudentManager. PLease do Help me

    You're doing quite a few things that will cause errors, I'm afraid. I'll see if I can help you.
    The error you're asking about is caused by the following line:
    dbutil.connectDB();
    Now first of all please always ensure that your class names begin with capital letters and your instances of classes with lowercase letters. That's what everybody does, so it makes your code much easier to follow.
    So re-write the couple of lines at the beginning of your dbutil class like this:
    public class Dbutil {
    /** Creates a new instance of Dbutil */
    public Dbutil() {
    Now you need to create an instance of dbutil before you can call connectDB() like this:
    Dbutil dbutil = new Dbutil();
    now you can call the method connectDB():
    dbutil.connectDB();
    The problem was that if you don't create an instance first then java assumes that you are calling a static method, because you don't need an instance of a class to call a static method. If it was static, the method code would have been:
    public static void connectDB(){
    You have a fine example of a static method call in your code:
    ConnectionManager.getConnection();
    If it wasn't a static method your code would have to look like this:
    ConnectionManager connectionManager = new ConnectionManager();
    connectionManager.getConnection();
    See the difference? I also know that ConnectionManager.getConnection() is a call to a static method because it begins with a capital letter.
    Anyway - now on to other things:
    You have got two different Connection objects called conn. One is in StudentManager and the other is in Dbutils, and for the moment they have nothing to do with each other.
    You call dbUtil.connectDb() and so if your connectDb method is working properly you have a live connection called conn in your dbUtil object. But the connection called conn in StudentManager is still null.
    If your connection in the dbUtil object is working then you could just add a line after the call to connectDb() in StudentManager so that the StudentManager.conn object references the dbUtil.conn object like this:
    dbutil.connectDB();
    conn = dbUtil.conn;

  • How to run java source files from other java files??

    hello all,
    i need to run 3 to 4 .java files (first.java,second.java,third.java) from one file.
    i tried the
    Runtime.getRuntime().exec(cmd); but here cmd must be an exe file.
    NOTE THAT i need to run the first.java file ,second.java file each time to generate their .class files(ie I NEED TO COMPILE THEM ALL TIMES AND THEN RUN THEM)
    PLZ. help me if this can be done,
    warm regards,
    Vishal.

    One way to do this is to put all your commands into a batch file (this is Windows?) try unix shell otherwise. Anyway here's an example .bat file called cmplrun.bat:
    @echo off
    javac -classpath . TestCase*.java
    java -cp . TestCase01
    java -cp . TestCase02
    java -cp . TestCase03Then the Java pgm can look like this:
    import java.io.*;
    public class RunProcess {
      public static void main(String[] arg) {
        try {
          Process myProcess;
          myProcess = Runtime.getRuntime().exec("cmd /c cmplrun");
          String s = null;
          DataInputStream in = new DataInputStream(
                               new BufferedInputStream(
                                   myProcess.getInputStream()));
          while ((s = in.readLine()) != null) {
            System.out.println(s);
          System.exit(0);
        catch (IOException e) {
          System.out.println("Exception: "+ e);
          System.exit(-1);
    }Just one way to do this, all caveats apply and HTH;
    ~Bill

  • Java application launching an other using Runtime.exec()

    I have a Gui java appication that starts an other Gui java application by this way:
    Runtime.getRuntime().exec("java -classpath ....")
    At first a MSDOS window appears.
    Then the new Gui window is display only if i change the size of the first Gui wiindow several times !
    I works on Windows NT with jre 1.2
    Is somebody knows the reason why the Gui not appears automatically and how to do it ?
    Thanks in advance.

    Yes, using javaw do not open MSDOS window but my problem is still the same:
    the window of the 2d Gui is displayed only if i change several ltimes the size of the 1st Gui window !
    An other sign: if i close the 1rst Gui after the 2d is launched , the 2d Gui is displayed !
    Nevertheless these two applications run in independent process ?
    Have you an idea ?

  • Java file cannot access other class in same package???????

    I have written a bean as follows-------
    package CustTags;
    public class TomMovieBean
         private String movieName;
         private String movieDirector;
         public void setmovieName(String movieName)
              this.movieName = movieName;
         public String getmovieName()
              return this.movieName;
         public void setmovieDirector(String movieDirector)
              this.movieDirector = movieDirector;
         public String getmovieDirector()
              return this.movieDirector;
    Now i am writing a tag handler for my JSP custom tag as follows----------
    package CustTags;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.*;
    public class Dynamic extends TagSupport
         private List movieList;
         public void setmovieList(List movieList)
              this.movieList = movieList;
         public int doStartTag() throws JspException
              Iterator iterator = movieList.iterator();
              TomMovieBean TMBObj = null;
              try
                   JspWriter out = pageContext.getOut();
                   while(iterator.hasNext())
                        TMBobj = (TomMovieBean)iterator.next();
                        String movieName = (String)TMBObj.getmovieName();
                        String movieDirector = (String)TMBObj.getmovieDirector();
                        out.println(movieName+"...."+movieDirector+"<br>");
              }catch(Exception ex)
                   throw new JspException("Error in doStartTag()");
              return SKIP_BODY;
    Now when i compile Dynamic.java it shows foll. errors
    Dynamic.java:19: cannot resolve symbol
    symbol : class TomMovieBean
    location: class CustTags.Dynamic
    TomMovieBean TMBObj = null;
    ^
    Dynamic.java:27: cannot resolve symbol
    symbol : variable TMBobj
    location: class CustTags.Dynamic
    TMBobj = (TomMovieBean)iterator.next();
    ^
    Dynamic.java:27: cannot resolve symbol
    symbol : class TomMovieBean
    location: class CustTags.Dynamic
    TMBobj = (TomMovieBean)iterator.next();
    ^
    3 errors
    I am unable to comprehend why it can't recognize TomMovieBean despite the fact that its a public class and in the same package as that of Dynamic.java

    Is your classpath set correctly? I.e. does it point to the directory containing the CustTags directory?
    BTW, by convention, package names are written in lower case.

  • How to develop a Java code that allows other applications to interact

    I would like to program a Java code, in order to allow to third party
    applications (e.g. VB or Power Builder applications ) to call specific
    functions (exposed by me). Is this possible in Java?
    As i m totally new to Java ... i need to know where to start with
    Should i go with
    - Applet or
    - Servlet or
    - Beans
    Thanks :)

    Thanks for the advice dude .. i appreciate what you just said ... i will go thru it definitely ...
    i m not very new to Java ... i m confortable with Core Java ... Just i wanted to understand whether i shud go with JavaBeans ?
    and if so,
    as i understand it correctly ... the jar file will be placed on the third party tool application server(developed in ASP) and the application will call the function (of my jar file)along with parameters to that jar file thru an interface ... and my jar file will calculate the logic and return the string to the applications ASP Page.

  • How java application can access other java application

    Hi everyone,
    Please help me, I need to know how I can make my java program,
    specifically a servlet, access other java application continuously running a single instance in java virtual machine, and vice-versa.
    thanks in advance

    A java application is just a bunch of classes with one designated as a main class. You can simply ensure the classes are available to the server's jvm and then load and run the "external" program as part of the servlet process.
    If you have full access, and which external program is to be run, you can simply import it in your source.
    If your don't have the details at run time use the java.reflect.* stuff to load and run the class dynamically.

  • Make Java program run on other pc's

    Good afternoon,
    So I have this Java program compiling on my pc through NetBeans.
    Now if I want this program to run on other pc's on its own (without NetBeans or any other program), preferably through a GUI, do I have to convert it to a JAR file? How does this exactly works out?
    Thanks for your help.

    alley wrote:
    So I have this Java program compiling on my pc through NetBeans.And Netbeans does it using the JDK. it is always the JDK, no matter how many tools you wrap around it on top. You don't need Netbeans to run your stuff either, it is merely a development convenience that Netbeans provides you.
    >
    Now if I want this program to run on other pc's on its own (without NetBeans or any other program)Impossible - you need at least a compatible Java runtime.
    , preferably through a GUIYou mean by double clicking on the program icon through the OS?
    , do I have to convert it to a JAR file? That would be an easy way yes - an executable jar to be more precise
    How does this exactly works out?Netbeans builds the jar automatically, just check out the folders of your project to find it. If you set a main class in the project properties, it is even an executable jar. Double click it and if the Java runtime is properly setup (which tends to be the case when it installs succesfully, but many people manage to screw it up in a way I can't imagine anyway), it will run.
    For further guidance, check the online netbeans manual and research executable jars.

  • Change Java.exe to some other name

    I have jdk1.6.0 installed on my machine with jre1.6.0
    when i am running any application its process is running default java.exe
    java.exe in Task Manager.
    How to change the java.exe name to java1.exe .

    Rename the exe on the disk.
    There are utilities in Unix which allow you to change the name a process appears to have. But since you said .exe, I guess you're using Windows.
    I've done this very successfully before. I have n batch files as part of a product which start different components of the project, each one does something like this...
    if exists ..\jre\bin\blah.exe goto blahexists
    copy ..\jre\bin\java.exe ..\jre\bin\blah.exe
    :blahexists
    ..\jre\bin\blah.exe -cp blah blah
    In that way, each batch file can dynamically create a new .exe as approprate and the Windows task manager will show you blah.exe (and foo.exe and myserver.exe) instead of java.exe, which means you can kill them! :-)

  • Can you tell me some good java web sites or other tech sites

    thank you

    java.sun.com
    www.onjava.com
    www.sourceforge.org
    www.javaranch.com
    Dont forget:
    www.google.com (U can find any example you want)

Maybe you are looking for

  • Report-Total Discount of total product for perticular time

    Hi Experts., my client gave a requirement ,he wants a report  on Total Discount of total product sold by giving item and material group. The report is unavailable in Stanadard hence have to develop. i need some help in creating this Report, With the

  • Show ip nhrp issue

          my company uses dmvpn to connect with branch,but sometime when i “show ip nhrp bri " , i got some issus ,       the show information 3925VPN#sho ip nhrp bri   Target            Via            NBMA          Mode  Intfc  Claimed 192.168.96.2/32  

  • - About the new Flash object fix in 8.0.2

    Any way to tell DW8.0.2 not to automatically create a Scripts folder and new .js file when inserting a Flash object, but STILL have it insert the HTML portion? Reason I'm asking is because I've got the .js part included in my main .js file on all my

  • Database startup failure

    I have installed the NW4-Testdrive on a SuSE Linux 9.0 System. All installation processes have been finished very well. After I typed 'sapstart' (in user context of nw4adm, as described) the saposcol starts up all right. But starting the database fai

  • Is it possible to add additional features, such as I had in iTunes? What I mean is: how could I add comments for example of an ebook; or the publisher?

    Is it possible to add additional features, such as I had in iTunes? What I mean is: how could I add comments for example of an ebook; or the publisher?