从终端运行Java程序 [英] Running java program from terminal
本文介绍了从终端运行Java程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个在树莓派上运行的Java程序,但无法在终端上运行它.
I'm developing a java program to run on the raspberry pi and I can't get it to run using terminal.
它由两个类组成,两个类都位于:
It consists of two classes both of which are located at:
/home/pi/JBerries/Access control/bin/access/control
还请注意,这是使用swing创建的GUI程序.
Also note it is a GUI program made using swing.
这是我目前正在尝试运行的命令:
This is the command I'm using to try and run it currently:
pi@raspberrypi ~/JBerries/Access control $ java -classpath .bin.access.control.accessControlUI
这就是它喷出的东西:
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
这是否表明我的程序已准备好运行并且仅需要包含某种启动选项?任何帮助将不胜感激.
Is this a sign that my program is ready to run and I just need to include some sort of launch option? Any help would be much appreciated.
推荐答案
尝试
java -classpath . bin.access.control.accessControlUI
注意之间的空格".和垃圾箱
Notice the "space" between . and bin
这篇关于从终端运行Java程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文