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
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

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

Post

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

History
Why does this post require attention from curators or moderators?
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)
Confused about whether you have the .jar file or not. If you don't, see Moshi's comment. If you do,...
mcalex‭ wrote about 3 years ago

Confused about whether you have the .jar file or not. If you don't, see Moshi's comment. If you do, in the project list, right-click libraries, select Add, then navigate to the jar file.