我认为问题与Java 版本有关,因为 SmartFoxServer 不支持JRE 8。因此,为避免该问题,您可以下载并安装JRE 6或JRE 7,然后打开文件SmartFoxServerBASIC_1.5.5\Server\start.bat
并像这样编辑它(我们将仅更改 java 路径):
@"path_of_jre\bin\java.exe" -cp "./;/;./lib/nanoxml-2.2.1.jar;./lib/js.jar;./lib/jython.jar;./lib/commons-pool-1.2.jar;./lib/commons-dbcp-1.2.1.jar;./lib/commons-collections-3.1.jar;./lib/activation.jar;./lib/javamail/smtp.jar;./lib/javamail/mailapi.jar;./lib/jetty/jetty.jar;./lib/jetty/jetty-util.jar;./lib/jetty/servlet-api-2.5.jar;./lib/jetty/multipartrequest.jar;./lib/json.jar;./lib/xbean.jar;./lib/jsr173_1.0_api.jar;./lib/concurrent.jar;./lib/jysfs.jar;" -Dfile.encoding=UTF-8 -Djava.util.logging.config.file=logging.properties it.gotoandplay.smartfoxserver.SmartFoxServer
@pause
path_of_jre
是您的 JRE 目录的路径,例如:C:\Program Files\Java\jre7
.
看看我使用三个版本的 Java 进行的测试:1.8、1.7 和 1.6:
Java 1.8.0 版:
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
|------------------------------------------------------------|
| SmartFoxServer |
| Multiplayer Socket Server |
| version 1.5.5 |
| --- |
| (c) 2004 - 2007 gotoAndPlay() |
| www.smartfoxserver.com |
| www.gotoandplay.it |
|------------------------------------------------------------|
java.nio.file.InvalidPathException: Illegal char <:> at index 2: \C:\Users\zo\Sm
artFoxServerBASIC_1.5.5\Server\logs\smartfox_log_0.txt.lck
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at java.util.logging.FileHandler.openFiles(FileHandler.java:438)
at java.util.logging.FileHandler.<init>(FileHandler.java:354)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initLogger(SmartFoxServe
r.java:495)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
585)
FATAL ERROR: Could not create log files.
Shutting down server...
Java 版本 1.7.0_65 :
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
|------------------------------------------------------------|
| SmartFoxServer |
| Multiplayer Socket Server |
| version 1.5.5 |
| --- |
| (c) 2004 - 2007 gotoAndPlay() |
| www.smartfoxserver.com |
| www.gotoandplay.it |
|------------------------------------------------------------|
--- [ System Info ] ------------------------------------------
System CPU(s): 4
VM Max memory: 1431 MB
os.name: Windows 7
os.arch: amd64
os.version: 6.1
java.version: 1.7.0_65
java.vendor: Oracle Corporation
java.vendor.url: http://java.oracle.com/
java.vm.specification.version: 1.7
java.vm.version: 24.65-b04
java.vm.vendor: Oracle Corporation
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
--- [ Network Cards ] -----------------------------------------
...
--- [ Licence Loaded ] ------------------------------------
Licence Type: BASIC
Licenced to : --== Free Demo License ==--
Max. Clients: 20
--- [ Zones & Rooms ] -------------------------------------
...
--- [ Server Starting ] ---------------------------------
Server address: 127.0.0.1
Server port : 9339
22:05:39.295 - [ INFO ] > [EventWriter] ..... started :: 1 thread(s)
22:05:39.320 - [ INFO ] > [SystemHandler] ... started :: 1 thread(s)
22:05:39.321 - [ INFO ] > [ExtensionHandler]. started :: 1 thread(s)
22:05:39.321 - [ INFO ] > [DeadChannelsPolicy: strict]
22:05:39.322 - [ INFO ] > Server is up and running!
Java 版本 1.6.0_45 :
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
|------------------------------------------------------------|
| SmartFoxServer |
| Multiplayer Socket Server |
| version 1.5.5 |
| --- |
| (c) 2004 - 2007 gotoAndPlay() |
| www.smartfoxserver.com |
| www.gotoandplay.it |
|------------------------------------------------------------|
--- [ System Info ] ------------------------------------------
System CPU(s): 4
VM Max memory: 1431 MB
os.name: Windows 7
os.arch: amd64
os.version: 6.1
java.version: 1.6.0_45
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 20.45-b01
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
--- [ Network Cards ] -----------------------------------------
...
--- [ Licence Loaded ] ------------------------------------
Licence Type: BASIC
Licenced to : --== Free Demo License ==--
Max. Clients: 20
--- [ Zones & Rooms ] -------------------------------------
...
--- [ Server Starting ] ---------------------------------
Server address: 127.0.0.1
Server port : 9339
22:09:07.578 - [ INFO ] > [EventWriter] ..... started :: 1 thread(s)
22:09:07.593 - [ INFO ] > [SystemHandler] ... started :: 1 thread(s)
22:09:07.594 - [ INFO ] > [ExtensionHandler]. started :: 1 thread(s)
22:09:07.594 - [ INFO ] > [DeadChannelsPolicy: strict]
22:09:07.594 - [ INFO ] > Server is up and running!
希望所有这些都可以帮助你。