File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes ERROR in double displacement = StdRandom.gaussian(0, stddev); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "ERROR in double displacement = StdRandom.gaussian(0, stddev);" Watch "ERROR in double displacement = StdRandom.gaussian(0, stddev);" New topic

ERROR in double displacement = StdRandom.gaussian(0, stddev);

Morten Gulbrandsen

Joined: Jun 20, 2007
Posts: 9

I have

uname -a
Linux Westparkstr42 2.6.18-4-486 #1 Wed May 9 22:23:40 UTC 2007 i686 GNU/Linux

I can compile hello world like this

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello, World");

morten@Westparkstr42:~$ javac -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 2006. All rights reserved.
morten@Westparkstr42:~$ javac
morten@Westparkstr42:~$ java HelloWorld
Hello, World

Then I face a problem

here I found something interesting

woun't do

1. ERROR in (at line 35)
double displacement = StdRandom.gaussian(0, stddev);
StdRandom cannot be resolved
2. ERROR in (at line 40)
StdDraw cannot be resolved
3. ERROR in (at line 41)
StdDraw.filledSquare(x, y, size);
StdDraw cannot be resolved
4. WARNING in (at line 57)
int SIZE = Integer.parseInt(args[0]);
The local variable SIZE is never read
4 problems (3 errors, 1 warning)morten@Westparkstr42:~$

morten@Westparkstr42:~$ java Factorial 10

I haven't tried all, Factorial works and the html code looks identical to the ascii code.

but something can be specific to my eclipse java compiler.

i did search for the first error

StdRandom had here no matches.

Best regards from a java newcomer.


I am an Instance of a Class
marc weber

Joined: Aug 31, 2004
Posts: 11343

In the comments of, it says, "Dependencies:" This means that PlasmaCloud uses elements in the file, and your compiler is complaining that it can't find these things. Although not listed as a dependency, is also needed.

Add and to your directory containing, re-compile, and you should be okay.

(Another error in the comments is "Execution: java Plasma N". But execution should be java PlasmaCloud N, where N is some int.)
[ June 29, 2007: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Morten Gulbrandsen

Joined: Jun 20, 2007
Posts: 9
Hi, Thanks, it still woun't compile.

1. ERROR in (at line 111)
private static LinkedList<Character> keysTyped = new LinkedList<Character>();

morten@Westparkstr42:~/Robert_Sedgewick$ ls -l
total 36
-rw-r--r-- 1 morten morten 2472 2007-06-29 20:32
-rw-r--r-- 1 morten morten 29769 2007-06-29 20:27
marc weber

Joined: Aug 31, 2004
Posts: 11343

Note your compiler warnings: "...parameterized types are only available if source level is 5.0."

You need to change a preference in Eclipse so that it compiles with at least version 5.0 (which is the same as 1.5). This will allow the use of "generics," which appears to be what's preventing this from compiling.

See Eclipse documentation:
  • Java Compiler page
  • Java Compiler preferences
  • Morten Gulbrandsen

    Joined: Jun 20, 2007
    Posts: 9
    1) javac warning level 2) ant makefile

    I thank you eternally for the fast reply.
    That was even as fast as IRC.

    1) javac warning level
    I have decided to only use emacs and compile as manually as possible.

    I'd like to increase the warning level.

    with gcc I would type g++ -ansi -pedantic -wall -strict_ansi or whatever.

    I now run solaris 10 developer edition and prefer bash.

    bash-3.00$ uname -a
    SunOS solaris-devx 5.11 snv_64a i86pc i386 i86pc

    man javac
    No manual entry for javac.

    I have no java manpage.

    man cc and man CC gives me immediately the appropriate manpage for C and C++ compiler.

    man java
    No manual entry for java.

    is this correct?


    I did change my $PATH settings, after consulting with experts.

    echo $MANPATH

    echo $PATH

    which java

    which javac

    java -version
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

    javac -version
    javac 1.6.0

    That works all fine,
    without any manpage.

    man ant
    No manual entry for ant.

    man make gives me the usual make manpage.

    That stuff with classpath I never understood, do I need to know that?

    2) ant makefile

    When I program in C C++ I use make gmake or dmake.

    Suppose I want to use the emacs for a while,
    isn't ant the appropriate make file for java?

    How do I write a simple ant makefile for a tiny helloworld program?


    the examples from Sedgewicks homepage works fine.
    As you suggested, with the correct compiler.

    ls *.java
    I agree. Here's the link:
    subject: ERROR in double displacement = StdRandom.gaussian(0, stddev);
    It's not a secret anymore!