关于myeclipse subscribtion expired问题

来源:互联网 发布:java基础入门 编辑:程序博客网 时间:2024/05/29 04:27

去年安装了myeclipse8.5,也不知道上次注册多长时间了,近几天不能用了,注册码过期了,经常会弹出如下的提示对话框:


从网上搜了很多注册码都不成功,今天看到一篇文章,自己获取注册码。

步骤:

1.myeclipse中新建一个java project 

2.src目录下建立一个名为MyEclipseGen的类

3.将下面的代码复制到该类中,并运行。

1.  import java.io.*;     

2.      

3.  public class MyEclipseGen     

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

5.      

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

7.          java.util.Calendar cal java.util.Calendar.getInstance();     

8.          cal.add(1, 3);     

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

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

11.                      licenseNum nf.format(Integer.valueOf(licenseNum));     

12.                       String verTime new StringBuilder("-").append(     

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

14.                              .append("0").toString();                         String type "YE3MP-"    

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

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

17.                     String dx new StringBuilder(need).append(LL).append(userId)     

18.                             .toString();     

19.                      int suf this.decode(dx);     

20.                      String code new StringBuilder(need).append(String.valueOf(suf))     

21.                              .toString();     

22.                       return this.change(code);                                      

23.                   private int decode(String s)     

24.                       int i;     

25.                       char[] ac;     

26.                       int j;     

27.                       int k;     

28.                        i 0    

29.                       ac s.toCharArray();     

30.                       j 0    

31.                       k ac.length;     

32.                       while (j < k    

33.                           i (31 i) ac[j];     

34.                           j++;                             

35.                       return Math.abs(i);     

36.                                      

37.                   private String change(String s)     

38.                       byte[] abyte0;                        

39.                       char[] ac;     

40.                       int i;     

41.                       int k;     

42.                       int j;     

43.                       abyte0 s.getBytes();     

44.                       ac new char[s.length()];     

45.                       i 0    

46.                      k abyte0.length;     

47.                       while (i < k    

48.                           j abyte0[i];     

49.                           if ((j >48) && (j <57))     

50.                               j (((j 48) 5) 10) 48;     

51.                          else if ((j >65) && (j <90))     

52.                               j (((j 65) 13) 26) 65;     

53.                           else if ((j >97) && (j <122))     

54.                               j (((j 97) 13) 26) 97;     

55.                               

56.                           ac[i] (char) j;     

57.                           i++;     

58.                           

59.                       return String.valueOf(ac);     

60.                                      

61.                   public MyEclipseGen()     

62.                 super();     

63.                       

64.                   

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

66.                       try     

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

68.                           BufferedReader reader new BufferedReader(new InputStreamReader(     

69.                                   System.in));     

70.                           String userId null    

71.                           userId reader.readLine();     

72.                           MyEclipseGen myeclipsegen new MyEclipseGen();     

73.                           String res myeclipsegen.getSerial(userId, "20");     

74.                           System.out.println("Serial:" res);     

75.                           reader.readLine();     

76.                      catch (IOException ex)     

77.                           

78.                      

79.                

 

4.按照提示输入注册名(自己随便输入即可),然后会自动产生注册码

5.打开“MyEclipse”----“subscription information”对话框,输入刚才产生的注册码和用户名即可。


原创粉丝点击