Question: When I try to compile 'AddInts.java' script on 'terminal'window, it shows an error like the below picture 1. It says 'cannot find symbol'. I added

When I try to compile 'AddInts.java' script on 'terminal'window, it shows an error like the below picture 1.

It says 'cannot find symbol'. I added the 'StdIn, StdOut' filein a same directory, and I also added 'stdlib.jar' in ExternalLibraries. But it didn't work. How do I solve this problem?

When I compile and execute the same script not on 'terminal' butin IntelliJ(ctrl + B, ctr + E), it is complied and executed welllike picture 2, 3. 

Find symbol error

picture1IJ File Edit View Code Build Run LIFT Help Lecture4 - Addints.java

picture2- IntelliJ IDEA TestStdOut.java Structure Project Lecture4 C:\Users\moon\IdeaProjects\Lecture4 .idea src Addints Stdln

picture3

StdOut TestStdOut StdOut.class Input and Output.pdf Lecture4.iml III External Libraries Terminal: Terminal

IJ File Edit View Code Build Run LIFT Help Lecture4 - Addints.java - IntelliJ IDEA TestStdOut.java Structure Project Lecture4 C:\Users\moon\IdeaProjects\Lecture4 .idea src Addints Stdln StdOut TestStdOut StdOut.class Input and Output.pdf Lecture4.iml III External Libraries Terminal: Terminal 12 errors = O A symbol: variable StdIn location: class AddInts symbol: variable StdOut location: class AddInts 2 errors 1 2 3 ~/IdeaProjects/Lecture4/src> TODO Run = Messages SpotBugs Build completed successfully in 696 ms (2 minutes ago) 4 5 6 7 8 9 10 11 12 ~/IdeaProjects/Lecture4/src> javac AddInts.java AddInts.java:6: error: cannot find symbol int value = StdIn.readInt(); Terminal AddInts.java:9: error: cannot find symbol Stdout.println("Sum is " + sum); 1 StdOut.class Addints.java public class AddInts { } s CheckStyle } Lecture4.iml public static void main(String[] args) { int n = Integer.parseInt(args[0]); int sum = 0; Stdln.java } StdOut.java for (int i = 0; i

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The reason you are getting that error on terminal is that StdInjava and StdOutjava ar... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!