Java goto?

Hi!
I am very new to java (i normally write in c#), but am currently faced with the task of debugging someone else's code. The problem is there is reams of the stuff, and none of it is commented. The person who wrote it is no longer here so I cannot ask them what on earth they were up to. I have made a few changes to their source code and now I cannot get it to compile. The error is on these lines:
First there is an odd line label:
_A3:
followed by some code.
Then there is this:
if(true) goto A4; else goto A3
further down the page there is the _A4 label that the previous statement seems to be pointing to:
_L4:
and this is also followed by code.
So, firstly, can anybody explain what these line labels are doing. They look to me like the old VB6 error handling blocks, but they don't make any sense to me.
Secondly, correct me if I am wrong, but I believe that java has no goto statement (and the compiler does indeed give an illegal statement error), so does anyone know why I would be finding one in the code?
Thanks in advance for any help!
Adam

Hi Adam,
I wonder the difference between the original code and the decompiled code for the "goto" section.
I am having the same problem but can't get hold of the original code.
Is it possible for you to send the original code for this goto part?
Thanks,
Ryan

Similar Messages

  • Exception in thread "main"java.lang.NoclassDefFoundError: server (wrong....

    Ok, i made my own java compiler (well my friend made it for me), and I got this error when i ran the program.....
    Here is the code in my compiler if you want to take a look at it.
    @echo off
    if exist "C:\Program Files (x86)\Java\" set programfiles=C:\Program Files (x86)
    set pr=%programfiles%\Java\
    :co1
    set b=0
    set t=7
    goto co2
    :co2
    color %b%%t%
    :menu
    cls
    title The Perfect Compiler version 1.9
    echo Please choose an option below to do that function.
    echo Keep posted on the Moparscape Tutorials section for
    echo any updates that I post.
    echo.
    echo c - Compile your server.
    echo r - To Run your server.
    echo e - To exit out of the program.
    echo jar - It will create your server into an executable Jar archive.
    echo color - Change the Text and Backround colors of this compiler.
    echo reset - Resets your Compiler Logs.
    echo.
    echo.
    set /p c=Option:
    if %c%==c goto c
    if %c%==C goto c
    if %c%==r goto r
    if %c%==R goto r
    if %c%==jar goto jar
    if %c%==Jar goto jar
    if %c%==JAR goto jar
    if %c%==color goto color
    if %c%==Color goto color
    if %c%==COLOR goto color
    if %c%==reset goto reset
    if %c%==Reset goto reset
    if %c%==RESET goto reset
    if %c%==e goto e
    if %c%==E goto e
    if %c%==* goto er
    goto er
    :jar
    title Jar Creator
    cls
    echo What will be the name of the Jar file?
    echo.
    set /p name=Name:
    if exist *.class (del *.class)
    set pro=%pr%jdk1.5.0
    set pro2=%pr%jdk1.6.0
    set jav=bin\javac.exe
    set go=jar2
    goto cj
    :jar2
    %java% -cp . *java
    echo Manifest-Version: 1.0 >> manifest
    echo Created-By: 1.5.0_04 (Sun Microsystems Inc.) >> manifest
    echo Main-Class: server >> manifest
    set pro=%pr%jdk1.5.0
    set pro2=%pr%jdk1.6.0
    set jav=bin\jar.exe
    set go=jar3
    goto cj
    :jar3
    if not exist *.class (goto jre)
    %java% -cvfm %name%.jar manifest *.class
    del runserver.bat
    del manifest
    del *.class
    goto jl
    :jar4
    set pro=%pr%jre1.5.0
    set pro2=%pr%jre1.6.0
    set jav=bin\java.exe
    set go=jar5
    goto cj
    :jar5
    echo @echo off  >> runserver.bat
    echo title %name% >> runserver.bat
    echo %java% -cp .;%name%.jar server >> runserver.bat
    echo pause >> runserver.bat
    cls
    echo %name% Jar file successfully made. The runserver.bat will
    echo now load the Jar file. If you have any errors while runnning
    echo the Jar file, please post about it in Mod Taharok's 'Perfect
    echo Compiler' topic on MoparScape.
    pause
    goto menu
    set
    :color
    cls
    echo Would you like to change the backround color, change
    echo the text color, or reset it to default?
    echo.
    echo back - Change the backround color.
    echo text - Change the text color.
    echo def - Change all colors back to default.
    echo.
    echo.
    set /p color=Option:
    if %color%==back goto back
    if %color%==BACK goto back
    if %color%==text goto text
    if %color%==TEXT goto text
    if %color%==def goto co1
    if %color%==DEF goto co1
    if %color%==* goto er
    goto er
    :back
    cls
    echo Please select a color to change the backround to:
    echo.
    echo black
    echo white
    echo red
    echo yellow
    echo green
    echo blue
    echo purple
    echo.
    echo.
    set /p back=Color:
    if %back%== black (set b=0)
    if %back%== white (set b=7)
    if %back%== red (set b=4)
    if %back%== yellow (set b=6)
    if %back%== green (set b=2)
    if %back%== blue (set b=1)
    if %back%== purple (set b=5)
    goto co2
    :text
    cls
    echo Please select a color to change the text to:
    echo.
    echo black
    echo white
    echo red
    echo yellow
    echo green
    echo blue
    echo purple
    echo.
    echo.
    set /p back=Color:
    if %back%== black (set t=0)
    if %back%== white (set t=7)
    if %back%== red (set t=4)
    if %back%== yellow (set t=6)
    if %back%== green (set t=2)
    if %back%== blue (set t=1)
    if %back%== purple (set t=5)
    goto co2
    :c
    cls
    title Compiler
    set pro=%pr%jdk1.5.0
    set pro2=%pr%jdk1.6.0
    set jav=bin\javac.exe
    set go=c2
    goto cj
    :c2
    if exist src (goto cl) else (goto c3)
    :c3
    if exist *.java (goto cl2) else (goto ce)
    :c4
    %java% -cp . *.java
    echo Files Compiled Successfully!
    pause
    cls
    goto menu
    :c5
    %java% -cp . .\src\*.java
    echo Files Compiled Successfully!
    pause
    move .\src\*.class .\classes\
    cls
    goto menu
    :ce
    cls
    echo You must have Java files for this Compiler to Compile.
    pause
    cls
    goto menu
    :r
    cls
    title Runserver
    set pro=%pr%jre1.5.0
    set pro2=%pr%jre1.6.0
    set jav=bin\java.exe
    set go=r2
    goto cj
    :r2
    set rjava=%java% -Xmx1024m -cp .;./jython.jar;./MySql/mysql-connector-java-3.0.17-ga-bin.jar server
    cls
    goto r3
    :r3
    if exist .\classes\HelloJava.class (goto sl2) else (goto r4)
    :r4
    if exist .\server.class (goto sl) else (goto se)
    :r5
    %rjava%
    pause
    cls
    goto menu
    :r6
    set rjava=
    set rjava=%java% -cp .;./classes; Server
    %rjava%
    pause
    cls
    goto menu
    :se
    cls
    title Error
    echo You do not have a Server.class. Make sure that you have used the
    echo compiler with your server BEFORE you try runing it.
    pause
    cls
    goto menu
    :er
    cls
    title Error
    echo Invalid command. Please make sure the commands you type
    echo in are correct.
    pause
    cls
    goto menu
    :e
    cls
    exit
    :cj
    if exist "%pro2%_01\%jav%" (goto sj)
    if exist "%pro2%\%jav%" (goto sj2)
    if exist "%pro%_10\%jav%" (goto sj3)
    if exist "%pro%_09\%jav%" (goto sj4)
    if exist "%pro%_08\%jav%" (goto sj5)
    if exist "%pro%_07\%jav%" (goto sj6)
    if exist "%pro%_06\%jav%" (goto sj7)
    if exist "%pro%_05\%jav%" (goto sj8)
    if exist "%pro%_04\%jav%" (goto sj9)
    if exist "%pro%_03\%jav%" (goto sj10)
    if exist "%pro%_02\%jav%" (goto sj11)
    if exist "%pro%_01\%jav%" (goto sj12)
    if exist "%pro%\%jav%" (goto sj13) else (goto je)
    :sj
    set java="%pro2%_01\%jav%"
    goto %go%
    :sj2
    set java="%pro2%\%jav%"
    goto %go%
    :sj3
    set java="%pro%_10\%jav%"
    goto %go%
    :sj4
    set java="%pro%_09\%jav%"
    goto %go%
    :sj5
    set java="%pro%_08\%jav%"
    goto %go%
    :sj6
    set java="%pro%_07\%jav%"
    goto %go%
    :sj7
    set java="%pro%_06\%jav%"
    goto %go%
    :sj8
    set java="%pro%_05\%jav%"
    goto %go%
    :sj9
    set java="%pro%_04\%jav%"
    goto %go%
    :sj10
    set java="%pro%_03\%jav%"
    goto %go%
    :sj11
    set java="%pro%_02\%jav%"
    goto %go%
    :sj12
    set java="%pro%_01\%jav%"
    goto %go%
    :sj13
    set java="%pro%\%jav%"
    goto %go%
    :je
    cls
    title Error
    echo You do not have JDK 5.0 or JDK 6.0 or any JDK 5.0 and 6.0 updates.
    echo Go to Mod Taharok's tutorial on the Moparscape Tuturoials section
    echo for step-by-step instructions to download the newest JDK Update.
    pause
    cls
    goto menu
    :sl
    cls
    echo Ran Server at %time% and on %date%. >> "Compile Logs.txt"
    echo Server was run using %java%. >> "Compile Logs.txt"
    echo Thank you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.txt"
    echo. >> "Compile Logs.txt"
    goto r5
    :sl2
    cls
    echo Ran Server at %time% and on %date%. >> "Compile Logs.txt"
    echo Server was run using %java%. >> "Compile Logs.txt"
    echo Thank you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.txt"
    echo. >> "Compile Logs.txt"
    goto r6
    :cl
    cls
    echo Compiled Java files at %time% and on %date%. >> "Compile Logs.txt"
    echo Java files were compiled using %java%. >> "Compile Logs.txt"
    echo Thank you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.txt"
    echo. >> "Compile Logs.txt"
    goto c5
    :cl2
    cls
    echo Compiled Java files at %time% and on %date%. >> "Compile Logs.txt"
    echo Java files were compiled using %java%. >> "Compile Logs.txt"
    echo Thank you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.txt"
    echo. >> "Compile Logs.txt"
    goto c4
    :jl
    cls
    echo %name% Jar file created at %time% and on %date%. >> "Compile Logs.txt"
    echo Jar file was created using %java%. >> "Compile Logs.txt"
    echo Thank you for using Mod Taharok's 'Perfect' Compiler! >> "Compile Logs.txt"
    echo. >> "Compile Logs.txt"
    goto jar4
    :reset
    cls
    echo Resetting the Compiler's Logs...
    pause
    del "Compile Logs.txt"
    goto menuAs the pic says "5 duke stars for whoever can fix this"

    I got that exact problem I think, how did you fix it?? I been trying to make a server for a whole year, spent hours and hours trying to make it, and I can't do it... Need help... Whoever helps gets... Co on my server. :)

  • Can we export portal in Evalution version?

    Hi All,
    I have downloaded oracle 10g evalution version(10.2) from oracle network. I want to know can I export my portal from this version ? Beacause the script files required for export and import like contexp.cmd,secexp.cmd etc are not present in my portal directory. So is it possible to export from this version or i need to purchase copyright version?
    Please help, its urgent.
    thanks in advance.
    Message was edited by:
    [email protected]

    Goto isn't ugly if you know what would like do with
    it. You boys looks like you had restricted yourself
    and can't imagine what with it. It will be nice to be
    able to use labeled return as a Java goto.
    g.draw(shape) could be viewed as a goto. It jumps in
    code segment and only difference between goto and this
    code is it could return.Correction: will return.
    Restricted myself? I've programmed in languages with gotos. Do I miss it? Are there things I would like to do that I can't, without it? No. Is my code easier to understand now? Yes.
    I would like to be able use
    goto with signed "aplication" and clear warning to
    user. This aplication use goto, use it with care.
    Some AI problems are best with goto. Please elaborate. What is the relevancy of your application being signed? Are you saying that an end-user should be able to accept a signed application which may use unsafe programming practices, if he chooses to accept the risk?
    Give me an example of an AI problem which is better solved using goto.

  • Hi all - how can i see the history of support package

    hi have install new support package .
    and now i want to view the history of the sp ,  where can i see it ?
    eyal

    Hai,
           if you want to see the history of support package for JAVA (Web AS JAVA),
    Goto the URL : <b>http://<host name>:<http port of Java stack>/</b> --> select System Information --> Show all components --> it will display all Java SP's that you have deployed in your J2EE engine.
    regards,
    Gopinathan.

  • PROBLEM WITH NETWORK EDITOR

    I WANT TO USE NETWORK EDITOR.
    I installed oracle 10g release 2 (10201 database_win32 ).
    I also installed the companion cd (10201_companion_win32).
    what i have to do in order to activate NETWORK EDITOR;;;;;
    I HAVE TO INSTALL SOMETHING ELSE;;;;
    i go to the next directory:
    C:\oracle\product\10.2.0\db_1\md\demo\network\editor
    AND I DOUBLE CLICK ON THE NETWORK "startNetworkEditor"
    But nothing happens.
    I try to open the file:"startNetworkEditor" from the command line of windows
    and the next mesage appears:
    Can't find java interpreter.
    Java interpreter is needed to run this program.
    (I DID:
    RIGRHT CLICK ON THE FILE:startNetworkEditor
    EDIT
    AT THE MIDLE OF THIS FILE THERE IS THE FOLLOWING TEXT::yetAnotherCheck
    if exist "%ORACLE_HOME%\jdk\bin\java" goto doneCheck
    echo Can't find java interpreter.
    echo Java interpreter is needed to run this program.
    goto end
    I BROWSED TO THE DIRECTOTY:%ORACLE_HOME%\jdk\bin\java
    AND THE FILE java exists.
    what is happening;;;;;;
    why the error mesage appears;;;;

    Thread looks like similar to following thread, you should cont. in old thread
    problem to install NETWORK EDITOR
    Anyway , Please check is there any java related environment set ?
    Also make sure your oracle home , path is set to properly.

  • Running console utility via PowerShell - passing commands to it...

    I'm a beginer to PowerShell, so sorry if the question is dumb. 
    I have a concole utility (JAVA utility). And a .bat file that starts it. This utility is used for tasks like mange server application including upload data. Such task is time consumming. I need to make a large number of such actions and I want to automate
    this process. 
    Basicly I want PowerShell to open this utility and pass some commands, wait utill process is completed, pass another command and so on.
    I'm looking for answers:
    - Is it possible(I'm pretty sure it is).
    - How to pass commands to utility when it is already running.
    - Do I need to rewrite .bat to PS script or I can use something like "cmd /c my.bat"
    Thank you for your answers in advance - I really stuck with this issue.
    if that does matter this is the content of that .bat file.
    @echo off
    rem Set the lib dir relative to the batch file's directory
    set LIB_DIR=%~dp0\..\lib
    rem echo LIB_DIR = %LIB_DIR%
    rem Slurp the command line arguments. This loop allows for an unlimited number
    rem of arguments (up to the command line limit, anyway).
    set CMD_LINE_ARGS=%1
    if ""%1""=="""" goto setupArgsEnd
    shift
    :setupArgs
    if ""%1""=="""" goto setupArgsEnd
    set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
    shift
    goto setupArgs
    :setupArgsEnd
    if "%JAVA_HOME%" == "" goto noJavaHome
    if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
    goto javaHome
    :noJavaHome
    set JAVA=java
    goto javaHomeEnd
    :javaHome
    set JAVA=%JAVA_HOME%\bin\java
    :javaHomeEnd
    :checkJdk14
    "%JAVA%" -version 2>&1 | findstr "1.4" >NUL
    IF ERRORLEVEL 1 goto checkJdk15
    echo Java 5 or newer required to run the console
    goto end
    :checkJdk15
    "%JAVA%" -version 2>&1 | findstr "1.5" >NUL
    IF ERRORLEVEL 1 goto java6
    rem use java.ext.dirs hack
    rem echo Using java.ext.dirs to set classpath
    "%JAVA%" -Djava.ext.dirs="%LIB_DIR%" org.openrdf.console.Console %CMD_LINE_ARGS%
    goto end
    :java6
    rem use java 6 wildcard feature
    rem echo Using wildcard to set classpath
    "%JAVA%" -cp "%LIB_DIR%\*" org.openrdf.console.Console %CMD_LINE_ARGS%
    goto end
    :end

    Hi,
    The following article will give you a hand to achieve your gold by running the Shell command from .Net.
    Launch and monitor external programs from .NET
    http://www.thescarms.com/dotnet/Process.aspx
    =============================================================================
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft
    does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent
    dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
    Hope this helps.

  • Is there a goto statement in java??

    is ther a goto statement in java
    if yes how is it
    and if no wat we use instead of it , if we want to redirect to control flow??
    thanking you
    rose!!!

    But he did not say it with three exclamation
    points!!!
    yes, I'm trying to restrict my usage of the exclamation mark as part of my attempts to be more even tempered (which aren't succeeding that well, but I may just need more practice).

  • Doubt in JAVA Programming-Use of GOTO?

    I'm new to JAVA. I found JAVA very strange at first as I was used to much of BASIC programming. Well, keeping all those aside, this is my very 5th program in JAVA. It is a program which inputs a number(from 1-10) and displays it's multiplication table. But when the execution is over, I want the program to repeat itself , in other words, an alternative to 'GOTO' function.
    This is my program:
    // A program to write tables
    import java.io.*;
    public class tables
        public static void main(String args[])throws IOException
            int a=0;//Initializing variables
            System.out.println("LEARN YOUR TABLES.");
            System.out.println("With this program, you can learn tables from 1-10");
            System.out.println("So what are you waiting for? Enter the number you want and hit ENTER");
            InputStreamReader x=new InputStreamReader(System.in);//Input Statement
            BufferedReader in=new BufferedReader(x);
            a=Integer.parseInt(in.readLine());//Store user input in "a"
            switch (a)
                case 1://For 1's tables
                System.out.println("WHAT?!?!?! DONT KNOW TABLES OF 1!!!! ");
                 break;
                case 2://For 2's tables
                int c;//Variables for this case
                for (c=1;c<=10;c++)
                System.out.println(2+" * "+c+" = "+ 2*c);
                break;
                case 3://For 3's tables
                int d=3;
                int e=1;
                do
                    System.out.println(3+" * "+e+" = "+d);
                    e++;
                    d=3*e;
                }while (e<=10);
                break;
                case 4://For 4's tables
                int f,g=1;
                while (g<=10)
                    f=4*g;
                    g++;
                    System.out.println(4 +" * "+g+" = "+f);
                break;
                case 5:
                int h;
                for (h=1;h<=10;h++)
                System.out.println(5+" * "+h+" = "+5*h);
                break;
                default:
                System.out.println("I'm sorry ladies and gentlemen but multiplication");
                System.out.println("for this number is still under construction and I");
                System.out.println("think that it will always be so..............");
    }After the table is executed, I want the program to begin from first. How can that be done?

    Hello dinodig,
    some hints that I hope are helpful:
    1a. Do not put your whole code in your main method, which is only the entry point to your program. I usually call the main class constructor in main(), from where the object oriented programming can start. Put the code in a learningTables() method that you can call every time you want to run that code. 1b. Read on from here!
    2. Go through the [java tutorials|http://download-llnw.oracle.com/javase/tutorial/java/TOC.html] from the beginning to the end. Thatll give you quite a first view of how the language works. Especially read the first chapter, "Object-Oriented Programming Concepts". Seems like a lot, but it really isnt. The ratio of benefit / reading is a really high one.
    3. GOTO is an abomination. It leads to ["spaghetti code"|http://en.wikipedia.org/wiki/Spaghetti_code]. Please dont feel insulted by this, it is a horrible thing. I. e. Im whipping GOTO here, not you. ;-)
    Too slow for sure. Well, Ive got to get my post count up or Mum will beat me again. :-)
    Have fun!

  • Is labeled loop in java 100% goto type ?

    Hi All,
    I have a small question for all of you. Can anybody explain me wheather
    the labeled loop in java is like 100% goto type or not. In the development time sometime we find some situation where we can use labeled break.It enhances the performance.But some developers say that we should not use labeled loop. It is highly discouraged. Please tell me wheather should we use labeled loop or not.

    Hi All,
    I have a small question for all of you. Can anybody
    explain me wheather
    the labeled loop in java is like 100% goto typeThat's a meaningless question, as "100% goto type" is not well defined.
    not. In the development time sometime we find some
    situation where we can use labeled break.It enhances
    the performance.Um, no. You don't use labeled break for performance reasons. You use it for clarity of expression.
    But some developers say that we
    should not use labeled loop. It is highly
    discouraged. Please tell me wheather should we use
    labeled loop or not.I'd say it has its place, but in 8 or 10 years of Java development, I've used it at most twice, maybe not at all. You can almost always do the same thing just as clearly without resorting to labels.

  • Can i use a goto in Java?

    i want to be able to get a value from a certain function, and based on that value either keep executing the code or exit the function that i am in (the actionPerformed function). is there a way to exit out of that function once you have already entered it so that it will be in the waiting state again?
    like this
    public void actionPerformed( ActionEvent event1 )
    int dummy = obj.myfunction();
    if (dummy == otherDummy)
    do something cool
    else
    send error message
    exit the actionPerformed (start over)

    Not a goto, no, but you can drop a return statement.
    public void foo()
        if (someCondition)
            return 0;
        } else
            if (someOtherCondition)
                x = doSomethingComplicated();
                y = doSomethingElseComplicated();
                return x + y;
            } else return 2;
    }

  • Values from a java archive file that uses Coherence are null

    This is essentially the details of my project.
    Check the values in andrew's coherence cluster.
    Checkign the values in the stats class.
    z:\javaclasses\stats.jar
    Some sample code:
    -- initialize
    /* start the stats class (the fields you want to look) */
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW,
    StatsField.PREV_CLOSE);
    -- pulling data
    if (Stats.get(sSymbol).PREV_CLOSE != null) {
    fValue = Stats.get(sSymbol).PREV_CLOSE;
    -- in your .bat file (Before setting the classpaths)
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts%
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    myclasspaths
    myclasspaths
    myclasspaths
    My bat file looks like this.
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts% -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    cd \
    cd C:\Users\Dan\Documents\Documents_for_4th_Project
    SET PATH=%PATH%;Z:\jdk1.7.0\bin
    SET CLASSPATH=
    SET CLASSPATH=%CLASSPATH%;.
    SET CLASSPATH=%CLASSPATH%;z:\javaclasses\stats.jar
    SET CLASSPATH=%CLASSPATH%;Z:\coherence\lib3702\coherence.jar
    javac ValuesInStats.java
    java ValuesInStats
    pause
    My ValuesInStats.java looks like this below.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    //package ValuesInStats;
    import stats.*;
    import java.io.*;
    * @author Dan
    public class ValuesInStats
    * @param args the command line arguments
    private double dayHigh;
    private double dayLow;
    private double prevClose;
    public void startStatClass()
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW, StatsField.PREV_CLOSE);
    public void pullDataFromStatClass()
    if (Stats.get("GOOG")._1_DAY_HIGH != null)
    dayHigh = Stats.get("GOOG")._1_DAY_HIGH;
    if (Stats.get("IBM")._1_DAY_LOW != null)
    dayLow = Stats.get("IBM")._1_DAY_LOW;
    if (Stats.get("SLB").PREV_CLOSE != null)
    prevClose = Stats.get("").PREV_CLOSE;
    public static void main(String[] args)
    ValuesInStats stat = new ValuesInStats();
    stat.startStatClass();
    stat.pullDataFromStatClass();
    try
    PrintWriter inputToFile = new PrintWriter(new BufferedWriter(new FileWriter("C:\\Users\\Dan\\Documents\\Documents_for_4th_Project\\DANS_StatReport.txt")));
    inputToFile.println(stat.dayHigh);
    inputToFile.println(stat.dayLow);
    inputToFile.println(stat.prevClose);
    inputToFile.close();
    catch(Exception e)
    e.getMessage();
    e.printStackTrace();
    The results i'm getting are included below.
    C:\Users\Dan\Documents\Documents_for_4th_Project>call z:\coherence\bin\prod_setup.bat
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM Call this batch file before setting any PATH or CP or JAVA_OPTS.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM You can override anything you don't like afterwards.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>title
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_HOME=z:\jdk7
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_EXE=z:\jdk7\bin\java_for_.exe
    C:\Users\Dan\Documents\Documents_for_4th_Project>set PATH=z:\jdk7\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2" %u in ('date /t') do set d=%v
    C:\Users\Dan\Documents\Documents_for_4th_Project>set d=10/11/2011
    C:\Users\Dan\Documents\Documents_for_4th_Project>set timestr=20111011
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2,3 delims=: " %i in ('time /t') do set q=%i%j%k
    C:\Users\Dan\Documents\Documents_for_4th_Project>set q=1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>set datetime=20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>echo 20111011_1052AM
    20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM token=14 for vista, 15 for XP
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=14,15" %a in ('c:\windows\system32\ipconfig | c:\windows\system32\findstr /R "Address.*XXX.XXX.X."') do (IF "%a" == ":" (set my_ip=%b ) ELSE (set my_ip=%a ) )
    C:\Users\Dan\Documents\Documents_for_4th_Project>(IF "XXX.XXX.X.XXX" == ":" (set my_ip= ) ELSE (set my_ip=XXX.XXX.X.XXX ) )
    IP=XXX.XXX.X.XXX
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F %i in ('z:\coherence\bin\getpid.exe') do set my_pid=%i
    C:\Users\Dan\Documents\Documents_for_4th_Project>set my_pid=1464
    C:\Users\Dan\Documents\Documents_for_4th_Project>IF /I "" == "OMS" goto OMS
    C:\Users\Dan\Documents\Documents_for_4th_Project>goto DONE
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>set java_opts= -Dtangosol.coherence.localhost=XXX.XXX.X.XXX -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.member=Dan -Xms -Xmx -server -showversion -Djava.
    eferIPv4Stack=true -Dtangosol.coherence.log.level=3 -Dtangosol.coherence.log=z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.log -Xloggc:z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.gc -Dtangosol.pof.config=z:/coherence/pof-conf
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config.xml -Dtangosol.coherence.clusteraddress=255.0.0.1 -Dtangosol.coherence.clusterport=54321 -Dtangosol.coherence.cluster=oms_prod -Dtangosol.coherence.rack= -Dtangosol.cohere
    te=1464 -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    C:\Users\Dan\Documents\Documents_for_4th_Project>cd \
    C:\>cd C:\Users\Dan\Documents\Documents_for_4th_Project
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET PATH=z:\jdk7\bin;Z:\jdk1.7.0\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar;Z:\coherence\lib3702\coherence.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>javac ValuesInStats.java
    C:\Users\Dan\Documents\Documents_for_4th_Project>java ValuesInStats
    2011-10-11 10:52:21.299/2.277 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence-override-dev.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.7.0.2 Build 25173
    Grid Edition: Development mode
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    2011-10-11 10:52:22.625/3.603 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded Reporter configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/reports/report-group.xml"
    2011-10-11 10:52:22.844/3.822 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded cache configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/coherence-cache-config.xml"
    2011-10-11 10:52:24.029/5.007 Oracle Coherence GE 3.7.0.2 <D4> (thread=main, member=n/a): TCMP bound to /XXX.XXX.X.XXX:8102 using SystemSocketProvider
    2011-10-11 10:52:24.560/5.538 Oracle Coherence GE 3.7.0.2 <Info> (thread=Cluster, member=n/a): This Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInSt
    uesInStats, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0x96AB" with senior Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=proces
    , Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0x96AB
    Group{Address=224.3.7.0, Port=37000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    OldestMember=Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    ActualMemberSet=MemberSet(Size=8, BitSetCount=2
    Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[7]}
    IpMonitor{AddressListSize=0}
    2011-10-11 10:52:24.872/5.850 Oracle Coherence GE 3.7.0.2 <D5> (thread=Invocation:Management, member=9): Service Management joined the cluster with senior service member 1
    2011-10-11 10:52:25.871/6.849 Oracle Coherence GE 3.7.0.2 <D5> (thread=DistributedCache, member=9): Service DistributedCache joined the cluster with senior service member 9
    Stats init _1_DAY_HIGH
    Stats init _1_DAY_LOW
    Stats init PREV_CLOSE
    Stats.get() hm has null for GOOG
    Stats.get() hm has null for IBM
    Stats.get() hm has null for SLB
    2011-10-11 10:52:28.605/9.583 Oracle Coherence GE 3.7.0.2 <D4> (thread=ShutdownHook, member=9): ShutdownHook: stopping cluster node
    2011-10-11 10:52:28.620/9.598 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=9): Service Cluster left the cluster
    C:\Users\Dan\Documents\Documents_for_4th_Project>pause
    Press any key to continue . . .
    I'm not sure why I'm getting null values. Let me know if additional information is needed. Thanks!
    P.S. IP Addresses represent XXX.XXX.X.XXX for security purposes.

    Here's the details of the stat class from the stats.jar. Thanks!
    package stats;
    import java.lang.reflect.Field;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Set;
    public class Stats implements com.tangosol.util.MapListener, com.tangosol.net.MemberListener {
    public String SYMBOL;
    public String NAME;
    public String CUSIP;
    public Long POSITION_LIMIT;
    public Float YEAR_HIGH;
    public String NEWS_BUY_RATING;
    public String NEWS_SELL_RATING;
    public String NEWS_NOTES;
    public Long AVG_DAILY_VOLUME;
    public Float MARKET_CAP;
    public Float _1_DAY_GROUP_PERCENT_CHANGE;
    public String PRIMARY_GROUP;
    public String ZACKS_RANK;
    public String FUND_GRADE;
    public String CRAMER_CALL;
    public Float PREV_CLOSE;
    public Float KSLOW;
    public Float DSLOW;
    public Float _90_DAY_HIGH;
    public Float _90_DAY_LOW;
    public Float _90_DAY_PERCENT_OF_RANGE;
    public Float _52_WEEK_HIGH;
    public Float _52_WEEK_LOW;
    public Float _52_WEEK_PERCENT_OF_RANGE;
    public Date NEXT_EARNINGS_DATE;
    public String NEXT_EARNINGS_ANNOUNCEMENT_TIME;
    public Object OPENING_INDICATION;
    public oms.OrderExchange PRIMARY_EXCHANGE;
    public Float _1_DAY_PERCENT_CHANGED;
    public Float _1_DAY_PERCENT_CHANGED_TEST;
    public Float _1_DAY_HIGH;
    public Float _1_DAY_LOW;
    public Long POSTMARKET_VOLUME;
    public Long PREMARKET_VOLUME;
    public Float OPEN_PRICE;
    public Integer POSTMARKET_TRADES;
    public Integer PREMARKET_TRADES;
    public Float POSTMARKET_HIGH;
    public Float POSTMARKET_LOW;
    public Float PREMARKET_HIGH;
    public Float PREMARKET_LOW;
    public Float POSTMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float PREMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float POSTMARKET_AVG_PRICE;
    public Float PREMARKET_AVG_PRICE;
    public Boolean IS_OPEN_ON_NYSE;
    public Boolean IS_HALTED;
    public Integer NEWSWARE_STORY_COUNT;
    public Float _1_DAY_PERCENT_OF_RANGE;
    public Boolean IS_ETF;
    public Integer ROUND_LOT_SIZE;
    public Integer LOCATED_SHARES_AVAILABLE;
    public Boolean IS_OPTIONABLE;
    private static HashMap<String, Stats> hm;
    private static List<com.tangosol.net.NamedCache> subscribedCacheList;
    private static Stats INSTANCE;
    private Set<StatsUpdateListener> updateListenerSet;
    public Stats() {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberJoined(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeaving(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeft(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static Stats get(String string) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static void init(StatsField[] sfs) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private static Field getField(com.tangosol.util.MapEvent me) throws NoSuchFieldException {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void notifyUpdateListeners(Field field, Object o) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void addStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void removeStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void processInsertOrUpdate(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryInserted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryUpdated(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void entryDeleted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    }

  • JNI Invocation: open file in Java, write file in CPP

    Hello,
    Warning: I am a dunce, bad CPP code ahead!
    Using JNI invocation, I am trying to read a binary file in Java and write it in CPP.
    Everything compiles and runs without error, but the input and output jpg files are of course different.
    TIA to any help,
    kirst
    (begin ByteMe.java)
    import java.io.*;
    public class ByteMe
        // Returns the contents of the file in a byte array.
        public byte[] getBytesFromFile(String strInfo) throws IOException
            System.out.println("Testing:" + strInfo);
            File file = new File("1.jpg");
            InputStream is = new FileInputStream(file);
            // Get the size of the file
            long length = file.length();
            // Create the byte array to hold the data
            byte[] bytes = new byte[(int)length];
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            // Ensure all the bytes have been read in
            if (offset < bytes.length)
                throw new IOException("Could not completely read file "+file.getName());
            // Close the input stream and return bytes
            is.close();
            return bytes;
        public ByteMe()
              //System.out.println("in constructor");
    }(end ByteMe.java)
    (begin ByteMe.cpp)
    #include <stdlib.h>
    #include <string.h>
    #include <jni.h>
    #include <windows.h>
    // for file operations:
    #include <fstream>
    int main( int argc, char *argv[] )
         JNIEnv *env;
         JavaVM *jvm;
         JavaVMInitArgs vm_args;
         JavaVMOption options[5];
         jint res;
         jclass cls;
         jmethodID mid;
         jstring jstr;
         jobject obj_print;
         options[0].optionString = "-Xms4M";
         options[1].optionString = "-Xmx64M";
         options[2].optionString = "-Xss512K";
         options[3].optionString = "-Xoss400K";
         options[4].optionString = "-Djava.class.path=.";
         vm_args.version = JNI_VERSION_1_4;
         vm_args.options = options;
         vm_args.nOptions = 5;
         vm_args.ignoreUnrecognized = JNI_FALSE;
         // Create the Java VM
         res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         if (res < 0)
              printf("Can't create Java VM");
              goto destroy;
         cls = env->FindClass("ByteMe");
         if (cls == 0)
              printf("Can't find ByteMe class");
              goto destroy;
         jmethodID id_construct = env->GetMethodID(cls,"<init>","()V");
         jstr = env->NewStringUTF(" from C++\n");
         obj_print = env->NewObject(cls,id_construct);
         // signature obtained using javap -s -p ByteMe
         mid = env->GetMethodID(cls, "getBytesFromFile", "(Ljava/lang/String;)[B");
         if (mid == 0)
              printf("Can't find ByteMe.getBytesFromFile\n");
              goto destroy;
         else
              jbyteArray jbuf = (jbyteArray) env->CallObjectMethod(obj_print,mid,jstr);
              jlong size = jsize(jbuf);
              printf("size is: %d\n", size); // size shown in output is
              std::ofstream out("data.jpg", std::ios::binary);
              out.write ((const char *)jbuf, 100000);     
         destroy:
             if (env->ExceptionOccurred())
                env->ExceptionDescribe();
        jvm->DestroyJavaVM();
    }(end ByteMe.cpp)

    Hello,
    Me again. Well, not such a dunce after all. Here is code that works correctly, and compiles with no errors and no warnings.
    Will much appreciate help with clean-up code.
    TIA,
    kirst
    (begin ByteMe.java)
    import java.io.*;
    public class ByteMe
        public long getFilezize(String strInfo) throws IOException
              // demonstrates String parameter passed from CPP to Java:
              System.out.println("(getFilesize) Hello world" + strInfo);
              File file = new File("1.bmp");
              InputStream is = new FileInputStream(file);
              // Get the size of the file
              long length = file.length();
              is.close();
              return length;
        // Returns the contents of the file in a byte array.
        public byte[] getBytesFromFile(String strInfo) throws IOException
            System.out.println("(getBytesFromFile) Hello world" + strInfo);
            File file = new File("1.bmp");
            InputStream is = new FileInputStream(file);
            // Get the size of the file
            long length = file.length();
            System.out.println("length is: " + String.valueOf(length));
            // Create the byte array to hold the data
            byte[] bytes = new byte[(int)length];
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0)
                offset += numRead;
            // Ensure all the bytes have been read in
            if (offset < bytes.length)
                throw new IOException("Could not completely read file "+ file.getName());
            // Close the input stream and return bytes
            is.close();
            return bytes;
        public ByteMe()
              //System.out.println("in constructor");
    }(end ByteMe.java)
    (begin ByteMe.cpp)
              Signature obtained with command:
                   "C:\Program Files\Java\jdk1.5.0_15\bin\javap.exe" -s -p ByteMe
                   Compiled from "ByteMe.java"
                   public class ByteMe extends java.lang.Object{
                   public long getFilezize(java.lang.String)   throws java.io.IOException;
                     Signature: (Ljava/lang/String;)J
                   public byte[] getBytesFromFile(java.lang.String)   throws java.io.IOException;
                     Signature: (Ljava/lang/String;)[B
                   public ByteMe();
                     Signature: ()V
         Compiled VC++ 2005 Express, run on Vista
    #include <stdlib.h>
    #include <string.h>
    #include <jni.h>
    // file operations
    #include <fstream>
    int main( int argc, char *argv[] )
         JNIEnv *env;
         JavaVM *jvm;
         JavaVMInitArgs vm_args;
         JavaVMOption options[5];
         jint res;
         jclass cls;
         jmethodID mid;
         jmethodID sizeid;
         jstring jstr;
         jobject obj_print;
         jlong filesize;
         options[0].optionString = "-Xms4M";
         options[1].optionString = "-Xmx64M";
         options[2].optionString = "-Xss512K";
         options[3].optionString = "-Xoss400K";
         options[4].optionString = "-Djava.class.path=.";
         vm_args.version = JNI_VERSION_1_4;
         vm_args.options = options;
         vm_args.nOptions = 5;
         vm_args.ignoreUnrecognized = JNI_FALSE;
         // Create the Java VM
         res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         if (res < 0)
              printf("Can't create Java VM");
              goto destroy;
         cls = env->FindClass("ByteMe");
         if (cls == 0)
              printf("Can't find ByteMe class");
              goto destroy;
         jmethodID id_construct = env->GetMethodID(cls,"<init>","()V");
         printf("%s\n",id_construct);
         jstr = env->NewStringUTF(" from C++!\n");
         if (jstr == 0)
              // Normally not useful
              printf("Out of memory (could not instantiate new string jstr)\n");
              goto destroy;
         obj_print = env->NewObject(cls,id_construct);
         //BEGIN BLOCK to get file size
         sizeid = env->GetMethodID(cls, "getFilezize", "(Ljava/lang/String;)J");
         if (sizeid == 0)
              printf("Can't find ByteMe.getFilezize\n");
              goto destroy;
         else
              printf("got here\n");
              filesize =(jlong) env->CallObjectMethod(obj_print,sizeid,jstr);
              printf("got filesize\n");
         // END BLOCK to get file size
         // BEGIN BLOCK to write file
         mid = env->GetMethodID(cls, "getBytesFromFile", "(Ljava/lang/String;)[B");
         if (mid == 0)
              printf("Can't find ByteMe.getBytesFromFile\n");
              goto destroy;
         else
              jbyteArray ret =(jbyteArray) env->CallObjectMethod(obj_print,mid,jstr);
              // Access the bytes:
              jbyte *retdata = env->GetByteArrayElements(ret, NULL);
              // write the file
              std::ofstream out("data.bmp", std::ios::binary);
              //out.write ((const char *)retdata, 921654);
              out.write ((const char *)retdata, (long)filesize);
         // END BLOCK to write file
         destroy:
             if (env->ExceptionOccurred())
                env->ExceptionDescribe();
        jvm->DestroyJavaVM();
    }(end ByteMe.cpp)

  • How Java Sould be Marketed(interesting)

    I thought this may be relevent here, it gets into some interesting ideas about distribution. enjoy.
    Sun needs a new JAVA marketing strategy.
    Opinions expressed here are of my own, Matt Prokes, remember these are only opinions about what should or could be.
    If you have ?'s contact me at [email protected]
    What Java's Problem Is:
    As far as I can see the only problem that java has these days is the client inconsistency s, this is due to Microsoft and there attempted destruction of the HUGE java language, and Microsoft has succeeded wonderfully thus far, which is sad. I feel it is only due to the way Sun markets Java, not that they have not tried but they are going about it the wrong way.
    Sun Feels They Are Being Oppressed:
    It seems to me that Sun has a feeling of being oppressed by Microsoft, they see the company inflicting standards on the computing world that are self centered and platform specific, this is why java was created, to break that mold and it does it wonderfully but java has not gained popularity because of marketing technique, no, it has gained popularity because it REALLY is what it is cracked up to be....A better way of doing things....
    That is why sun landed the title of being one the the most innovative company s today by the magazine �PC World� ranking 13th place while Microsoft landed 137th (i think).
    Yet with all this technology sun does not try to inflict it's standards on the PC world, well you might think what about all those court cases, for instance the most recent that suggests that Sun wants to FORCE Microsoft to install their JVM. I think stuff like this just slows Sun down, as we learned with previous cases Microsoft is just to big to fight and if you do manage to win it will be 3-4 years later. If you think about it time is money, why waste time? Trying to leach off of Microsoft is NOT the way to inflict standards, in fact it is one of the worst ways because by the time you would have won Microsoft would have bullied the java environment to it's grave (umm .net). So you may ask how do we enforce standards without the help of Microsoft, the answer is more simple than you may think yet for some reason it has not been thought of by Sun. So far this is what has brought Microsoft to the top.
    1.Great Software
    2.Enforced Standards, and Implementation
    3.Excellent Marketing
    4.Protected Software (Ideas)
    5.Industry Wide Support
    Innovation is not on this list, Microsoft does not have a innovative bone in it's body at the moment, it just buys technology that it needs, and has flashy GUI's, and a huge amount of support in the software industry. This is why according to the magazine �PC World� Microsoft ranks #137 in innovation while Sun sits at a satisfying ranking of #13.
    What this means is that Sun just is more innovative, it has technology out there that could be used but it can't because we have clients with Version 1.3 Java software on their PC's, Either that or Proprietary and NOT PLATFORM INDEPENDENT Microsoft JVM's which Microsoft will again start to distribute in 2004 on XP, this brings me to my first point, if we are going to have a platform independent language it needs to come from ONE POINT that will be implemented by all Manufactures (the W3C for instance). You may be thinking well how do you enforce the SUN JVM if Microsoft does not pack it with windows? The answer is you do what most new company s do and that is goto the PC Vendors. I would like to point out that Microsoft is for the most part ONLY a software company (aside from some of there PC products), but they do not build and distribute PC systems, thus Microsoft does not control what can go on a PC, I would like to point out the growing Linux threat to windows, more particularly the Linux based operating system (Lindows) recently lindows has acquired a deal with walmart to sell there operating system as a substitute to windows, this worked out phenominaly and right now walmart cannot seem to keep enough of the pc's on the shelves (since they cost only about 199$). Case point Linux has also grown enormously due to �Home Editions� of Linux (Red Hat). The first point I would like to make is that Sun should be PAYING vendors to install the SUN JVM over the Microsoft one, this takes care of a few of Sun's problems (Not as much industry support as Microsoft, and upgrading the JVM) all this can be done for a measly 5-6 million a year and will reach about 70% of the PC sector, in fact I am almost certain this is how Microsoft started out.
    One Of Java's Big Problems JVM Inconsistency s
    Now if Sun locks 70% of the PC market that will already be a large boost for java, but the question is how to make the percentage grow to 100%... I would now like to point out the company Macromedia, macromedia products are phenominal, and have changed the way media is seen on the web, particularly the Flash product that macromedia sells, now at this moment macromedia has stated that >90% flash support exists on the web today and >70% is with the most current version of flash, as I see it in fact flash is one of the most universally supported pieces of software even more so than Microsoft, this is why you see flash movies on yahoo, cnet, amazon, and even MSN! So you may ask what made flash what it is today? Well as described before flash is supported and installed by PC vendors, and even if it is not you can barely go any place on the web with out getting a message stating that you should upgrade to the most current version of flash, this is due to the wide support on the web..... Now on the other hand if I run a java applet and the applet was compiled with some new features that were not supported in version 1.3 (Swing for example) we will get an error message stating that the package cannot be found and the applet will not run...You do not get any messages to upgrade, no window prompts, nothing..which brings me to my next point the java compiler should include the code (a pre JVM 1.3 version & Microsoft JVM compatible) that will prompt you to install the most current version of Java you already see default loaders for swing, a plug in check should also be included in all programs to ensure that you have to most recent version, and if you do not then it will send you to the Sun Website, or display a update manager or something. Getting an error saying that the applet packages are not found does not help the user any it only frustrates them, you have to physically provide a remedy to the problem at hand. This should also check to see if the Microsoft JVM is installed and if it is prompt to upgrade to the Sun JVM, this will pretty much destroy the use of the Microsoft JVM.
    This takes care of the enforcing standards part, braudens the Industry Wide Support, and protects the java environment, last but not least you need to promote the software, Java already does this excellently with web services, and other things but there are more consumers than businesses and Java should also be concentrating more on the excellent 3d support that they have, the networking features of java, ect. Take OpenOffice.org for instance the product has grown emmensly since it has started and much uses Java API's, you would see much growth in Java if you provided other products like Open Office for free, for instance a Quake Like Multi player game in Java 3D distributed on an open source environment, in applet form (since applets are exclusively a invention of Java), and then have a couple of servers set up that people can play for free on Sun's site, more networking app's for free, ect. You have to promote some of the more flashy features of Sun this way in order to see more growth and support and for free (learn from Linux which is quickly becoming a HUGE threat for Microsoft) if sun is making 13 billion a year I see no problem to them sporting a couple of servers with some USEFUL online apps/games/ect that sport how innovative java really is, and if they really need to they can have all the banners on stuff like the online games, take Http://www.runescape.com that sports an average of 10,000 users at any moment using the cross platform Java 3d API and they do it for free! All open source free products should be on Suns website, it shows how strong of a community Sun really is, instead of having it on some other website like www.openoffice.org that only sports Sun's name maybe a few times you might occasionally see a logo.. it would be better to maybe get open office from an address like www.openoffice.sun.com, maybe try a www.games.sun.com address or a www.apps.sun.com and then advertise the stuff that can be found at the Sun website. You see Microsoft doing it with the .net platform and other utility s all the time on places like MSN I don't see why Sun does not make the same initcative and better yet have it open source. Open source software simply �matures� quicker than regular software, Sun should be proud to be part of open source, it is the only thing Microsoft can't buy....
    Opinions Of Matt Prokes..
    [email protected]

    And now your question is "How should my ideas be marketed?" Well unfortunately ideas, even if they are unique and original, are a dime a dozen. And they are mostly drowned out by propaganda, sometimes in the guise of ideas itself.
    If you really want to propagate your ideas, then you need to follow ashkelon's advice. My eyes glazed over almost instantly when I ran into 40-line paragraphs. Find somebody who writes well and ask them for their help. (Those people are often called "editors" when they are at work.)
    Next, where should you try to send your ideas? I can tell you that vice presidents of marketing respond negatively when people come out of nowhere and tell them "You are doing your job wrong, here's what you should be doing." No matter whether what you say is true or not, that's just human nature to get all defensive when that happens. You could try to get an article like what you posted there published in one of the industry magazines that covers topics like that; but to do that you would definitely need an editor. (You might even get paid for the article, too.)

  • Exception in thread "main" java.lang.NoClassDefFoundError: example2

    Ok, I have done some java programming before, and it used to work fine on my pc. I have deleted every piece of java off my machine and replaced it and I still get the same error. I have a simple program:
    import java.io.*;
    public class example2
    static BufferedReader keyboard = new
    BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException
    String flavor; //variable to hold buyer's chosen flavor
    int gallons; //variable to hold number of gallons purchased
    float price = 0.0F; //just 0.0 would be a double, can't store in float
    System.out.println("Would you like chocolate or strawberry?");
    flavor = keyboard.readLine();
    System.out.println("How many gallons would you like?");
    gallons = Integer.parseInt(keyboard.readLine());
    //why? readLine() gives String, need to convert to int
    if(flavor.equals("chocolate")){
    price = gallons * 5.59F;
    } else {
    price = gallons * 4.89F;
    System.out.println("Total price for " + gallons + " gallons of "
    + flavor + " ice cream is $" + price);
    and then I run it :java example2
    and get the same error over and over again. But, if i goto my colloge - and do the same thing om a diff pc, I works just fine. I am running 1.4.1_01 and am just going nuts. Bug maybe?? any takers..
    Gerald Pottier

    float price = 0.0F; //just 0.0 would be a
    be a double, can't store in float
    if(flavor.equals("chocolate")){
    price = gallons * 5.59F;
    } else {
    price = gallons * 4.89F;
    }Does float normally have letters at the end?
    maybe you can do a type cast
    float price = (float) 0.0;
    How does java know what * 5.59F is?
    how does it know that it's the same as 5.59? isn't 5.59F a String?
    It's not a retorical question.. could you explain how java knows?
    I looked at your example, and looked up 'float' in my java book, which doesn't say about putting letters/currency symbols at the end of a number in a float. I only wanted to know if it is possible? (I'm new so I can't answer your questions, sorry, I didn't understand that bit of your example).

  • How does the Java card simulator work? and other misc questions

    First, I have a class inherited from Applet. Okay, I did that.
    How do I convert this class to a CAP file? I mean I have a class file which is compiled by javac, do I use this file to convert into a CAP file? What is an AID? Do I make up this AID?
    In this .scr file (APDU Script), I understand the first 4 bytes, it means to create an Applet, but what about the rest? I know there are some intermixes of lengths and AIDs, I just can't decipher this.
    // create wallet applet
    0x80 0xB8 0x00 0x00 0x14 0x0a 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x6 0x1 0x08 0 0 0x05 0x01 0x02 0x03 0x04 0x05 0x7F;
    And here comes the main question?
    How does the simulator work? How do I generate the data that mimics what the card reader reads?
    Thanks
    Jack

    At first blush,
    I have these when executing the RMIPurse sample according to the user guide
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported type long of field interfaceHash.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type long of method dispatch.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.SkeletonMismatchException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Skel: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported type long of field interfaceHash.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported type long of field serialVersionUID.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode new in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokespecial in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.rmi.server.Operation.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode pop in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode anewarray in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokestatic in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method class$(java.lang.String) of class com.sun.jcclassic.samples.rmi.PurseImpl_Stub.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode aastore in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported bytecode invokevirtual in clinit method.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method getMethod(java.lang.String, java.lang.Class[]) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode goto in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unhandled bytecode pop in clinit method, try a different compiler.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of method class$.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method forName(java.lang.String) of class java.lang.Class.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported return type String of invoked method getMessage() of class java.lang.Throwable.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String) of class java.lang.NoClassDefFoundError.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java.lang.Object[], long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method newCall(java.rmi.server.RemoteObject, java.rmi.server.Operation[], int, long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnexpectedException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java.lang.Object[], long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method newCall(java.rmi.server.RemoteObject, java.rmi.server.Operation[], int, long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnexpectedException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java.lang.Object[], long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method newCall(java.rmi.server.RemoteObject, java.rmi.server.Operation[], int, long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnexpectedException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java.lang.Object[], long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method newCall(java.rmi.server.RemoteObject, java.rmi.server.Operation[], int, long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnmarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnexpectedException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java.lang.Object[], long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported long type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type long of invoked method newCall(java.rmi.server.RemoteObject, java.rmi.server.Operation[], int, long) of class java.rmi.server.RemoteRef.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.MarshalException.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported String type constant.
      [convert] error: com.sun.jcclassic.samples.rmi.PurseImpl_Stub: unsupported parameter type String of invoked method <init>(java.lang.String, java.lang.Exception) of class java.rmi.UnexpectedException.At the first command prompt, I typed cref -o demoee
    and at the next command prompt, I typed ant all, and I got those error messages.
    Thanks, you are so nice to help :)
    Jack

Maybe you are looking for

  • How do you return to web page after executing servlet?

    When I submit some values to my servlet from a page, using a from, how do I get back into the web page directory? When you call the servlet, the url turns to "./servlet", and if I click on submit again, it tries to find "./servlet/servlet" so obvious

  • Firefox crashing when printing large webpage Windows 7

    I have a fairly complex HTML document that is generated from a 3rd party application. It is approximately 100 pages of A4 at least. When generated on a Windows 7 machine, the HTML is generated fine and opens in Firefox 16.0.2 as expected. However, wh

  • Apache in testing dosen't work

    i install apache mysql and php in testing repo. but apache dosen't work. $ sudo /etc/rc.d/httpd start :: Starting HTTP Daemon                                                  [FAIL] $ sudo /usr/sbin/apachectl start httpd: Syntax error on line 232 of

  • PC vs Mac dl speeds on Linksys

    Hi My provider recently upgraded to provide download speeds up to 16Mbps. I have a Linksys G Router (WRT54G) serving three PC and two macs. I am seeing throughput on the PCs averaging around >8Mbps and occasionally in excess of 12Mbps; however, my Ma

  • How do i remove duplicate tunes in itunes please?

    Hi, My iTunes library is showing multiple copies of each song. Is there a routine ort tool available to remove these please? My library is stored on an external drive. Any ideas?