5
votes

After multiple re-tries and changing the bat files, I have finally succeeded in running Kafka and Zookeeper in Windows 7. This is a 32-bit machine running Java 7. Unfortunately though, I am not able to create a topic. I tried using the tutorial here: http://janschulte.wordpress.com/2013/10/13/apache-kafka-0-8-on-windows/

I executed the command:

C:\Cambria\kafka_2.8.0-0.8.0>bin\kafka-create-topic.bat --zookeeper localhost:2181 --replica 1 --partition 1 --topic topic

and end up with the following error:

Exception in thread "main" joptsimple.UnrecognizedOptionException: 'û' is not a recognized option
    at joptsimple.OptionException.unrecognizedOption(OptionException.java:89)
    at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:586)
    at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:511)
    at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:506)
    at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
    at joptsimple.OptionParser.parse(OptionParser.java:433)
    at kafka.admin.CreateTopicCommand$.main(CreateTopicCommand.scala:56)
    at kafka.admin.CreateTopicCommand.main(CreateTopicCommand.scala)

All the classpath entries are proper and the requisite JAR files are also present. Am not sure what the issue is. Can someone help me on this?

P.S: I tried this with Cygwin and am encountering the Class Not Found error although the classpath is being properly set.

2
Pretty sure you're running into this issue: [Hyphen converted to u][1] [1]: stackoverflow.com/questions/19663395/…David Corley
Yes, I found that out a later point. It has been resolved now. Thanks for the help.Aparajith

2 Answers

34
votes

For people who just started to play with kafka and encountered this problem (but on Unix machine), this is due to the outdated tutorial you are following.

In the latest version, you have to use

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

to create topic.

2
votes

run bin\kafka-create-topic.bat to see available options then for example you will see broker-list and all required parameters.