服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 安装配置 > 查看文档

配置j2ee(v1.4.02)和cloudscape(10.0)


  前天只是下载下来并没有配置,今天配置下
  
  首先我们来配置j2ee,去sun公司下载j2sdk,和j2sdkee,其实,我们可以下载那个集成版本的,地址我提取出来了
  
  这个版本集成了它们两个,其中的j2sdk在安装后的j2ee_sdk文件夹(我定义的那个安装目录名字为j2ee_sdk)的jdk\目录。
  
  配置j2ee的环境变量比较简单,我们可以先来设置两个变量,我设置的如下:
  j2ee_home: ...\j2ee_sdk
  j2dk_home:...\j2ee_sdk\jdk
  
  添加path为:%j2ee_home%\bin;:%j2dk_home%\bin;
  
  检查classpath值,没有则新建。先给默认值:“.“; value是:.; 然后添加%j2ee_home%\lib\j2ee.jar;
  
  在开始菜单中启动j2ee,菜单项为start default server, 启动成功后,向地址栏输入: http://localhost:port/index.html 其中的port是你安装时设置的端口号,我设置的为8000, 因为如果有http服务器如iis,它占用80,而如果有tomcat,占用8080,按照惯例,就给他8000吧~
  
  如果出现j2ee画面,说明配置成功。
  
  下面配置cloudscape
  
  其实人家ibm说的很清楚了,下面我摘取一下原文(前天我从网上找的那篇文章说实话已经有点儿落伍了,另外,那个人也不怎么会用环境变量 :-)
  
  using sysinfo
  
  you can use cloudscape’s sysinfo tool to check the versions of cloudscape products. once you have the bin directory in your path, you can run sysinfo by typing the following command in a command window:
  
  sysinfo
  
  the sysinfo script sets the appropriate environment variables, including class path, and executes the sysinfo program.
  
  running ij
  
  you can use the ij tool to connect to a cloudscape database. once you have the bin directory in your path, you can execute the ij command by typing the following:
  
  ij
  
  the ij script sets up environment variables like class path and executes the ij program.
  
  to create a database with ij, type the following command:
  ij> connect ’jdbc:cloudscape:testdb;create=true’;
  
  this command creates the database called testdb in the current directory and populates the system tables. you can then execute any sql statements from the ij command line. when you are ready to leave ij, type:
  
  ij> exit;
  
  see the ibm cloudscape tools and utilities guide for more information on running ij.
  
  --------------------------------------------------------------------------------
  
  manually setting environment variables and paths
  
  if you cannot run the scripts for the cloudscape tools and utilities, you must complete certain steps manually. the following topics show how to manually set your environment and run the tools manually.
  
  the installation program asked you to choose a base directory where the software was installed; we recommended that you name it cloudscape_10. this document refers to that directory as the cloudscape base directory.
  
  if you do not plan to use the scripts in the frameworks/embedded/bin directory and your operating system supports it, create an environment variable called cloudscape_install and set its value to the path of the cloudscape base directory. for example, if you installed the product in c:\cloudscape_10, set cloudscape_install to c:\cloudscape_10:
  
  set cloudscape_install=c:\cloudscape_10
  
  the jvm (compiler or interpreter) needs to know the path (operating system instructions about location) of every class file needed by your application. the class path is a list of the class libraries needed by the jvm and other java applications in order to run your program.
  
  there are two ways to set the class path. you can set the operating system’s classpath environment variable permanently or temporarily. if you set the environment variable temporarily, you must set it each time you open a new command window. alternatively, you can set the class path with the runtime option, which means specifying the class path at the time you start your java application and the jvm.
  
  in most development environments, it works best to set the operating system’s classpath environment variable temporarily. cloudscape provides some scripts to help you set your class path this way; they are found in theframeworks/embedded/bin directory or the frameworks/networkserver/bin directory. run a script every time you open a new command window.
  
  for example, you can set your class path as follows:
  
  set classpath=%cloudscape_install%\lib\cs.jar; %cloudscape_install%\lib\cstools.jar;%classpath%
  
  to manually run the sysinfo utility, type the following in a command window or shell:
  
  java com.ihost.cs.tools.sysinfo
  
  to manually run the ij utility, type the following in a command window or shell:
  
  java com.ihost.cs.tools.ij
  ij> connect 'jdbc:cloudscape:testdb;create=true';
  
  when you are finished running the ij utility, type:
  ij> exit;
  
  看懂了吗?
  其实很简单,他说建议你加一个变量为cloudscape_install, 值为安装目录,我建立的是cloudscape_home, 然后说加入一个path,为%cloudscape_home%\frameworks\embedded\bin这样就可以执行里面的bat文件了,就是sysinfo,ij。然后又加入到classpath中的如下值:lib中的那些jar文件,我就不详细写了。然后就可以运行这些工具了。
  
  先写到这儿我先重启一下。
  
  继续...
  
  设置好了上面的classpath,那么我们就可以做下面的例子了;如果出现class找不到,有可能你的classpath没有设置好,你看一下cmd后中的set命令出来的结果,看与你设置的符合吗? 如果不一样,则你设置不对
  
  output cloudscape 10.0 version information
  
  c:\>java com.ihost.cs.tools.sysinfo------------------ java information ------------------java version:  1.4.2_04java vendor:   sun microsystems inc.java home:    c:\program files\java\j2re1.4.2_04java classpath: .;e:\program files\j2ee_sdk\lib\j2ee.jar;e:\program files\ibm\cloudscape_10.0\lib\cs.jar;e:\program files\ibm\cloudscape_10.0\lib\cstools.jar;e:\program files\ibm\cloudscape_10.0\lib\csnet.jar;e:\program files\j2ee_sdk\jdk\lib\tools.jar;e:\program files\j2ee_sdk\jdk\lib\dt.jar;os name:     windows xpos architecture: x86os version:   5.1java user name: tsuijyjava user home: d:\settingsjava user dir:  c:\--------- cloudscape information --------[e:\program files\ibm\cloudscape_10.0\lib\cs.jar] 10.0.1.0 beta - (29729)[e:\program files\ibm\cloudscape_10.0\lib\cstools.jar] 10.0.1.0 beta - (29729)[e:\program files\ibm\cloudscape_10.0\lib\csnet.jar] 10.0.1.0 beta - (29729)----------------------------------------------------------------------- locale information -----------------------------------------------------------------------
  
  c:\>java com.ihost.cs.tools.ijij version 10.0 (c) 1997, 2004 ibm corp.ij>
  
  used without additional arguments, the -cp option tests for all cloudscape libraries, outputting the libraries it can find as well as the ones it cannot, as shown below:
  
  c:\>java com.ihost.cs.tools.sysinfo -cptesting for presence of all cloudscape-related libraries; typically, only some are needed.for a list of possible arguments, type java com.ihost.cs.tools.sysinfo -cp argsfound in class path:
    cloudscape embedded engine library (cs.jar)
    cloudscape network server library (csnet.jar)
    cloudscape tools library (cstools.jar)
  
  not found in class path:
    cloudscape client libraries (db2jcc.jar)  (com.ibm.db2.jcc.db2driver not found.)
  
  试一试:
  e:\program files\ibm\cloudscape_10.0\demo\programs\simple>java com.ihost.cs.tools.sysinfo -cp simpleapp.classfound in class path:
    user-specified class (simpleapp)
  success: all cloudscape related classes found in class path.
  

扫描关注微信公众号