Classpath在linux下不起作用 [英] Classpath does not work under linux

查看:1010
本文介绍了Classpath在linux下不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道为什么这个命令在Windows中正常工作但在Linux中我得到一个ClassNotFoundException game.ui.Main

Anyone have an idea why this command works fine in Windows but in Linux I get a ClassNotFoundException game.ui.Main

java -cp ".;lib/*" game.ui.Main -Xms64m -Xmx128m

我的文件夹结构如下所示:
lib / - Jars
游戏/ - 类文件

my folder structure looks like this: lib/ - Jars game/ - Class files

这是最新的Java 6。

This is the latest Java 6.

推荐答案

类路径语法与操作系统有关。来自维基百科

The classpath syntax is OS-dependent. From Wikipedia :


与文件
系统密切相关,命令行Classpath
语法取决于运行
系统。例如:

Being closely associated with the file system, the command-line Classpath syntax depends on the operating system. For example:

在所有类Unix操作系统
(例如Linux和Mac OS X)上,
目录结构具有Unix语法,
,单独的文件路径由
a冒号(:)分隔。

on all Unix-like operating systems (such as Linux and Mac OS X), the directory structure has a Unix syntax, with separate file paths separated by a colon (":").

在Windows上,目录结构
有一个Windows语法,每个文件
路径必须用分号
(;)分隔。

on Windows, the directory structure has a Windows syntax, and each file path must be separated by a semicolon (";").

这在Classpath $ b时不适用$ b在清单文件中定义,其中
每个文件路径必须用
空格()分隔,而不管
操作系统。

This does not apply when the Classpath is defined in manifest files, where each file path must be separated by a space (" "), regardless of the operating system.

这篇关于Classpath在linux下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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