请问如何使一些例程在jb9编译运行成功?(100分)

  • 主题发起人 主题发起人 yijin
  • 开始时间 开始时间
Y

yijin

Unregistered / Unconfirmed
GUEST, unregistred user!
有一些书本上的例程每个源程序都有一行package com.xxx.yyy.zzz之类的;
请问怎么使这些程序适应jb9?
我在jb9新建一个project,然后加入这些源文件,编译运行有一大堆异常。
 
package com.xxx.yyy.zzz 这是用来定义包名的,
在你新建的工程中用
import com.xxx.yyy.*;
//这句可以把别人定义的包中所有的类加载进来。如Delphi的uses SysUtils;功能一样。当然在使用之前必须保证对方的类已经被编译并加入路径中了。

 
JBuilderX新增了一个功能,从现有代码建立工程文件,能够解决你的问题。
以前的版本比较麻烦一点,新建工程文件,在src目录中按包的层次建立子目录,例如,/src/com/xxx/yyy/zzz
 
我是完全没有自己的文件,那import com.xxx.yyy.*;
应该写在哪呢?
 
将你的异常贴出来些吧。
 
在jb9先new一个project
然后add files,将一些例程加入。
最后make project
错误信息如下:
"ChatClient.java": cannot resolve symbol: class ChatMessage in package rmi at line 11, column 33
"ChatClient.java": cannot resolve symbol: class ChatMessage in interface com.deitel.messenger.rmi.client.ChatClient at line 16, column 32
"ChatServerAdministrator.java": cannot resolve symbol: class StoppableChatServer in class com.deitel.messenger.rmi.server.ChatServerAdministrator at line 60, column 7
"ChatServerAdministrator.java": cannot resolve symbol: class StoppableChatServer in class com.deitel.messenger.rmi.server.ChatServerAdministrator at line 60, column 38
"ChatServerImpl.java": cannot resolve symbol: class StoppableChatServer in class com.deitel.messenger.rmi.server.ChatServerImpl at line 20, column 27
"ChatServerImpl.java": interface expected here at line 20, column 27
"ClientGUI.java": cannot resolve symbol: class MessageManager in class com.deitel.messenger.ClientGUI at line 35, column 4
"ClientGUI.java": cannot resolve symbol: class MessageListener in class com.deitel.messenger.ClientGUI at line 38, column 4
"ClientGUI.java": cannot resolve symbol: class MessageManager in class com.deitel.messenger.ClientGUI at line 41, column 22
"ClientGUI.java": cannot resolve symbol: class MessageListener in class com.deitel.messenger.ClientGUI.MyMessageListener at line 304, column 47
"ClientGUI.java": interface expected here at line 304, column 47
"ClientGUI.java": cannot resolve symbol: class DisconnectListener in class com.deitel.messenger.ClientGUI.DisconnectHandler at line 350, column 47
"ClientGUI.java": interface expected here at line 350, column 47
"DeitelMessenger.java": cannot resolve symbol: class MessageManager in class com.deitel.messenger.rmi.client.DeitelMessenger at line 20, column 7
"DeitelMessenger.java": cannot resolve symbol: class RMIMessageManager in class com.deitel.messenger.rmi.client.DeitelMessenger at line 24, column 31
"DeitelMessenger.java": cannot resolve symbol: class RMIMessageManager in class com.deitel.messenger.rmi.client.DeitelMessenger at line 26, column 31
 
to kehua
我下了个jbx,请问如何在jbx下从现有代码建立工程文件?
 
jbx 在哪儿下?
 
www.borland.com
 
to yijin:
File-New-Project-Project for Existing Code
输入现有代码所在的目录和工程文件名就行了。
 
to kehua:
我用wizzard->import source好象也可以,请问是吗?
 
多人接受答案了。
 
后退
顶部