类路径为空.请先建立专案,例如通过运行'./gradlew jar -PscalaVersion = 2.11.12' [英] Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12'

查看:375
本文介绍了类路径为空.请先建立专案,例如通过运行'./gradlew jar -PscalaVersion = 2.11.12'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于尝试启动Zookeeper实例时失败,我无法运行Apache Kafka服务.我已经在官方网站上下载并尝试了全部3个可用下载. (二进制文件和源代码)当我尝试使用

I am not able to run a Apache Kafka service due to a failure while trying to start a Zookeeper instance. I have downloaded and tried it with all 3 availabe downloads at the official site. (binarys and source) When i try to start zookeeper with

./bin/zookeeper-server-start.sh config/zookeeper.properties

我总是收到相同的错误消息:

I always get the same error message:

Classpath为空.请先建立专案,例如通过运行 './gradlew jar -PscalaVersion = 2.11.12'

Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12'

(启动一个单独的zookeeper(不是kakfa的内置对象)实例之后)也是如此

The same goes for (after starting a seperate zookeeper (not the build-in from kakfa) instance)

./bin/kafka-server-start.sh config/server.properties

我已经在Ubuntu 17.04和18.04下进行了尝试.当我在使用Ubuntu 16.04的虚拟机上尝试此方法时,它会起作用.

I have tried it under Ubuntu 17.04 and 18.04. When i try this on a virtual machine using Ubuntu 16.04 it works.

不幸的是,我发现的所有有关Windows的问题. 谢谢您的帮助.

Unfortunatly, all i found regarding this problem, was for Windows. Thank you for any help.

推荐答案

在我的情况下,它与二进制文件或源文件无关,因为它们都给出相同的类路径为空,请先构建项目"错误.这是因为kafka所在的路径上有一个空间.

In my case it has nothing to do with the binary or source cause both of them give that same "classpath is empty please build the project first" error. Its because there is a space in the path where kafka resides.

这篇关于类路径为空.请先建立专案,例如通过运行'./gradlew jar -PscalaVersion = 2.11.12'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆