Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2350929
  • 博文数量: 321
  • 博客积分: 3440
  • 博客等级: 中校
  • 技术积分: 2992
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-24 09:08
个人简介

我就在这里

文章分类

全部博文(321)

文章存档

2015年(9)

2014年(84)

2013年(101)

2012年(25)

2011年(29)

2010年(21)

2009年(6)

2008年(23)

2007年(23)

分类: Java

2014-12-18 16:01:26

1. JBOSS的安装和运行

a. 安装JDK,设定环境变量JAVA_HOME=java安装目录”,比如JDK安装在D:\jdk16u10,那么就可以JAVA_HOME=D:\jdk16u10

b. 下载最新的jboss版本,比如jboss-5.0.0.GA-jdk6.zip,解压到一个目录,比如D:\JBoss500,然后设定环境变量JBOSS_HOME=D:\JBoss500。在命令行窗口运行bin目录下的run.bat即启动了jboss应用服务器。如果要停止jboss服务器,则另开一个命令窗口,运行bin目录下的shutdown.bat并带-S参数即可,即shutdown –S

c. 每次从控制台启动JBoss不是很方便,虽然调试程序时可以从控制台看到很多信息,但有的时候需要JBoss作为系统服务自动运行。这需要下载一个小工具JavaService.exe,到如下地址下载:

 

2. MyEclipse的安装

a. 上下载最新的版本的eclipse开发工具包,如eclipse-SDK-3.4.1-win32.zip,将其解压到指定目录,如D:\Eclipse即可。

b. 下载最新MyEclipse开发工具包,如MyEclipse_7.0M1_E3.4.0_Installer.exe,双击运行之并根据提示,提供相关的信息即可。MyEclipse安装完成后,会将步骤a中的Eclipse全部复制到MyEclipse的安装目录下,并在其中增加了很多有用的插件。

c. 以后就可以使用MyEclipse来开发了。但是由于MyEclipse是一个需要付费的插件集合,只可以免费使用30天。下面是破解程序:

  1. import java.io.BufferedReader;

  2. import java.io.IOException;

  3. import java.io.InputStreamReader;

  4.  

  5. public class MyEclipseCracker

  6. {

  7.      private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";

  8.  

  9.      public String getSerial(String userId, String licenseNum)

  10.      {

  11.         java.util.Calendar cal = java.util.Calendar.getInstance();

  12.         cal.add(1, 3);

  13.         cal.add(6, -1);

  14.         java.text.NumberFormat nf = new java.text.DecimalFormat("000");

  15.         licenseNum = nf.format(Integer.valueOf(licenseNum));

  16.         String verTime = new StringBuilder("-").append(

  17.           new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))

  18.           .append("0").toString();

  19.         String type = "YE3MP-";

  20.         String need = new StringBuilder(userId.substring(0, 1)).append(type)

  21.           .append("300").append(licenseNum).append(verTime).toString();

  22.         String dx = new StringBuilder(need).append(LL).append(userId)

  23.           .toString();

  24.         int suf = this.decode(dx);

  25.         String code = new StringBuilder(need).append(String.valueOf(suf))

  26.           .toString();

  27.         return this.change(code);

  28.      }

  29.  

  30.      private int decode(String s)

  31.      {

  32.                int i;

  33.                char[] ac;

  34.                int j;

  35.                int k;

  36.                i = 0;

  37.                ac = s.toCharArray();

  38.                j = 0;

  39.                k = ac.length;

  40.                while (j < k)

  41.                {

  42.                         i = (31 * i) + ac[j];

  43.                         j++;

  44.                }

  45.                return Math.abs(i);

  46.      }

  47.  

  48.      private String change(String s)

  49.      {

  50.                byte[] abyte0;

  51.                char[] ac;

  52.                int i;

  53.                int k;

  54.                int j;

  55.                abyte0 = s.getBytes();

  56.                ac = new char[s.length()];

  57.                i = 0;

  58.                k = abyte0.length;

  59.                while (i < k)

  60.                {

  61.                         j = abyte0[i];

  62.                         if ((j >= 48) && (j <= 57))

  63.                         {

  64.                                  j = (((j - 48) + 5) % 10) + 48;

  65.                         }

  66.                         else if ((j >= 65) && (j <= 90))

  67.                         {

  68.                                  j = (((j - 65) + 13) % 26) + 65;

  69.                         }

  70.                         else if ((j >= 97) && (j <= 122))

  71.                         {

  72.                                  j = (((j - 97) + 13) % 26) + 97;

  73.                         }

  74.                         ac[i] = (char) j;

  75.                         i++;

  76.         }

  77.         return String.valueOf(ac);

  78.      }

  79.  

  80.      public MyEclipseCracker()

  81.      {

  82.                super();

  83.      }

  84.  

  85.      public static void main(String[] args)

  86.      {

  87.                try

  88.                {

  89.                    System.out.println("please input register name:");

  90.                    BufferedReader reader = new BufferedReader(new InputStreamReader(

  91.                      System.in));

  92.                    String userId = null;

  93.                    userId = reader.readLine();

  94.                    MyEclipseCracker myeclipsegen = new MyEclipseCracker();

  95.                    String res = myeclipsegen.getSerial(userId, "5");

  96.                    System.out.println("Serial:" + res);

  97.                    reader.readLine();

  98.                }

  99.                catch(IOException ex)

  100.                {

  101.                }

  102.      }

  103. }


  1. import java.io.BufferedReader;

  2. import java.io.IOException;

  3. import java.io.InputStreamReader;

  4.  

  5. public class MyEclipseCracker

  6. {

  7.      private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";

  8.  

  9.      public String getSerial(String userId, String licenseNum)

  10.      {

  11.         java.util.Calendar cal = java.util.Calendar.getInstance();

  12.         cal.add(1, 3);

  13.         cal.add(6, -1);

  14.         java.text.NumberFormat nf = new java.text.DecimalFormat("000");

  15.         licenseNum = nf.format(Integer.valueOf(licenseNum));

  16.         String verTime = new StringBuilder("-").append(

  17.           new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))

  18.           .append("0").toString();

  19.         String type = "YE3MP-";

  20.         String need = new StringBuilder(userId.substring(0, 1)).append(type)

  21.           .append("300").append(licenseNum).append(verTime).toString();

  22.         String dx = new StringBuilder(need).append(LL).append(userId)

  23.           .toString();

  24.         int suf = this.decode(dx);

  25.         String code = new StringBuilder(need).append(String.valueOf(suf))

  26.           .toString();

  27.         return this.change(code);

  28.      }

  29.  

  30.      private int decode(String s)

  31.      {

  32.                int i;

  33.                char[] ac;

  34.                int j;

  35.                int k;

  36.                i = 0;

  37.                ac = s.toCharArray();

  38.                j = 0;

  39.                k = ac.length;

  40.                while (j < k)

  41.                {

  42.                         i = (31 * i) + ac[j];

  43.                         j++;

  44.                }

  45.                return Math.abs(i);

  46.      }

  47.  

  48.      private String change(String s)

  49.      {

  50.                byte[] abyte0;

  51.                char[] ac;

  52.                int i;

  53.                int k;

  54.                int j;

  55.                abyte0 = s.getBytes();

  56.                ac = new char[s.length()];

  57.                i = 0;

  58.                k = abyte0.length;

  59.                while (i < k)

  60.                {

  61.                         j = abyte0[i];

  62.                         if ((j >= 48) && (j <= 57))

  63.                         {

  64.                                  j = (((j - 48) + 5) % 10) + 48;

  65.                         }

  66.                         else if ((j >= 65) && (j <= 90))

  67.                         {

  68.                                  j = (((j - 65) + 13) % 26) + 65;

  69.                         }

  70.                         else if ((j >= 97) && (j <= 122))

  71.                         {

  72.                                  j = (((j - 97) + 13) % 26) + 97;

  73.                         }

  74.                         ac[i] = (char) j;

  75.                         i++;

  76.         }

  77.         return String.valueOf(ac);

  78.      }

  79.  

  80.      public MyEclipseCracker()

  81.      {

  82.                super();

  83.      }

  84.  

  85.      public static void main(String[] args)

  86.      {

  87.                try

  88.                {

  89.                    System.out.println("please input register name:");

  90.                    BufferedReader reader = new BufferedReader(new InputStreamReader(

  91.                      System.in));

  92.                    String userId = null;

  93.                    userId = reader.readLine();

  94.                    MyEclipseCracker myeclipsegen = new MyEclipseCracker();

  95.                    String res = myeclipsegen.getSerial(userId, "5");

  96.                    System.out.println("Serial:" + res);

  97.                    reader.readLine();

  98.                }

  99.                catch(IOException ex)

  100.                {

  101.                }

  102.      }

  103. }
编译后运行如下:

  java MyEclipseCracker

  please input register name:

  patrick

  Serial:cLR8ZC-855550-6667535811095549


1

  MyEclipse要求提供注册名和注册序列号时,就分别填写

patrick

cLR8ZC-855550-6667535811095549即可。注意字符串常量LL不可做任何更改,否则生成的序列号无效

  这种办法可以让MyEclipse的使用时间变成3年。

 

3. JBOSS的启动/停止改由Eclipse来控制

   a. 启动MyEclipse,进行如下操作:


2

选定JBoss


3

Server name的含义,在%JBOSS_HOME%\server目录下,有一个目录叫做default。缺省地我们开发好的ejb就会被发布在这个目录里面。可以修改Server name,比如新输入一个目录名称EJBServer,当我们点击上图的OK按钮后,就会在%JBOSS_HOME%\server目录下产生一个名为EJBServer的新目录,这样我们再发布新的ejb时,就会被发布在EJBServer这个新的目录里。

 

下图是修改服务器所使用的JRE


4

Java运行环境JDK6的定义如下:

5

在上图中可以选中Add按钮增加新的JRE配置,也可以选中已有的一个JRE进行编辑。上图带钩的选项就是在MyEclipse中新建Java项目所使用的JREMyEclipse7MMyEclipse自带的JRE(版本号为1.5.0_11-b03),缺省就在开发环境中存在。下面我们选中JDK6(版本号为1.6.0_10-b33)进行编辑:


6

在上图中,JRE home就是JAVA_HOMEJRE name可以自己取,比如JDK6Default VM Arguments用来设定JVM运行时需要的参数,但一般我们不在此处做设置,而在如图4类似的地方做设置。

 

4. 安装Tomcat,并将Tomcat的启动和停止改由MyEclipse控制

a. 上下载最新的tomcat压缩包apache-tomcat-6.0.18.zip,将其解压到指定目录即可,如:D:\Tomcat6

   b. MyEclipse上选中菜单Windows->Preferance,并进行如下配置即可。


7

5. MyEclipse中启动jbosstomcat


8

我们在上图可以看到已经配好的JBoss5.xTomcat 6.x服务器,MyEclipse TomcatMyEclipse中自带的。如果我们不需要,可以在如下图的界面将它们关闭:


9

点击OK按钮后得到:


10

注意:MyEclipse Derby用此法清除不了。

 

现在我们可以通过(debug模式)或者(run模式,即生产模式)来启动或停止选定的服务器了。如果用debug模式启动,则会在Console中输出相应的信息。

转自:http://patmusing.blog.163.com/blog/static/13583496020100151555472/

阅读(1084) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~