Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

Why I am unable to find a class after implementing library also?

+0
−5

I had found a better way to plot in Java.

        int n = Integer.parseInt(args[0]);

        // the function y = sin(4x) + sin(20x), sampled at n+1 points
        // between x = 0 and x = pi
        double[] x = new double[n+1];
        double[] y = new double[n+1];
        for (int i = 0; i <= n; i++) {
            x[i] = Math.PI * i / n;
            y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
        }

        // rescale the coordinate system
        StdDraw.setXscale(0, Math.PI);
        StdDraw.setYscale(-2.1, +2.1);

        // plot the approximation to the function
        for (int i = 0; i < n; i++) {
            StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
        }

I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use

import StdDraw;
//or
import stddraw.StdDraw;
//or
import StdDraw.*;

None of them are helpful cause I don't have the StdDraw package. I had found it then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found it to import the package. But the problem is I can't download the package at first.

No Project Structure

What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called /lib. I know that I have to put a line in gradle.build

implementation 'file_name'

But I don't have any idea where I should put that jar file. I have created a folder called libs and pasted that jar file there. Then added the line to gradle.build

implementation fileTree(dir: 'libs', include: ['*.jar'])

I have re-sync my project. Although I can't find that StdDraw class. I have tried to import that class manually..

import stdlib.StdDraw;

But stdlib doesn't exist. That's what I am getting as error. ~ I was following the answer

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

Confused about whether you have the .jar file or not. If you don't, see Moshi's comment. If you do,... (1 comment)
The jar file is linked (1 comment)

0 answers

Sign up to answer this question »