• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error In the code

 
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


can anybody help me in resolving the error in the bold lines??

AFter compilation "an not found class of these bold lines"
Between lines 14 to 17..
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each of those lines constructs an object and adds it to the tabbed pane. The compiler can't find any of those classes so where are the Sharp, Blurr, Edge etc classes?
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hii Tony

These classes are in the same folder where this Main.java exist..
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried compiling one of those classes eg Sharp.java?
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah,, but they are also not compiling...



here line 66, 71, 76 and 81 have errors .. can't rechognise Main..
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you compiling? Do you use javac from a command line, or use a build tool like Ant or Maven, or use an IDE like IntelliJ or Eclipse. The trick is going to be compiling all source files in the package at once so the compiler can resolve all the cross-references you have. You might also consider refactoring to reduce the cross-references. This could make the program easier to work with in a number of ways.
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have compiled my programm using Javac key word in cmd..
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the exact command that you are typing to compile the source code? And what exactly is the output? (Please copy & paste the command and the output from the compiler).
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[pedantic mode]It is not Javac, but javac. And it is not a keyword. It is a program name.[/pedantic mode]
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah i am soory,, it was a typing mistake .. happens in the foram post only..
 
Greg Charles
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try "javac *.java" instead of "javac Sharp.java". Keep any other compile flags you may be using the same.
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To Jesper de Jong
Here is the copy of cmd where i am trying to run Main.java ..


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\SINGHALS>cd desktop

C:\Users\SINGHALS\Desktop>cd ImageProject

C:\Users\SINGHALS\Desktop\ImageProject>cd ImageProject

C:\Users\SINGHALS\Desktop\ImageProject\ImageProject>javac Main.java
Main.java:14: cannot find symbol
symbol : class Sharp
location: class Main
tabs.addTab("Sharp",new Sharp());
^
Main.java:15: cannot find symbol
symbol : class Blurr
location: class Main
tabs.addTab("Blurr",new Blurr());
^
Main.java:16: cannot find symbol
symbol : class Edge
location: class Main
tabs.addTab("Edge",new Edge());
^
Main.java:17: cannot find symbol
symbol : class AntiAlias
location: class Main
tabs.addTab("AntiAlias",new AntiAlias());
^
Main.java:18: cannot find symbol
symbol : class Epipolar
location: class Main
tabs.addTab("Epipolar",new Epipolar());
^
Main.java:19: cannot find symbol
symbol : class DGFilter
location: class Main
tabs.addTab("Direction Gaussian Filtering",new DGFilter());
^
6 errors

C:\Users\SINGHALS\Desktop\ImageProject\ImageProject>
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which folder are those .java files in? Which folder are you trying to compile from?
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of these files reside in "C:\Users\SINGHALS\Desktop\ImageProject\ImageProject" folder..
and i am trying to compile them in the same folder..
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And none has a package declaration?
I tried your two classes, had to remove the bold tags (don’t put any other tags inside code tags; they don’t work), commented out the addition of Blurr (it should be Blur) etc., and it both compiled and ran for me.
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope none has Package decleration

After changing the blurr --> blur
Still unable to compile the Main.java file..
got the same 6 errors
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I commented out the lines with the classes in which you didn’t supply (Blur, Edge, etc), I was able to compile and run it. Where are the Blur, Edge, etc, .java and .class files?
 
Greenhorn
Posts: 21
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friend,
I think you should compile all the source file at once by following command

javac file1.java file2.java
or using
javac *.java

then run Main Class



 
Ranch Hand
Posts: 1164
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please share the source of the dependent files ( Blurr, AntiAlias, EpiPolar) which the compiler is unable to resolve.
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No don't post the rest of the files they are not necessary.

You've probably set the CLASSPATH env variable and not included the current directory. Try the following
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah Toni..
Thanks finally compiled..

That is My Environment variables are not perfect..
Thanks
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks finally compiled..


My pleasure

That is My Environment variables are not perfect..


Looks that way. I suggest you append a ";." to the CLASSPATH environment variable value.
 
reply
    Bookmark Topic Watch Topic
  • New Topic