Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

here is the error.. any idea about what can i do?

Posted on 2006-05-09
23
Medium Priority
?
266 Views
Last Modified: 2012-06-21


Usage: javaw [-options] class [args...]
           (to execute a class)
   or  javaw [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client        to select the "client" VM
    -server        to select the "server" VM
    -hotspot        is a synonym for the "client" VM  [deprecated]
                  The default VM is client.
                 
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument

       
0
Comment
Question by:dervisakyuz
  • 10
  • 10
  • 2
  • +1
23 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16641052
Please post the command you're executing
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16641383
Its not a error , there is some mistake in the command syntax which you had specified  or typed.
So Just put forward the command you tryed to execute.

General Syntax is

javaw ClassName
or
javaw -cp Classpath ClassName

Thank You
0
 

Author Comment

by:dervisakyuz
ID: 16641737
here is my command

import java.util.Scanner ;
import java.lang.Object;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.lang.Math;



import sun.io.Converters;
import java.lang.Object;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.lang.Math;
public class AEC
{
   
    static int TAPS = 80*80 ;
    static float MAXPCM = 32767.0f ;
    static int NLMS_EXT = 80;
    static int DTD_LEN = 16;
    static int NLMS_LEN = 80*8;
   
   
//  sabit degerler
    final float M0dB = 1.0f;
    final float M3dB = 0.71f;
    final float M6dB = 0.50f;
    final float M9dB = 0.35f;
    final float M12dB = 0.25f;
    final float M18dB = 0.125f;
    final float M24dB = 0.063f;

    /* dB degerleri 16bit PCM icin */
    /* MxdB_PCM = 32767 * 10 ^(x / 20) */
    final float M10dB_PCM = 10362.0f;
    final float M20dB_PCM = 3277.0f;
    final float M25dB_PCM = 1843.0f;
    final float M30dB_PCM = 1026.0f;
    final float M35dB_PCM = 583.0f;
    final float M40dB_PCM = 328.0f;
    final float M45dB_PCM = 184.0f;
    final float M50dB_PCM = 104.0f;
    final float M55dB_PCM = 58.0f;
    final float M60dB_PCM = 33.0f;
    final float M65dB_PCM = 18.0f;
    final float M70dB_PCM = 10.0f;
    final float M75dB_PCM = 6.0f;
    final float M80dB_PCM = 3.0f;
    final float M85dB_PCM = 2.0f;
    final float M90dB_PCM = 1.0f;

   // final float MAXPCM = 32767.0f;

    /* Design finalants (Change to fine tune the algorithms */

    /* The following values are for hardware AEC and studio quality
     * microphone */

    /* maximum NLMS filter length in taps. A longer filter length gives
     * better Echo Cancellation, but slower convergence speed and
     * needs more CPU power (Order of NLMS is linear) */

    /* convergence speed. Range: >0 to <1 (0.2 to 0.7). Larger values give
     * more AEC in lower frequencies, but less AEC in higher frequencies. */
    final float Stepsize = 0.7f;
    /* minimum energy in xf. Range: M70dB_PCM to M50dB_PCM. Should be equal
      * to microphone ambient Noise level */
     final float Min_xf = M75dB_PCM;

     /* Double Talk Detector Speaker/Microphone Threshold. Range <=1
      * Large value (M0dB) is good for Single-Talk Echo cancellation,
      * small value (M12dB) is good for Doulbe-Talk AEC */
     final float GeigelThreshold = M6dB;

     /* Double Talk Detector hangover in taps. Not relevant for Single-Talk
      * AEC */
     final int Thold = 30 * 8;

     /* for Non Linear Processor. Range >0 to 1. Large value (M0dB) is good
      * for Double-Talk, small value (M12dB) is good for Single-Talk */
    final float NLPAttenuation = M12dB;



     // Geigel DTD (Double Talk Detector)
      float max_max_x;               // max(|x[0]|, .. |x[L-1]|)
      int hangover;
      // optimize: less calculations for max()
      float[] max_x = new float[NLMS_LEN / DTD_LEN];
      int dtdCnt;
      int dtdNdx;



      // NLMS-pw
      float[] x = new float[NLMS_LEN + NLMS_EXT];
      // tap delayed loudspeaker signal
      float[] xf = new float[NLMS_LEN + NLMS_EXT];
      // pre-whitening tap delayed signal
      float[] w = new float[NLMS_LEN];  
      // tap weights
      int j;                        // optimize: less memory copies
      int lastupdate;               // optimize: iterative dotp(x,x)
      double dotp_xf_xf;            // double to avoid loss of precision
      double Min_dotp_xf_xf;
      float s0avg;

      IIR_HP hp00 = new IIR_HP();

      FIR_HP13 hp0 = new FIR_HP13();

      IIR_HP hp1 = new IIR_HP();

      IIR1 Fx = new IIR1();

      IIR1 Fe = new IIR1();

//    constractor
      AEC ()
      {

                 max_max_x = 0.0f;
             hangover = 0;
      
             java.util.Arrays.fill(max_x,0);
      
             dtdCnt = dtdNdx = 0;
      
              java.util.Arrays.fill(x,0);
      
               java.util.Arrays.fill(xf,0);
      
                java.util.Arrays.fill(w,0);
      
               j = NLMS_EXT;
             lastupdate = 0;
             lastupdate = 0;
               s0avg = M80dB_PCM;
               setambient(Min_xf);
     }
     
     
        float dotp(float a[], float b[], int value)
          {
                        float sum0 = 0, sum1 = 0;
                        int j;
            
                        for (j = 0; j < NLMS_LEN; j+= 2) {
                          // optimize: partial loop unrolling
                          sum0 += a[j] * b[j+value];
                          sum1 += a[j+1] * b[j+1+value];
                        }
                        return sum0+sum1;
          }
     
     
     
   
        float getambient()
        {
            return s0avg;
        }
         
        void setambient(float Min_xf)
        {
            dotp_xf_xf = Min_dotp_xf_xf = NLMS_LEN * Min_xf * Min_xf;
        }
       
       
     
   
   
 
       
        float nlms_pw(float mic, float spk, int update)
        {
                    float d = mic;                    // desired signal
                      x[j] = spk;
                      xf[j] = Fx.highpass(spk);     // pre-whitening of x
      
                      // calculate error value
                      // (mic signal - estimated mic signal from spk signal)
                     
                     
                     
                      float e = d - dotp(w, x , j );
                     
                      float ef = Fe.highpass(e);    // pre-whitening of e
                      // optimize: iterative dotp(xf, xf)
                      dotp_xf_xf += (xf[j]*xf[j] - xf[j+NLMS_LEN-1]*xf[j+NLMS_LEN-1]);
                      if (update!=0)
                      {
                              // calculate variable step size
                              float mikro_ef = (float)(Stepsize * ef / dotp_xf_xf);
            
                              // update tap weights (filter learning)
                              int i;
                              for (i = 0; i < NLMS_LEN; i += 2) {
                                // optimize: partial loop unrolling
                                w[i] += mikro_ef*xf[i+j];
                                w[i+1] += mikro_ef*xf[i+j+1];
                              }
                    }
      
                    if (--j < 0) {
                        // optimize: decrease number of memory copies
                        j = NLMS_EXT;
                            System.arraycopy(x,0,x,j+1,(NLMS_LEN-1));
                        System.arraycopy(xf,0,xf,j+1,(NLMS_LEN-1));
                }
      
                return e;
        }
   
   
   
   
        boolean dtd(float d, float x)
        {
              
                     x = Math.abs(x);
            
                    if (x > max_x[dtdNdx]) {
                        max_x[dtdNdx] = x;
                        if (x > max_max_x) {
                          max_max_x = x;
                        }
                      }
                      if (++dtdCnt >= DTD_LEN) {
                        dtdCnt = 0;
                        // calculate max of max
                        max_max_x = 0.0f;
                        for (int i = 0; i < NLMS_LEN/DTD_LEN; ++i) {
                          if (max_x[i] > max_max_x) {
                            max_max_x = max_x[i];
                          }
                        }
                        // rotate Ndx
                        if (++dtdNdx >= NLMS_LEN/DTD_LEN) dtdNdx = 0;
                        max_x[dtdNdx] = 0.0f;
                      }
            
                    if (Math.abs(d) >= GeigelThreshold * max_max_x) {
                        hangover = Thold;
                      }
            
                      if (hangover!= 0)
                       --hangover;
                     
                      return (hangover > 0);
                     
        }
   
   
        int doAEC(int d, int x)
        {

                      float s0 = (float)d;
                      float s1 = (float)x;
                      boolean myTemp;
      
      
      
                            // Mic Highpass Filter - to remove DC
                            s0 = hp00.highpass(s0);
      
                            // Mic Highpass Filter - telephone users are used to 300Hz cut-off
                            s0 = hp0.highpass(s0);
      
                            // ambient mic level estimation
                            s0avg += 1e-4f*(Math.abs(s0) - s0avg);
      
                            // Spk Highpass Filter - to remove DC
                            s1 = hp1.highpass(s1);
      
                            myTemp=!dtd(s0, s1);
                            int update;
                            
                            // Double Talk Detector
                            if(myTemp == true)
                                  update = 1;
                            else update = 0;
                            
      
                            // Acoustic Echo Cancellation
                            s0 = nlms_pw(s0, s1, update);
      
                            // Acoustic Echo Suppression
                            if (update!=0) {
                              // Non Linear Processor (NLP): attenuate low volumes
                              s0 *= NLPAttenuation;
                            }
      
                            // Saturation
                            if (s0 > MAXPCM) {
                              return (int)MAXPCM;
                            } else if (s0 < -MAXPCM) {
                              return (int)-MAXPCM;
                            } else {
                              return (int)Math.round(s0);
      
      
                            }
        }
       
        public static void main(String[] args) throws IOException ,ClassNotFoundException  {
                 STEREO [] inbuf = new STEREO [TAPS] ;
                     STEREO [] outbuf= new STEREO [TAPS] ;

           if (args.length != 3) {
             System.err.println("usage: AECTest [ambient in dB] in.raw out.raw\n");
             return;
           }

           AEC aec = new AEC();
           aec.setambient(MAXPCM * dB2q(Float.parseFloat(args[0])));

           int taps;

           FileInputStream inFileStream = new FileInputStream(args[1]);
           ObjectInputStream inDataStream = new ObjectInputStream(inFileStream);
           FileOutputStream outFileStream = new FileOutputStream(args[2]);
           ObjectOutputStream outDataStream = new ObjectOutputStream(outFileStream);

             
             int iii=0;
           while (inDataStream.available() !=0) {
                   inbuf[iii]=(STEREO)inDataStream.readObject();
             iii++;
             
             }
             taps=iii;
       

             int i;
             for (i = 0; i < taps; i++) {
               int s0 = inbuf[i].l;      /* left channel microphone */
               int s1 = inbuf[i].r;      /* right channel speaker */

               /* and do NLMS */
               s0 = aec.doAEC(s0, s1);

               /* copy back */
               outbuf[i].l = 0;          /* left channel silence */
               outbuf[i].r = (short)s0;         /* right channel echo cancelled mic */
             
             outDataStream.writeObject(outbuf[i]);
             }


           inDataStream.close();
           inFileStream.close();
           outDataStream.close();
           outFileStream.close();

           float ambient = aec.getambient();
           float ambientdB = q2dB(ambient / 32767);
           System.err.println("Ambient = " + ambientdB  + " dB");
           return;
         
        }
         public static float dB2q (float dB) {
           /* Dezibel to Ratio */
           return (float)Math.pow(10.0f, dB / 20.0f );
         }

         public static float q2dB (float q) {
           /* Ratio to Dezibel */
           return (float)((float) 20 * (Math.log(q) / Math.log(10)));
         }

     
       

       
       
       
       
       
//public static void main(String[] args)
   
   //  STEREO [] inbuf = new STEREO [TAPS] ;
     //   STEREO [] outbuf= new STEREO [TAPS] ;
       
       // System.err.println( "Usage: java aec_test [ambient in dB] <in.raw >out.raw" ) ;
       
        //AEC aec = new AEC() ;
       
        //if ( args.length > 1 )
        //{
          //  aec.setambient( MAXPCM * Float.parseFloat( args[0] ) ) ;
        //}
       
       
        //Scanner sc = new Scanner( System.in ) ;
        //String str ;
       
        //int i = 0 ;
       
        //while ( sc.hasNext() )
        //{
          //  str = sc.next() ;
           
            //inbuf[i].l = Short.parseShort( str.substring( 0, str.indexOf(" ") ) ) ;
            //inbuf[i].r = Short.parseShort( str.substring( str.indexOf(" ")+1 ) ) ;
           
            //int s0 = (int)inbuf[i].l ;
            //int s1 = (int)inbuf[i].r ;
           
            //s0 = aec.doAEC( s0, s1 ) ;
           
            // copy back
            //outbuf[i].l = (short)s0 ;
            //outbuf[i++].r = (short)s0 ;
       // }
       
        //for ( int k=0; k<i; k++ )
        //{
          //  System.out.println( outbuf[i] ) ;
        //}
        //
       // float ambient = aec.getambient() ;
        //float ambientdB = q2dB( ambient / MAXPCM ) ;
       
    //    System.err.println( "Ambient = "+ambientdB+" dB ") ;
    //}
   
   
    class STEREO
    {
        short l, r ;
       
        public String toString() { return "L="+l+"  R="+r ; }
    }
   
    class  IIR_HP
    {

          float x;

       // al sana constructor.
                public IIR_HP()
                       { x = 0.0f; };
                      float highpass(float in) {
              final float a0 = 0.01f;   /* controls Transfer Frequency */
              /* Highpass = Signal - Lowpass. Lowpass = Exponential Smoothing */
              x += a0 * (in - x);
              return in - x;
            }
                      
    }
   
   
//  ikinci highpass class
    class FIR_HP13
    {

                 double[] z = new double[14];


               float highpass(float in) {

                float[] a = new float[14];

                a[1]=-0.043183226f;
                a[2]=-0.046636667f;
                a[3]= -0.049576525f; a[4]= -0.051936015f; a[5]= -0.053661242f;
                a[6]= -0.054712527f; a[7]= 0.82598513f; a[8]= -0.054712527f;
                a[9]=  -0.053661242f; a[10]= -0.051936015f; a[11]= -0.049576525f;
                a[12]= -0.046636667f; a[13]= -0.043183226f; a[14]= 0.0f;

                   System.arraycopy(z,0,z,1,13);

                   z[0] = in ;
                   float sum0 = 0, sum1 = 0;
                   int j;

                   for (j = 0; j < 14; j+= 2) {
                     // optimize: partial loop unrolling
                     sum0 += a[j] * z[j];
                     sum1 += a[j+1] * z[j+1];
                   }
               return sum0+sum1;
               }
               
   }
   
   
   
   
     class IIR1
    {

          float x, y;

          float highpass(float in) {
            // Chebyshev IIR filter, Filter type: HP
            // Passband: 3700 - 4000.0 Hz
            // Passband ripple: 1.5 dB, Order: 1
            final float a0 = 0.105831884f;
            final float a1 = -0.105831884f;
            final float b1 = 0.78833646f;
            float out = a0 * in + a1 * x + b1 * y;
            x = in;
            y = out;
            return out;
          }
   }
   
   
   
   
   
     class IIR2
    {
            float[] x = new float[2];
            float[] y = new float[2];
            float[] a = new float[3];
            float[] b = new float[3];
            
            float highpass(float in) {
              // Butterworth IIR filter, Filter type: HP
              // Passband: 2000 - 4000.0 Hz, Order: 2
               a[0] =  0.29289323f;
               a[1]= -0.58578646f;
               a[2]= 0.29289323f ;
               b[0] =  1.3007072E-16f;
               b[1]= 0.17157288f ;
              float out =
                a[0] * in +
                a[1] * x[0] +
                a[2] * x[1] -
                b[0] * y[0] -
                b[1] * y[1];

              x[1] = x[0];
              x[0] = in;
              y[1] = y[0];
              y[0] = out;
              return out;
            }

    }
   
   
   
   
   
   
   
   
   
   
   
   
}
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:hoomanv
ID: 16641748
not source code.
the command you use to execute
like the one you type in command line

C:\>java helloworld
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16641751
That's not your command - it's your source file. javaw is for running compiled classes
0
 

Author Comment

by:dervisakyuz
ID: 16641867
ok i write in command

c:\>program files>java>jdk1.506>bin>javaw<b.raw>a.raw
0
 
LVL 14

Expert Comment

by:hoomanv
ID: 16641892
javaw<b.raw>a.raw ???

try: java AEC [arguments]
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16641894
>>javaw<b.raw>a.raw

Makes no sense. javaw is to run *class* files in the form of applications

javaw AEC
0
 

Author Comment

by:dervisakyuz
ID: 16641917
yes but i want to give a b.raw file from keyboard and obtain a.raw file?

isnt it possible?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16642211
To redirect a file stream into the program, you'll have to open a stream on System.in

It's more normal in the Java world to give the name of a file and then open a FileStream on it
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16642216
( a FileInputStream rather)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16642256
>>System.err.println("usage: AECTest [ambient in dB] in.raw out.raw\n");

So, as above, you would read from in.raw, as you are doing.You should probably format the usage method thus:


System.err.println("usage: AECTest <ambient in dB> in.raw out.raw\n");

as square brackets denote *optional* parameters
0
 

Author Comment

by:dervisakyuz
ID: 16643407

i write console as you said

could not find the main class
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16643467
Please post exact error - you obviously need to compile it first ;-)
0
 

Author Comment

by:dervisakyuz
ID: 16652621
do u think does tihs code cAN TAKE &#304;NPUT FROM KEYBOARD?

HOW CAN &#304; CHANGE TO DO TH&#304;S?
0
 

Author Comment

by:dervisakyuz
ID: 16652647
do u think does this code  can take  file input from keyboard

if not how can i change it to do this?

i want to read file and after functions do their jobs   it must  create another file.

thanks

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16652650
The code does take three parameters from the keyboard : ambient, input file and output file
0
 

Author Comment

by:dervisakyuz
ID: 16652861
i run it in eclipse and there is no problem but i dont take output

for example after i run in eclipse it writes in the console usage: AECTest [ambient in dB] in.raw out.raw

and after i write dos cmd javaw <b.raw>a.raw

b.raw is 313 kb but a.raw is 1.97kb.

all my functions are ready.i have problem with the reading and writing file i think

please help me i have to finish this for graduate?
0
 

Author Comment

by:dervisakyuz
ID: 16652890
a.raw also must be  313kb
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 16652911
>>javaw <b.raw>a.raw

Is wrong. You need *3* parameters with no redirection

javaw AEC 3.142 a.raw b.raw
0
 

Author Comment

by:dervisakyuz
ID: 16653035
now i try again and if any error i will write here this error.
0
 

Author Comment

by:dervisakyuz
ID: 16653089
after i write suddenly there appears a warning box open itself and the header of it

Java Virtual Machine Launcher

and say :

(X) <--(color is red)

 "Could not find the main class.Program will exit".
Could u try it in your machine?

I do whatever you say.  
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16653301
:-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question