Question about java virtual machine

Hi,
Recently I met a strange conflict. I used Netbean to build a project and execute this project very well. However, when I opened a command window promt and tried to use the default command 'java' to execute my main class, the virtual machine reported a list of classload exceptions.
My question is : how could we execute a project built by a IDE such as Netbean using the default command 'java', or if we could use the default java compiler javac to build a project?
Thank you very much!
Best Regards,
Song

You should learn to use the javac/java command line tools. You're getting those errors because your classpath is wrong. The IDE might have additional library classes it uses and you need to explicitly include those when you compile and run your project outside the IDE.
So you would need to do for example:
java -cp .;lib/somelib.jar;lib/otherlib.jar com.mycompany.MyMainClass
Read up on classpath, if you ever want to become a serious programmer, you'll need to know what it does.

Similar Messages

  • Wondering about java virtual machine

    hey i just need to download and install java virtual machine so i can chat on this certain page. i tried doing the chat, and it tried downloading what i need, but that didnt work, the download box just completes the download and then nothing happens. someone please help an idiot trying to chat. thanks.

    Go here: http://java.sun.com/getjava/ follow the instructions and then try the chat page again (I'm assuming it's a webpage with a chat applet).

  • Jvm-java virtual machine

    Hai iam new to this forum and as well i just started to learn java iwant to know in brief about JVM
    i think it may be silly question but as i am bigginer to java kindly expect reply

    georgemc wrote:
    faustofrancis wrote:
    A Java Virtual Machine (JVM) is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode. This language conceptually represents the instruction set of a stack-oriented, capability architecture.
    Java Virtual Machines operate on Java bytecode, which is normally (but not necessarily) generated from Java source code; a JVM can also be used to implement programming languages other than Java. For example, Ada source code can be compiled to Java bytecode, which may then be executed by a JVM. JVMs can also be released by other companies besides Sun (the developer of Java) -- JVMs using the "Java" trademark may be developed by other companies as long as they adhere to the JVM specification published by Sun (and related contractual obligations).
    The JVM is a crucial component of the Java Platform. Because JVMs are available for many hardware and software platforms, Java can be both middleware and a platform in its own right — hence the expression "write once, run anywhere." The use of the same bytecode for all platforms allows Java to be described as "compile once, run anywhere", as opposed to "write once, compile anywhere", which describes cross-platform compiled languages. The JVM also enables such unique features as Automated Exception Handling which provides 'root-cause' debugging information for every software error (exception) independent of the source code.
    The JVM is distributed along with a set of standard class libraries which implement the Java API (Application Programming Interface). The virtual machine and API have to be consistent with each other[dubious – discuss] and are therefore bundled together as the Java Runtime Environment.
    Execution environment
    Programs intended to run on a JVM must be compiled into a standardized portable binary format, which typically comes in the form of .class files. A program may consist of many classes in different files. For easier distribution of large programs, multiple class files may be packaged together in a .jar file (short for Java archive).
    The JVM runtime executes .class or .jar files, emulating the JVM instruction set by interpreting it, or using a just-in-time compiler (JIT) such as Sun's HotSpot. JIT compiling, not interpreting, is used in most JVMs today to achieve greater speed. Ahead-of-time compilers that enable the developer to precompile class files into native code for a particular platform also exist.
    Like most virtual machines, the Java Virtual Machine has a stack-based architecture.
    Although the JVM was primarily aimed at running compiled Java programs, other languages can now run on top of it[1], such as:
    * Ruby, with JRuby
    * JavaScript, with Rhino
    * Python, with Jython
    * Common Lisp, with Armed Bear Common Lisp
    * Groovy
    * Scala
    [edit] Bytecode verifier
    A basic philosophy of Java is that it is inherently "safe" from the standpoint that no user program can "crash" the host machine or otherwise interfere inappropriately with other operations on the host machine, and that it is possible to protect certain functions and data structures belonging to "trusted" code from access or corruption by "untrusted" code executing within the same JVM. Furthermore, common programmer errors that often lead to data corruption or unpredictable behavior such as accessing off the end of an array or using an uninitialized pointer are not allowed to occur. Several features of Java combine to provide this safety, including the class model, the garbage-collected heap, and the verifier.
    The JVM verifies all bytecode before it is executed. This verification consists primarily of three types of checks:
    * Branches are always to valid locations
    * Data is always initialized and references are always type-safe
    * Access to "private" or "package private" data and methods is rigidly controlled.
    The first two of these checks take place primarily during the "verification" step which occurs when a class is loaded and made eligible for use. The third is primarily performed dynamically, when data items or methods of a class are first accessed by another class.
    The verifier permits only some bytecode sequences in valid programs, e.g. a jump (branch) instruction can only target an instruction within the same function or method. Because of this, the fact that JVM is a stack architecture does not imply a speed penalty for emulation on register-based architectures when using a JIT compiler. In the face of the code-verified JVM architecture, it makes no difference to a JIT compiler whether it gets named imaginary registers or imaginary stack positions that need to be allocated to the target architecture's registers. In fact, code verification makes the JVM different from a classic stack architecture whose efficient emulation with a JIT compiler is more complicated and typically carried out by a slower interpreter.
    Code verification also ensures that arbitrary bit patterns cannot get used as an address. Memory protection is achieved without the need for a MMU. Thus, JVM is an efficient way of getting memory protection on simple architectures that lack an MMU. This is analogous to managed code in Microsoft's .NET CLR, and conceptually similar to capability architectures such as the Plessey 250, and IBM System/38.
    [edit] Bytecode instructions
    Main article: Java bytecode
    The JVM has instructions for the following groups of tasks:
    * Load and store
    * Arithmetic
    * Type conversion
    * Object creation and manipulation
    * Operand stack management (push / pop)
    * Control transfer (branching)
    * Method invocation and return
    * Throwing exceptions
    * Monitor-based concurrency
    The aim is binary compatibility. Each particular host operating system needs its own implementation of the JVM and runtime. These JVMs interpret the byte code semantically the same way, but the actual implementation may be different. More complicated than just the emulation of bytecode is compatible and efficient implementation of the Java core API which has to be mapped to each host operating system.
    [edit] Secure execution of remote code
    A virtual machine architecture allows very fine-grained control over the actions that code within the machine is permitted to take. This is designed to allow safe execution of untrusted code from remote sources, a model used by Java applets. Applets run within a VM incorporated into a user's browser, executing code downloaded from a remote HTTP server. The remote code runs in a restricted "sandbox", which is designed to protect the user from misbehaving or malicious code. Publishers can purchase a certificate with which to digitally sign applets as "safe", giving them permission to ask the user to break out of the sandbox and access the local file system and network...
    [edit] C to bytecode compilers
    From the point of view of a compiler Java bytecode is just another processor with an instruction set for which code can be generated. The JVM was originally designed to execute programs written in the Java language. However, the JVM provides an execution environment in the form of a bytecode instruction set and a runtime system that is general enough that it can be used as the target for compilers of other languages.
    Because of its close association with Java the JVM performs the runtime checks mandated by the Java specification. This can make it technically difficult to translate C code (which is much more lax with regard to runtime checking) to the JVM and expect it to run without issuing any warnings.
    Compilers targeting many different languages, including Ada and COBOL, have been written.
    [edit] Licensing
    Starting with J2SE 5.0, changes to the JVM specification have been developed under the Java Community Process as JSR 924[2]. As of 2006, changes to specification to support changes proposed to the class file format (JSR 202[3]) are being done as a maintenance release of JSR 924. The specification for the JVM is published in book form,[4] known as "blue book". The preface states:
    We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations. Sun provides tests which verify the proper operation of implementations of the Java Virtual Machine.
    Sun's JVM is called HotSpot. Clean-room Java implementations include Kaffe and IBM J9. Sun retains control over the Java trademark, which it uses to certify implementation suites as fully compatible with Sun's specification.
    [edit] See also
    * HotSpot, Sun's Virtual Machine
    * Da Vinci Machine, a starting Sun project aiming to prototype the extension of the JVM to add support for dynamic languages.
    * List of Java virtual machines
    * Automated Exception Handling
    * Common Language Runtime
    * Parrot virtual machine
    * Java bytecode
    * Class (file format)
    * Java performance
    * List of compilers
    [edit] Notes
    1. ^ Tolksdorf, Robert (2005). Languages for the Java VM. Retrieved on 2008-04-23.
    2. ^ JSR 924 – Specifies changes to the JVM specification starting with J2SE 5.0
    3. ^ JSR 202 – Specifies a number of changes to the class file format
    4. ^ The Java Virtual Machine Specification (the first and second editions are also available online)
    [edit] References
    * Clarifications and Amendments to the Java Virtual Machine Specification, Second Edition includes list of changes to be made to support J2SE 5.0 and JSR 45
    * JSR 45 – Specifies changes to the class file format to support source-level debugging of languages such as JSP and SQLJ that are translated to Java
    [edit] External links
    * The Java Virtual Machine Specification
    * Java-Virtual-Machine.net - All about Java Virtual Machines!
    * List of languages which compile to the Java virtual machine.
    * A decade after Java arrived, there have been improvements in the runtime performance of platform-independent virtual-machine based software.
    * Kaffe.org - the Kaffe project
    * JamVM - The Jam Virtual Machine
    * The lean, mean, virtual machine - An introduction to the basic structure and functionality of the Java Virtual Machine
    * Java Glossary - installing Java useful tips for installing Java for users and developers
    * Test your Java Virtual Machine
    * A list of Java VM-s used in mobile devices
    * More Languages for the JVM
    * Sun to build virtual machine for iPhone - ComputerWorldAre you aware that Wikipedia has ripped off your post?not yet?
    Let me see if the systems work!

  • Saving files and future Java Virtual Machine updates questions

    So I've made A program that keeps a list of Ingredients and Recipes for my dads small business. This program is currently on 3 computers my dads, the secretaries, and mine. I made it so it saved and loaded from a shared folder in the network where all the computers has access. The secretary and my dads computer saved and loaded the program fine with changes from one to the other, but mine wouldn't. If I save what information I put on my computer the other computers could no longer load the save file. If i saved something on the secretary or dads computer then my computer would not be able to load the file.
    well i solved this problem by re downloading Java virtual machine on my computer.
    this brings me to my question:
    Will future virtual machine updates make it so the program can't read old .dat files (I've been using ObjectInputStreams and ObjectOutputStreams to save and load)
    Sorry for the long story before the question I just wanted to state how I came to the question.

    Yes, absolutely. That is one of the problems with using serialization to save data. Fortunately the serialization tutorial mentions it and explains some strategies for minimizing the problem. So have a look at that tutorial.

  • Garbage collection Java Virtual Machine : Hewlett-Packard Hotspot release 1.3.1.01

    "Hi,
    I try and understand the mechanism of garbage collection of the Java Virtual Machine : Hewlett-Packard Hotspot release 1.3.1.01.
    There is description of this mechanism in the pdf file : "memory management and garbage collection" available at the paragraph "Java performance tuning tutorial" at the page :
    http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1607,00.html
    Regarding my question :
    Below is an extract of the log file of garbage collections. This extract has 2 consecutive garbage collections.
    (each begins with "<GC:").
    <GC: 1 387875.630047 554 1258496 1 161087488 0 161087488 20119552 0 20119552
    334758064 238778016 335544320
    46294096 46294096 46399488 5.319209 >
    <GC: 5 387926.615209 555 1258496 1 161087488 0 161087488 0 0 20119552
    240036512 242217264 335544320
    46317184 46317184 46399488 5.206192 >
    There are 2 "full garbage collections", one of reason "1" and one of reason "5".
    For the first one "Old generation After " =238778016
    For the second "Old generation After " =238778016
    Thus, "Old generation Before garbage collection" of the second is higher than "Old generation After garbage collection". Why?
    I expected all objects to be allocated in the "Eden" space. And therefore I did not expect to s

    I agree but my current Hp support is not very good on JVM issues.
    Rob Woollen <[email protected]> wrote:
    You'd probably be better off asking this question to HP.
    -- Rob
    Martial wrote:
    The object of this mail is the Hewlett-Packard 1.3.1.01 Hotspot JavaVirtual Machine
    release and its garbage collection mechanism.
    I am interested in the "-Xverbosegc" option for garbage collectionmonitoring.
    I have been through the online document :
    http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/hotspot.html#-Xverbosegc
    I would like to find out more about the garbage collection mechanismand need
    further information to understand the result of the log file generatedwith the
    "-Xverbosegc"
    For example here is an extract of a garbage collection log file generatedwith
    Hewlett-Packard Hotspot Java Virtual Machine. Release 1.3.1.01.
    These are 2 consecutive rows of the files :
    <GC: 5 385565.750251 543 48 1 161087488 0 161087488 0 0 20119552 264184480255179792
    335544320 46118384 46118384 46137344 5.514721 >
    <GC: 1 385876.530728 544 1258496 1 161087488 0 161087488 20119552 020119552 334969696
    255530640 335544320 46121664 46106304 46137344 6.768760 >
    We have 2 full garbage collections, one of Reason 5 and the next oneof Reason
    1.
    What happened between these 2 garbage collections as we got : "Oldgeneration
    After" of row 2 is higher than "Old generation Before" of row 1? Iexpected Objects
    to be initially allocated in eden and so we could not get "old generation2modified
    between the end of one garbage collection and before the next one.
    Could you please clarify this issue and/or give more information aboutgarbage
    collection mechanisms with the Hewlett-Packard Hotspot Java VirtualMachine. Release
    1.3.1.01.

  • "Could not create Java virtual machine" for several XP SP3 clients

    Hi,
    In this last year I got the message "could not create java virtual machine",
    (suddenly, after several mounths without any kind of problem),
    on 10-15 XP SP3 clients in our lan, lan in which all the 200 clients (90% XP SP3)
    have this application installed.
    Every time the solution seems to be different:
    sometimes the cause is a virus, sometimes i have to disinstall all Java components
    and reinstall only the Java RE 6.0_23 (used by the application),
    sometimes I have to make also a system registry cleaning for Java components,
    only few times was enough to clear the Java cash, change the kind of Java network connection,
    delete the temporary files...
    In two situations the problem was solved changing UltraVnc with RealVnc
    and only once the user solved himself restarting the computer...
    I'd like to know which is the meaning of this message and which steps is better
    to follow in order to solve the problem in the shortest time.
    Thank You

    Thank you
    for anwering my question !
    Anyway, in all the 10-15 cases I solved this problem, I hadn't to change the amount of RAM...
    never... and, once solved, the computer client is ok and the application works without subsequent problems...
    So, as I said, i can solve the problem without Knowing the real reason, and often after several
    hours... (you can read in my previous comment about a lot of differences solutions...)
    The matter is... that I can't understand "how and why" I solve the problem...
    Bye

  • Load Plan and Java Virtual Machine

    Hi,
    We're think about using ODI 11g Load Plan, but I've got a question about their behaviour.
    Suppose I've got a load plan that launches 2 scenarios in parrallel with standalone agent.
    Will ODI launch 2 Java Virtual Machine "as if we just launch 2 ODI commands (startscen.bat)" or will it use only 1 Virtual Machine ?

    Okay let me try to help you on this.
    Oracle Data Integrator agents process each scenario execution instance as a session. Each session exists in the agent as a separate thread of the agent Java process.
    When a scenario is executed on an agent, the agent creates a session in the repository that corresponds to this scenario's instance. The agent reads each task of this session from the repository, processes it, and writes the result - the return code, message and tasks metrics such as the duration or number of rows processed - into the repository.
    Hence multiple session multiple thread.
    Hope you are clear now.
    Thanks.

  • Could not find a valid Java virtual machine to load

    On a fresh copy of CFMX8, when I run updater 7, it responds
    'Could not find a valid Java virtual machine to load'.
    This is being installed on a Win2K3 server and this is on a
    'freshly minted' POC box solely for the purpose of
    installing/testing CFMX8 to determine how it compares to our
    CFMX6.1 environment.
    You will notice that it is NOT being installed in the default
    directory:
    JRun Version Information
    Vendor Macromedia
    Product Name JRun 4.0
    Build Number 108487
    Version Full Version
    License Type Trial License
    Serial Number JRD400-69341-58259-30688
    JRun 3.x Serial Number
    Restricted to Single IP No
    Installation Root D:\ISG\software\jrun4
    Expiration Date Mar 29, 2008
    Evaluation Days Remaining 29
    JDK path (JAVA_HOME): D:/ISG/software/jrun4/jre
    I do find it curious that I can run the Updater 6, and it
    seems to behave properly (it finds the VM). I ran it just as a
    test, then wiped everything to start over from scratch. For some
    reason do I need to direct Updater 7 to the installation that I did
    not have to do in Updater 6?
    Thank you in advance for your assistance - Jacques

    tried executing the following cmd, below is the following error:
    <<command i executed>>
    C:\Program Files\Java\jre1.5.0_09\bin>java -classpath "C:\Program Files\Java\jre1.5.0_09\lib\javaws.jar" com.sun.javaws.Main https://<IPddr>:8443/sample.jnlp
    Can you pls let me know how it can be resolved?Umm.. I am not sure, but I will start with
    a question. Why not do it this way?C:\Program Files\Java\jre1.5.0_09\bin>javaws https://<IPddr>:8443/sample.jnlp

  • Safari problem with Java Virtual Machine

    I have a brand new MacBook Pro. I tried to play an online game that requires Java Virtual Machine. And of course I use Safari since it's the default browser. However, the game keeps asking me to download Java Virtual Machine. I tried to update and also I tried to use Google Chrome, but still it didn't work. Can someone please help.

    HI and Welcome to Apple Discussions...
    According to this site, http://www.java.com/en/download/manual.jsp
    you need the most recent version of Safari running which is 4.0.5 and have Java enabled. Go to the Safari Menu Bar click Safari/Preferences then select the Security update. Where you see Web content, select the top 3 buttons.
    To see which version of Safari you are running from the Safari Menu Bar click Safari/About Safari.
    If your software is not up to date, click the Apple Menu (top left in your screen) then click: Software Updates.
    Please click My Settings on the right side of this window and tell us which Mac OS X you are running. Makes it much easier for us to help trouble shoot for you. Thanks!
    Carolyn

  • How can I know the version of Application Server Java Virtual Machine

    How can I know the version of Application Server Java Virtual Machine?
    Thanks a lot.

    Thats easy. Your jdk/jre are located in the App Server home directory. Just run the java command under the jdk directory with the "-version" switch and it will provide you with detailed information about your VM.
    For example if you're doing it at command prompt it will be something like
    java -versionI hope this will be useful to you.
    Regards,
    Wasif

  • Question about Java vm interprocess communication.

    I was doing an interprocess communication test for fun recently and bump into a questions. My intention is to start two separate Java virtual machines in two separate processes and have them do some simple interaction. This should be done without socket programming. I can do it with sockets but is this test I just want to test how can and if it is possible to do IO between java vm without sockets (or RMI, or MPI or whatever). Just process IOstreams.
    While most documentation says that Java ProcessBuilder is meant to start an external process, I want to start a java vm process and do some IO with another java vm. Most examples demonstrate how to start a command shell or an external non-java program from Java, and say how to avoid the pitfall of IO streams and do it in separate threads. I can do that with Microsoft vbscript and have it talk to Java vm. That is easy. I have created an easy one to start Microsoft Voice to read something while Java is busy with number crunching.
    So I thought it should be easy for multiple Java virtual machines, too. It turns out, I am wrong. I post the test codes below. The Java experts in the forum, please review and give your expert thoughts. The code is ugly, I have to say.
    import java.io.*;
    import java.util.concurrent.*;
    class write_q implements Runnable {
    private LinkedBlockingQueue<String> out_q=null;
    private Process vm=null;
    public write_q(Process p){
    out_q=new LinkedBlockingQueue<String>(64);
    vm=p;
    public void write(String m){
    try {
    if (m !=null) out_q.put(m);
    catch(InterruptedException e){}
    return;
    public void run(){
    OutputStream o=vm.getOutputStream();
    try {
         String vv=out_q.take();
         //System.out.println(vv);
         byte[] b=vv.getBytes();
         o.write(b);
         o.flush();
         //System.out.println(vv);
         Thread.sleep(100);
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    return;
    class read_q implements Runnable {
    private LinkedBlockingQueue<String> in_q=null;
    private Process vm=null;
    public read_q(Process p){
    vm=p;
    in_q=new LinkedBlockingQueue<String>(64);
    public String read(){
    String v=null;
    try {
         v=in_q.take();
    catch(InterruptedException e){}
    return v;
    public void run(){
    byte[] b=new byte[256];
    InputStream ins=vm.getInputStream();
    try {
    while(true){
         int s=ins.read(b);
         if (s>0){
              String t=new String(b, 0, s).trim();
              in_q.put(t);
         //System.out.println("Read: "+t);
              if(t.equals("<>")) break;
         Thread.sleep(100);
    catch(IOException e){}
    catch(InterruptedException e3){}
    // end of class read_q
    public class morep{
    private static ExecutorService es=null;
    public morep(){
    es=Executors.newFixedThreadPool(2);
    public String read(){
    String v=null;
    return v;
    public void write(String msg){
    String v=this.read();
    return;
    public static void main(String[] args){
    ProcessBuilder pb=new ProcessBuilder("java", args[0]);
    pb.redirectErrorStream(true);
    pb.directory(new File(".//"));
    Process vm=null;
    morep mp=null;
    read_q reader=null;
    write_q writer=null;
    try {
         vm=pb.start();
         mp=new morep();
         writer=new write_q(vm);
         reader=new read_q(vm);
         es.execute(reader);
         es.execute(writer);
         System.out.println(reader.read());
         writer.write("Hello");
         System.out.println("Read: "+reader.read());
         writer.write("<>");
         System.out.println(reader.read());
         vm.waitFor();
         es.shutdown();
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    System.out.print("Press any key....");
    try {
         while(System.in.read()==-1);
    catch(IOException e3){}
    // end of main(String[] args)
    // end of class morep
    // this is the one started by morep.java
    import java.io.*;
    class talker {
    public static void main(String[] args){
    System.out.println("Ok, let\'s talk.");
    System.out.println("Since I am very talkative, be aware of the nuances.");
    System.out.println("Since I am not a bad guy, be aware of the nonscense.");
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    try {
    while(true){
         String x=br.readLine();
         if (x!=null) {
              System.out.println("+++ "+x);
              if (x.equals("<>")) break;
    catch(IOException e1){
         System.out.println("+++ "+e1.getMessage());
    // end of main(String[] args)
    // end of class talker
    Compiling the files will generate morep.class, talker.class, write_q.class and read_q.class. Then the talker.class will be started by morep.class, and managed by read_q.class and write_q.class.
    Run from the command line in Windows, the program hangs after initial messages. In Task Manager, two VMs are started by the program dead locked. I was expecting both VMs close down upon receiving "<>".
    C:\myjava\loader>java morep talker
    Ok, let's talk.
    Since I am very talkative, be aware of the nuances.
    Since I am not a bad guy, be aware of the nonscense.
    Hello
    Edited by: EJP on 13/04/2011 10:44: added code tags. Please use them.

    import java.io.*;
    import java.util.concurrent.*;
    class write_q implements Runnable {
    private LinkedBlockingQueue<String> out_q=null;
    private Process vm=null;
    public write_q(Process p){
    out_q=new LinkedBlockingQueue<String>(64);
    vm=p;
    public void write(String m){
    try {
    if (m !=null) out_q.put(m);
    catch(InterruptedException e){}
    return;
    public void run(){
    OutputStream o=vm.getOutputStream();
    try {
         String vv=out_q.take();
         //System.out.println(vv);
         byte[] b=vv.getBytes();
         o.write(b);
         o.flush();
         System.out.println(vv);
         Thread.sleep(100);
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    return;
    class read_q implements Runnable {
    private LinkedBlockingQueue<String> in_q=null;
    private Process vm=null;
    public read_q(Process p){
    vm=p;
    in_q=new LinkedBlockingQueue<String>(64);
    public String read(){
    String v=null;
    try {
         v=in_q.take();
    catch(InterruptedException e){}
    return v;
    public void run(){
    byte[] b=new byte[256];
    InputStream ins=vm.getInputStream();
    try {
    while(true){
         int s=ins.read(b);
         if (s>0){
              String t=new String(b, 0, s).trim();
              in_q.put(t);
         //System.out.println("Read: "+t);
              if(t.equals("<>")) break;
         Thread.sleep(100);
    catch(IOException e){}
    catch(InterruptedException e3){}
    // end of class read_q
    public class morep{
    private static ExecutorService es=null;
    public morep(){
    es=Executors.newFixedThreadPool(2);
    public String read(){
    String v=null;
    return v;
    public void write(String msg){
    String v=this.read();
    return;
    public static void main(String[] args){
    ProcessBuilder pb=new ProcessBuilder("java", args[0]);
    pb.redirectErrorStream(true);
    pb.directory(new File(".//"));
    Process vm=null;
    morep mp=null;
    read_q reader=null;
    write_q writer=null;
    try {
         vm=pb.start();
         mp=new morep();
         writer=new write_q(vm);
         reader=new read_q(vm);
         es.execute(reader);
         es.execute(writer);
         System.out.println(reader.read());
         writer.write("Hello");
         System.out.println("Read: "+reader.read());
         writer.write("<>");
         System.out.println(reader.read());
         vm.waitFor();
         es.shutdown();
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    System.out.print("Press any key....");
    try {
         while(System.in.read()==-1);
    catch(IOException e3){}
    // end of main(String[] args)
    // end of class morep
    }

  • Some general questions about java

    Hi,
    I am a beginner with java and actually i am new to programming as such. i want to ask certain questions.
    I read in The Java Tutorial that java is both a 'compiled' and an 'interpreted' language while most languages fall in either one of the two categories. What is the difference between a compiled and an interpreted language?
    All the java programs that we right are compiled by the java compiler. So in what language was this java compiler and java VM written
    What is the definition of native code. Does it depend on the operating system ? If so, is it defined by the operating system ? If I am not mistaken, an OS in itself is a huge program, so which language can be used to create an OS. For instance, can an expert in java create his own OS using the java programming language ?
    These questions may sound silly but I need to know the answers

    Okay, a compiled language is completely translated into object code (one and zeroes, usually) before it is run. An interpreted language is turned into object code as it runs. The object code for most languages is the ones and zeroes that make sense to the processor. The object code for Java is Java bytecode.
    Java bytecode is a set of universal commands that make sense to any Java Runtime Environment (JRE or Java Virtual Machine JVM. I think they're the same thing, someone correct me if I'm wrong,). The JRE is an interpreter. Each JRE is specific to the platform, that is; there's a Windows JRE and a Solaris JRE and yada yada. The JRE interprets the bytecode commands and turns them into commands for the platform. For instance, a bytecode command is something like, "draw a window" and the JRE turns this into the Windows or Solaris command that draws a window.
    I don't know what language Java was written in. It may not all be written in one language. It's very possible that the Java compiler (javac) and the java interpreter (the JRE) are written in entirely different languages. I'd suspect the answer to this can be found in van der Linden's "Just Java" book.
    Native code, in Java, usually refers to legacy code, existing code written in whatever language that you wish to use in a Java program. Maybe the native code costs too much to convert; maybe it works really well, maybe it does soemthing special, whatever -- you want to use it so you use the native command in a Java program to tell Java to run this piece of code in whatever language. Native code doesn't really have anything to do with the OS other than it's code that runs on the OS you want the Java program to run on.
    An OS can be written in anything you want, but some languages are better than others. I think the Mac OS is/was mostly Pascal. Wasn't C invented in order to write Unix?

  • Installation fails with "Cannot launch the Java Virtual Machine"

    I'm trying to install OAS 10.1.3.1. on Windows XPbut after copying all the files the installer starts complaining that it cannot lauch the Java Virtual Machine. Eventually, the process gets to the configuration step where it succeeds with one configuration, then fails with the next, and then finally goes into an eternal loop.
    When launching the installer it claims that my environment successfully passes all test for memory size, etc.
    Is this a known problem? Is there any way I can get more info about the reason why the JVM could not get lauched? I searched for information in the logs without success. I also tried to play around with the PATH environment variable since I saw some installation note saying that includingthe jre/bin path here could help, but it did not help.
    Could anyone, please, give me a hint of how to complete the installation successfully?

    Thanks for the hint.
    I had a look in the INI-file of my BPEL installation and this is what it said about memory:
    JRE_MEMORY_OPTIONS=" -mx256m"
    Still, if I start the BPEL server it finally comes up after issuing a lot of complaints but as soon as I request a page I get this:
    500 Internal Server Error
    OracleJSP: oracle.jsp.provider.JspCompileException:
    Fel vid kompilering:C:\product\10.1.3.1\OraBPEL_1\bpel\system\appserver\oc4j\j2ee\home\application-deployments\orabpel\console_war\persistence\_pages\\_login.java
    Could not create the Java virtual machine.
    Error occurred during initialization of VM
    Could not reserve enough space for object heapThis is strange since at the time there is >1.4 GB of virtual memory and 0.9 GB of physical memory available.
    And according to the task manager:
    Commit charge limit = 2728684
    Physical memory total = 2096496
    I am using Windows XP Professional, version 2002, service pack 2.

  • Java Virtual Machine

    Please help! The Java virtually machine is basically the same as virtual reality, right? So, where can you buy one of those headset/viewing screen things to work with the Java virtual machine?

    Hi,
    ok, I will try to answer it - the virtual machine is a kind of simulated processor, not implemented as a piece of hardware but as software, that processes the java-byte-code so as if a hardware processor would be there.
    Also I believe, that you are just kidding - the Java3D API provides virtual reality - it is able to calculate and render virtual universes of any size from microscopic to cosmic. It provides 3D sounds too. You can easily download PDF-documents that explain this API - see the Docs & Training link top-left on this site. If you think, that is a ready to use game, you are wrong, it is not :) - ask your local dealer for some of them, he will be glad to serve you, I guess.
    So, that's enough for a probably kidding question
    greetings Marsian

  • Osdm error 'could not create the Java virtual machine.'

    Running on Windows XP. SQL Developer reports Java(TM) Platform=1.5.0_06
    I downloaded and unzipped the osdm early adopter release,but when I double click on the osdm.exe, I get a dialog box titled"Java Virtual Machine Launcher" with the error:
    could not create the Java virtual machine.
    I'm don't know where to begin to troubleshoot this problem.
    Is there a log,trace,error file somewhere?
    Do I need something specific in my path or an environment variable set?

    Thanks Jim, for helping and the support. I'll respond to a few things in this thread for the rest of the forum.
    Feedback
    Let's start with the feedback and support. As Rene said, he is working at answering all queries coming into the feedback application. This means reviewing the issues, working with the developers and logging bugs. Each comment and query in that application is addressed and users can go back in an review the feedback for their own comments in the application too. We have had considerable interest and downloads, about which we are very excited, and this means there are lots of queries. Rene is addressing all these, and as I type, there are no comments in that application that have not been addressed. Not all are closed, as there are some outstanding issues, but each user who has submitted a comment shold have received at least one email.
    The Team
    I'm reluctant to comment about which part of the product is built in which country, but will say that SQL Developer has been a small team, with the greater percentage of developers living outside the US from the outset. I love working in the team including the wide diversity of locales and cultures and also think that because we live across multiple time zones, we can help users most times of the day or night. We are very privileged to have had the modeling team join us and I'm sure you'll get to know them in time too. If you are interested, the team stretches across a few states in the US, Ireland, Northern Ireland,England, Belgium, Bulgaria, India and China!
    Now to the problem. - Java virtual machine
    1. There is a choice of download, either with the JDK or without. If you download the build with the JDK, there should be no problem, as the product knows where to find the jdk. I'm not sure I see which of these 2 downloads was used. So that would be useful information to have.
    2. If you use the build without the JDK, then Data Modeling looking for the detail in your path.(Unlike in SQL Developer where we prompt you) You can test to see what is in your path by starting a command line, or command prompt and typing java -version. This will tell you what version of java is being looked for and used by Data Modeling.
    If you do not have a JDK, then you can download and install that as described on the download page.
    Troubleshooting
    We want to release SQL Developer Data Modeling as a standalone tool (i.e. what you are testing today) or underpinned by a repository. So our main goal is to ensure that we have a solid stable and usable product for production. The plan is to follow production with a much tighter integration to the underlying SQL Developer framework.
    Regards
    Sue

Maybe you are looking for

  • How large a second internal hard drive?

    Keep running out of hd space - have been removing cache, etc. to try to keep my available space at least 10%, but decided to purchase a second hd. Was asked how big a one I wanted. Is there an optimum or max size I can use on my G4 (400 mhz, AGP, Mod

  • Formatting Issues When Printing from a PDF

    I am currently using Adobe Acrobat Pro 9 in Windows 7.  I have been printing or saving documnts as PDF's without issues until today.  I have created a document in Microsoft Publisher and have saved it as a PDF.  When I open that document, it appears

  • CS5 Photoshop/Bridge/Suite not working on new Retina Macbook Pro, running Mavericks 10.9.2

    I recently purchased a new Retina MacBook Pro laptop running Mavericks OS X 10.9.2. I had Apple perform a data migration of all my apps and files from my older laptop onto the new one. Now when I go to open Photoshop CS5 I receive the following error

  • Convert ALV report to Excel sheet

    Hi frnds, I did one ALV reoprtExcute that report , display the output entries. I want to convert excel sheet. Press the 'LOCAL FILE' button, display this error msg, Error analysis     You attempted to access an unassigned field symbol     (data segme

  • MaxL Shell does not accept member "W?hrung NZ"

    I want to create a partition via MaxL using create partition. I need to map a member "W?hrung NZ". If I put in the MaxL statement interactively using the command shell, everything works out fine. But when I write down the statements in a file and sta