• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java program for retrieving results from LDAP  RSS feed

 
Kerin Kapoor
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to run the following java program by using the instructions provided here http://www.developerscrappad.com/1109/windows/active-directory/java-ldap-jndi-2-ways-of-decoding-and-using-the-objectguid-from-windows-active-directory/
The program tries to connect to LDAP directory, searches for an objectGUID and returns sAMAccountName

But when I compile the java program I get 19 errors as given below. Any pointers will be helpful as this is my second java program..

/a1/utils/seek.java:2: cannot find symbol
symbol : class string
location : class seek
public static void main (string[] args) {
^
/a1/utils/seek.java:4: cannot find symbol
symbol : class hashtable
location : class seek
public static void main (string[] args) {
^

and similar errors on line 5,6,7,10,11,12,16,24,24,25,28,28,31,32,34,48

The program is given below -

 
Ron McLeod
Bartender
Posts: 1602
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this line: public static void main(string[] args)

Also, you should change the class name to Seek rather than seek.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody else had problems with tiny spelling errors.
 
Kerin Kapoor
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please explain a little more by what you would like me to change in the line



Do you want me to use @Override before the main function?

Thanks in Advance!
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to have just started learning Java.
It would be good to start with a small program like Hello World.
 
Kerin Kapoor
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Surendra, You are right..

This is my 2nd program and Hello World was first..

So any other tips will be helpful..

Thank you.
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compare the main method's signature of Hello World example and your program and you would know the difference.
Clue: problem is with the case of "string[]".
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kerin Kapoor wrote: . . . Do you want me to use @Override before the main function? . . .
No, you cannot override static methods, so @Override will not work. Look for tInY SpElLiNg ErRoRs. The correct format for the main method is to be found here, so you can check that (or even use copy‑and‑paste ‍).

The main method is not a function, since it doesn't return anything.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way: why are you using Hashtable, which is usually regarded as legacy code. Use HashMap instead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!