Question about Java programming development

There are five phases in java program development. They are: edit -> compile -> load -> verify -> execute
However, every time I develops program. I only experience phase 1, phase 2 and phase 5. I always miss phase 3 and 4. When do the class loader and bytecode verifier work? How do they work?
Second question, how the legitimate programs can execute automatically without typing command java to invoke the interpreter?

lighthero wrote:
I still have some questions.
1. I want to run the program just like the commercial software such as Adobe and MS Office.(just double click to run the program.) How do I execute a java program without typing command java every time?Create an executable JAR: [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
>
2. How does the JIT compiler work?[http://www.google.ca/search?q=Java+JIT]

Similar Messages

  • Question about Java Program

    I have a question here that I cant seem to figure out.
    I would really appreciate it if someone would help me out with the answer. I just got started learning Java and have a question:
    Suppose list is an array of five components of the type int. What is stored in list after the following Java code executes?
    for(int index = 0; index < 5; index++)
    list(index) = 2 * index + 5;
    if(index % 2 ==0)
    list[index] = list[index] -3;
    I would really appreiciate it if someone could help me out with this problem.

    This doesn't seem like a JSC-related problem, but I'll answer it anyways...
    list(index) = 2 * index + 5;This should probably be list[index] = 2 * index + 5
    The array will, after execution, contain
    {2, 7, 6, 11, 10}

  • Questions about the Apple Developer Enterprise Program

    Hi there,
    i got some questions about the Apple Developer Enterprise Program:
    - is there a way a company can create their own "AppStore" with only the APPs the employees should use?
    - when I developed the enterprise app are the install files on a apple hosted server or do i need my own infrastructure to distribute my app?
    Thanks in advance for answers!

    Google: MDM

  • Question about the programming of a legend

    Hello everybody,
    I have a question about the programming of a waveform's legend. I
    already asked here in this forum about the legend programming (03)
    months ago.
    I went satisfied but I ve just noticed that this code
    (See Code old_legend_test.llb with main.vi as main function) operates a
    little different from my expectances.
    Therefore I have a new question and I want to know if it
    is possible by labview programming to plot and show, on a waveform
    chart, a signal with activ plot superior to zero (0) without to be
    obliged to plot and show a signal with activ plot equal to zero (0) or
    inferior to the desired activ plot.
    I give you an example
    of what I m meaning. I have by example 4 signals (Signal 0, 1, 2 and 3)
    and each signal corresponds respectively to a channel (Chan1, Chan2,
    Chan3, Chan4). I want to control the legend (activ plot, plot name and
    plot color) programmatically. Is it possible with labview to plot signal
    1 or 2 or 3 or (1, 3) or (2,3) or (1,2,3) or other possible combination
    without to active the signal with the corresponding activ plot zero
    (0)?
    Let see the labview attached data
    (new_legend_test.llb with main.vi as main function). When I try to
    control the input selected values again I get them back but I don't
    understand why they have no effect on the legend of my waveform chart.
    Could somebody explain me what I m doing wrong or show me how to get a
    correct legend with desired plots? Thank by advance for your assistance.
    N.B.
    The
    both attached data are saved with labview 2009.
    Sincerly,PrinceJack
    Attachments:
    old_legend_test.llb ‏65 KB
    new_legend_test.llb ‏65 KB

    Hi
    princejack,
    Thanks for
    posting on National Instruments forum.
    The behavior
    you have is completely normal. You can control the number of row displayed in
    the legend and this rows are linked to the data you send to your graph. Thus,
    if you have 3 arrays of data, let say chan1, chan2 and chan3, you can choose
    which data you want to display in your graph using the property node (Active
    plot and visible). But for the legend as you send 3 plots there is an array of
    the plot name [chan1, chan2, chan3] and you can display 0, 1, 2 or 3 rows of
    this array but you cannot control the order in this array! So, to be able to
    change this array you have to only send data you need to you graph. I'm not
    sure my explanations are clear so I have implemented a simple example doing
    that.
    Benjamin R.
    R&D Software Development Manager
    http://www.fluigent.com/
    Attachments:
    GraphLegend.vi ‏85 KB

  • Three questions about Java and Ftp

    Hello, i've the following questions about Java and Ftp:
    1- .netrc file is in $HOME directory but i can't access to this directory from java code. The following line producesan Exception (directory doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");
    2- .netrc file must have the following permissions: -rw- --- --- but when i create the .netrc file the following permissions are on default: -rw- r-- r--, how can i change this permissions? (In java code, i can't use chmod.....)
    3- Are there any way to pass parameters to a .netrc file? If i get to do this i needn't change the permissions because i can't modify or create/destroy this file.
    Thanks in advanced!!!
    Kike

    1- .netrc file is in $HOME directory but i can't
    access to this directory from java code. The
    following line producesan Exception (directory
    doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");$HOME would have to be replaced by a shell, I don't
    think you can use it as part of a legal path.
    Instead, use System.getProperty("user.home");
    Ok, thanks
    2- .netrc file must have the followingpermissions:
    -rw- --- --- but when i create the .netrc file the
    following permissions are on default: -rw- r--r--,
    how can i change this permissions? (In java code,i
    can't use chmod.....)Yes, you can: Runtime.exec("chmod ...");
    I need to use estrictly the .netrc with -rw- --- --- permissions
    Yes, i can use Runtime.exec ("chmod ..."); but i don't like very much this solution because is a slow solution, am i right?
    3- Are there any way to pass parameters to a.netrc
    file? If i get to do this i needn't change the
    permissions because i can't modify orcreate/destroy
    this file.I don't think so. Why do you need the .netrc file in
    Java at all? Writing a GUI frontend?I want to use automatic ftp in a java program and FTP server, the files and path are not always the same, so i can:
    - modify .netrc (for me is the complex option)
    - destroy and create a new .netrc (is easier but i have permissions problem)
    - use .netrc with parameters but i haven't found any help about it
    Thanks for your prompt reply!!!!
    Kike

  • [Theory] A simple but hard question about OO programming

    I was in my first class of OO programming (4th year of computer engineering in Valencia) and the professor gave us homework.
    The homework was a simple question about OO programming (it is not about a specific language, though we are going to use Java in the practice sessions), we shall find an answer to it and discuss it in class the next day.
    The question was:
    "May classes also be objects?"
    which can be said as:
    "May classes be instances of an(other) classes?"
    I hope that you, archers, can enlighten me in this question

    tvale wrote:I believe an object is an instance of a class.
    Yup, that's true. Let's see... An object is an instance of a class, so we can have a lot of objects coming from one class.
    We can say an object is not a class because it has a state (think about a light, it has a state: on or off, but a class light is not on/off, because in a class we just describe the behavior that class should have.
    But what we're asking here is if a class can have a state. I think it may refer to static properties about the objects.

  • Question about Java's HttpServer: Threading? Backlog?

    Hello,
    I have two questions about Java's HttpServer (com.sun.net.httpserver). From the JavaDoc:
    >
    Management of threads can be done external to this object by providing a Executor object. If none is provided a default implementation is used.
    >
    How can I get information about the default implementation in 1.6.0_13? Do you know the behavior? From my observations, the default implementation uses no Threads, meaning every request is handled in the same Thread, this results in handling the requests to the HttpServer one after another.
    Is this right?
    The second question is about this, also from the JavaDoc:
    >
    When binding to an address and port number, the application can also specify an integer backlog parameter. This represents the maximum number of incoming TCP connections which the system will queue internally. [...]
    >
    When setting the backlog to -1, it uses the systems default backlog. How can I determine the systems default backlog? Can some lines of Java code reveal it (there is no getBeacklog() method)? Or is it up to the Operating System (we use Redhat Linux)?
    Thanks a lot for your help!
    Regards,
    Timo

    How can I determine the systems default backlog?You can't. There is no API for that even at the C level.
    Can some lines of Java code reveal itNo.
    Or is it up to the Operating System (we use Redhat Linux)?Yes. Linux provides a large default. It seems to be at least 50 on most platforms. This is not something you should be worrying about.

  • My University project about java program plagiarism

    I am working on my Final year Project about java program plagiarism.
    i.e. My system finds similarity between two programs by "Source code" to check whether there are plagiarism.
    And now i need plenty of samples and need your help.
    I need two types of sample:
    1. original version - a version written by your own.
    2. plagiarized version - a version which is copied from original version and has modified to conceal that it is a plagiarism.(Try to treat the teacher)
    My two sample programs are:
    1. Find shortest path by Dijkstra's algorithm.
    2. Find the determinant of a N x N matrix.
    Both programs read data from txt file as input.
    Now, I sincerely invite you to help me to make samples
    You can choose to do the version(original or plagiarized) and the program you like.
    After you have finished, please kindly send to [email protected]
    If you decide to do plagiarized version, please download the following sources and modified them.
    http://myweb.polyu.edu.hk/~04954136d/FYP/shortestpath.zip
    http://myweb.polyu.edu.hk/~04954136d/FYP/determinant.zip
    Thank you very much. Looking forwards to your program.

    Ha ha, good try.
    You know, if you had posted whatever you have achieved so far, you might actually have got the help you so obviously need. But now your only chance of getting any help here is to get yourself another username.
    If this were true, your professors would have gladly supplied you with research material in exchange for use of your "system".
    db
    PS May I add your email to my list?
    http://forum.java.sun.com/thread.jspa?threadID=636123&start=64

  • Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hi ,
    You might want to refer the following link to find your serial number and activate your software .
    Here is the link for the same.
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Let us know how it goes .We'll do the best possible to get your issue fixed.
    Regards
    Sukrit Dhingra

  • Question About Java Threads and Blocking

    I'm helping someone rehost a tool from the PC to the Sun. We're using the Netbeans IDE and the Java programming language. I took a Java course several years ago, but need some help with something now. We're developing a front-end GUI using Swing to allow users to select different options to perform their tasks. I have a general question that will apply to all cases where we run an external process from the GUI. We have a "CommandProcessor" class that will call an external process using the "ProcessBuilder" class. I'm including the snippet of code below where this happens. We pass in a string which is the command we want to run. We also instantiate a class called "StreamGobbler" my coworker got off the Internet for redirecting I/O to a message window. I'm also including the "StreamGobbler" class below for reference. Here's the "CommandProcessor" class:
    // Test ProcessBuilder
    public class CommandProcessor {
    public static void Run(String[] cmd) throws Exception {
    System.out.println("inside CommandProcessor.Run function...");
    Process p = new ProcessBuilder(cmd).start();
    StreamGobbler s1 = new StreamGobbler("stdin", p.getInputStream());
    StreamGobbler s2 = new StreamGobbler("stderr", p.getErrorStream());
    s1.start();
    s2.start();
    //p.waitFor();
    System.out.println("Process Returned");
    Here's the "StreamGobbler" class:
    import java.lang.*;
    import java.io.*;
    // Attempt to make the output of the process go to the message window
    // as it is produced rather that waiting for the process to finish
    public class StreamGobbler implements Runnable {
    String name;
    InputStream is;
    Thread thread;
    public StreamGobbler (String name, InputStream is){
    this.name = name;
    this.is = is;
    public void start(){
    thread = new Thread (this);
    thread.start();
    public void run(){
    try{
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    while (true){
    String s = br.readLine();
    if (s == null) break;
    System.out.println(s);
    //messageWindow.writeToMessageArea("[" + name + "]" + s);
    is.close();
    catch(Exception ex){
    System.out.println("Problem reading stream" + name + "...:" + ex);
    ex.printStackTrace();
    The "CommandProcessor" class calls two (2) instances of the "StreamGobbler" class, one for "stdin" and one for "stderr". My coworker discovered these are the 2 I/O descriptors that are needed for the external command we're running in this case. We're actually called the Concurrent Versions System (cvs) command from the GUI. Here's what we need it to do:
    We want to display the output real-time as the external process is executing, but we want to block any actions being performed on the GUI itself until the process finishes. In other words, we want to show the user any generated output from the process, but don't want to alllow them to perform any other actions on the GUI until this process has finished. If we use the "waitFor()" function associated with a process, it blocks all external process output until the process has completed and then spews all the output to the screen all at once. That's NOT what we want. Also, if we don't use the "waitFor()" function, the code just continues on as it should, but we don't know how to block any actions on the GUI until this process has finished. My coworker tried the following code, but it also blocked any output until the process had finished:
    while (s1.thread.isAlive() || s2.thread.isAlive())
    // We really don't do anything here
    I'm pretty sure we have to use threads for the output, but how do we instantly show all output and block any GUI actions?
    Thank you in advance for your help!

    You're talking about a GUI, but there's nothing in that code which is putting events into the GUI update thread. You also say that nothing happens to the GUI until the CommandProcessor.Run() method returns if you wait for the process.
    This implies that you're calling CommandProcessor.Run() in an ActionListener. This will block the GUI thread until it completes.
    I was going to explain what to do, but a quick Google informed me that there's a new class which is designed to help in these situations SwingWorker (or as a [separate library|https://swingworker.dev.java.net/] if you're not up-to-date yet).

  • Questions about Java Servlets and JSP

    Hi,
    I'm a confident Java Programmer (and really enjoy using this language) but am very new to Java servlets and Java Server Pages.
    I have previously worked with Perl on my web projects (simple 'league' style voting pages). I read in my 'Core Java' book that I should no longer use perl or even cgi.
    I need to know more about Java servlets and Java Server Pages so I can make the switch to a 'real' programming language.
    I have a few questions:
    How should I start to learn JS and JSP?
    How applicable will the java knowlegdge I have already be?
    Are JSP common on the world wide web?
    What tools do I need to start? (I currently develop in JBuilder and have Java 1.4.1 Standard Edition)
    Is it likey my web host (and others) will support JSP?
    Thank-you very much for helping a novice get started,
    Regards,
    Paul

    Hi, Steve ...has to be frustrating! But do not despair.
    Let's suppose the servlet it's named MyServlet on package org.servlets
    WEB-INF should look:
    WEB-INF
    classes
    org
    servlets
    MyServlet.class
    web.xml
    web.xml file should have this two declarations:
    <web-app>
      <servlet>
        <servlet-name>MyServlet</servlet-name>
        <servlet-class>org.servlets.MyServlet</servlet-class>
      </servlet>
      <!-- other servlets -->
      <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/MyServlet</url-pattern>
      </servlet-mapping>
      <!-- other servlets mappings -->
    </web-app>Now, once the container starts (Tomcat?), you should be able to see that servlet in:
    http://localhost:8080/[my-context/]MyServletAnd what my-context is? The web application context. This string should be empty if your're deploying to the root context, otherwise should the context name. In Tomcat, deploying to root context defaults to using webapps/ROOT.
    Sorry for my English, but I felt the need to answer your request. I hope it helps despite my writing.

  • Question about Java Errors

    I have some questions about some java errors
    1. what kind of errors are contained in Error class?
    2.does this class contain only runtime errors?
    3. if the question number 2 is positive, what about InstantiationError which is a compile error and is a subclass of Error.
    4.When our program is out of memory, which processes are done for an error to be produced. is the error actually from OS or VM?

    I have some questions about some java errors
    1. what kind of errors are contained in Error class?An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.
    2.does this class contain only runtime errors?No
    3. if the question number 2 is positive, what about
    InstantiationError which is a compile error and is a
    subclass of Error.
    4.When our program is out of memory, which processes
    are done for an error to be produced. is the error
    actually from OS or VM?Various - both, depending on where the error occurred.

  • Question about Java apps structure

    Hello guys,
    I'm a professional C++ programmer and I would like to start learning Java. I'm reading about Java from here and there and would like to ask you about how a java program is structured compared to C++.
    So in C++, I have main.cpp (or any other file name, doesn't matter), which contains a the main() function, and I have .h and .cpp class files that I instantiate (basically) in my main function to get my program to work.
    In Java, I'm confused and can't really find the "general" rule to how stuff are organised. I noticed that every class has a main function (why?), and there's no global scope. And "somehow", file names must exactly be equal to the class names.
    The question is: how are Java files of classes (and other stuff, if available) are arranged to create a program? What's the standard why? And How can I have many classes together in a single main()?
    Thank you for any efforts :-)
    Edited by: 927494 on 13.04.2012 07:02
    Edited by: 927494 on 13.04.2012 09:10

    Thank you guys for the replies. I still have some more doubts :-)
    Do I have to have a file for the implementation and a file for the definitons, like cpp and header files? or just everything inside the class?
    Why does Netbeans fail to compile when I change the class name? what should I change with the class name in general to have it compile correctly? From what I understand till now, the top level class's name (the class with the main() function that's gonna be executed) has to be equal to the file name (and I got that this is the sufficient condition for the app to compile), while the same file can have more classes if I wish. Did I get that right?
    I don't know if I get that right too, we pass only a SINGLE class/file to the compiler, and it automatically resolves ALLLL the included files automatically, unlike C++, where all cpp files have to be passed to the compiler/makefile to create object files, and then the executable is created after linking all those object files with the libraries together. i.e.: Java doesn't really need a makefile because making is really simple with only 1 filename. True?

  • Question about Java RMI and Eclipse

    I would like to create an application with which I can easily connect to a JAVA program, installed on a web server, through JAVA RMI. I have already created a ClientRMI.java and a ServerRMI.java and compiled them. The stubs also have been created properly.
    When I run the application outside the Eclipse editor, everything works just fine! However, when I want to integrate the files into a bigger project in Eclipse... and starts running it, he tells me he can't find the stub class or something like that. I need to place this one in the classpath but I don't know how to do that in Eclipse? Could anyone help me with this problem?
    Thanks!
    This is the fault message I get:
    no security manager: RMI class loader disabled)
    D-me

    Do you have an idea of what the answer to our
    question could be?I don't have much idea about the question myself. I was groping in the dark. :-)
    Anyway, the project classpath settings and the external jars (or dependent projects) are a few things which could be experimented with. I'm afraid I couldn't be much help without having a look at what you are trying to do. :-(
    Regards,
    x

  • A few questions about Group Policy development

    This post was originally in the Windows Development forum. Please note the following:
    This question is not about the application and management of GPOs. It's about how to develop a group policy.
    I know about Group Policy Preferences, please do not provide this as an answer.
    I create a custom group policy for an application.
    Recently the application developers allowed settings to be controlled via policy registry keys, in order to make these settings easier to set for Systems Administrators I have created a GPO. Unfortunately, there aren't that many resources
    I can find that help with Group Policy creation, so:
    Is there an easier way to create and edit admx/adml files rather than just a xml editor? Like a GUI front end?
    The vast majority of this applications settings are just a simple Boolean, is there any way to just use one base presentation element for multiple policies? or do I really have to create a presentation element for every single policy? :/
    As mentioned above, most settings are a simple Boolean, but with an additional enforce parameter. If you "enforce" the setting the user is blocked from changing the value. I was going to peg the setting Boolean to whether the policy was
    Enabled or Disabled and have an enforce check box in the policy itself (this would make it easier to just glance at the configured settings and get an idea). Unfortunately, when you disable a policy you cannot interact
    with its contents, so the enforce check box cannot be toggled. So I have two options:
    Have two policies for each setting eg: Disabled: Load printer settings with the document and
    Enabled: ENFORCE Load printer settings with the document
    OR what I have elected to do is just have the one policy with 2 check-boxes in it, one for the setting and one for the enforcement
    The former is both more complex to write for me and more time consuming to configure for the Administrator, the later is easier for me to write but still annoying to use. So my final question is: can I make it so, even though a policy is disabled, you can
    still toggle settings within the policy?

    Hi Thomas.
    > (this will set the default in the application) and then toggling whether
    > that setting is Enforced (unable for the user to modify it - disabling
    > it in the user interface).
    As said - that's not how policies are intended to work - they are always
    enforced. You are talking about preferences that have an optional
    "enforce" switch :) But doesn't matter for the remainder of this post.
    >  1. The presentation table contains hundreds of presentation tags that
    >     essentially are the same thing. From your response there is no way
    >     to make the GPO any easy to write? I can't just create one generic
    >     presentation that multiple policies can use? I have to create a
    >     presentation for every. single. policy.?
    I'd sugggest to use ADM instead of ADMX. Much easier to write and
    maintain, and copy/paste works very well in ADM :)
    https://msdn.microsoft.com/library/bb742499.aspx
    >  2. Because of how the settings are set, as mentioned in my earlier
    >     post, I have chosen to have each policy contain two check boxes.
    >     Each setting could be set to the following:
    >      1. True
    >      2. False
    >      3. True and Enforced
    >      4. False and Enforced
    What elements you need depends on the registry values your application
    is expecting/checking. I'd suggest a radio button (enabled/disabled) and
    a check box "enforced".
    >     there a way for a Disabled policy to also have settings that can be
    >     modified in Group Policy Management? Or can only Enabled policies be
    >     modified?
    You cannot edit what a disabled GPO does, but you can define it
    (VALUEOFF in ADM files if I recall correctly).
    >     well because it would make it easier for them to read the GPO. But I
    >     think you are saying this is not possible.
    Yes, it isn't. It still - at least to me - is a slight misunderstanding
    of "preferences" versus "policies" :)
    Greetings/Grüße,
    Martin
    Mal ein
    gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me -
    coke bottle design refreshment (-:

Maybe you are looking for

  • Delete  over million records

    I want to delete over 1 million records from a user table. This table has 10 more relationship tables also.I tried cursor to loop through the records but I couldn't finish it and I had to kill the process. I have copied all user names to temp Table a

  • Locking Problem for Ivews in SRM 4.0 in EP

    Hi .. We have given access to SRM EBP transaction through EP 6.0 SP9. The problem we are facing is that, once the user selects a trasaction in EP and then uses the BACK browser button or the link in EP, the corresponding process for the transaction r

  • Can't render in Premiere when I have After Effects open MAC OSX YOSEMITE

    When I'm using dynamic link with AE files in my PP timeline I can't get it to render at a normal pace. It will start and then crawl for the simplest of tasks. The only way I get it to work is by clicking off of PP into AE and then back to PP again. T

  • Does anyone have or know where I can purchase the 35mm slide guide for a canoscan model 4400F?

    I recently purchased a used canoscan 4400F and it did not come with the Slide Guide.   Does anyone know where I can purchase? Thanks in advance David New York

  • How to add object back to transport request?

    I deleted a function module from a workbench transport request.  Now, I would like to add it back to this transport request.  How can I do this?  When I go to the include objects on the transport organizer, I do not see an option for selection functi