我有一點我想編輯的Java(它是一個Minecraft mod)我反編譯.class文件(用jd-gui),編輯我想要的,然後嘗試重新編譯(與javac)。無法重新編譯反編譯的類文件
我得到了數百個錯誤。我只編輯了幾行,所以我試着編譯未經編輯的.java,就像它們來自反編譯器一樣。同樣的事情,數百個錯誤。
對Java知之甚少,所以我肯定我犯了一些錯誤。爲什麼不能編譯尚未從有效的.class文件編輯的代碼?
這裏是我所得到的一個樣本:
ReiMinimap.java:451: illegal start of expression
switch (???)
^
ReiMinimap.java:451: ';' expected
switch (???)
^
ReiMinimap.java:451: illegal start of expression
switch (???)
^
ReiMinimap.java:451: illegal start of expression
switch (???)
^
ReiMinimap.java:451: illegal start of expression
switch (???)
^
ReiMinimap.java:452: illegal start of expression
{
^
ReiMinimap.java:452: : expected
{
^
ReiMinimap.java:453: ';' expected
case 49:
^
ReiMinimap.java:453: ')' expected
case 49:
^
ReiMinimap.java:454: illegal start of expression
this.allowCavemap = true;
^
ReiMinimap.java:454: ';' expected
this.allowCavemap = true;
^
ReiMinimap.java:454: illegal start of expression
this.allowCavemap = true;
^
ReiMinimap.java:454: ';' expected
this.allowCavemap = true;
^
ReiMinimap.java:456: orphaned case
case 50:
^
ReiMinimap.java:308: 'try' without 'catch' or 'finally'
try { if (paramMinecraft == null);
^
ReiMinimap.java:499: illegal start of type
else
^
ReiMinimap.java:499: ';' expected
else
^
ReiMinimap.java:501: illegal start of type
this.chatWelcomed = true;
^
ReiMinimap.java:501: <identifier> expected
this.chatWelcomed = true;
^
ReiMinimap.java:501: ';' expected
this.chatWelcomed = true;
^
ReiMinimap.java:501: illegal start of type
this.chatWelcomed = true;
^
ReiMinimap.java:501: <identifier> expected
this.chatWelcomed = true;
^
而且一些代碼:
if ((!this.chatWelcomed) && (System.currentTimeMillis() < this.chatTime + 10000L))
{
Object localObject1;
for (localObject2 = this.chatLineList.iterator(); ((Iterator)localObject2).hasNext();) { localObject1 = (ahe)((Iterator)localObject2).next();
if ((localObject1 == null) || (this.chatLineLast == localObject1)) break;
Matcher localMatcher1 = Pattern.compile("§0§0((?:§[1-9a-d])+)§e§f").matcher(((ahe)localObject1).a);
while (localMatcher1.find())
{
this.chatWelcomed = true;
for (??? : localMatcher1.group(1).toCharArray())
{
switch (???)
{
case 49:
this.allowCavemap = true;
break;
case 50:
this.allowEntityPlayer = true;
break;
case 51:
this.allowEntityAnimal = true;
break;
case 52:
this.allowEntityMob = true;
break;
case 53:
this.allowEntitySlime = true;
break;
case 54:
this.allowEntitySquid = true;
break;
case 55:
this.allowEntityLiving = true;
}
}
}
顯示一個例子。 – Boann
是否在編譯時將原始庫添加到類路徑中? –
就例子而言,你只是想讓我複製整個錯誤日誌嗎?另外:原始圖書館?我知道編程的基礎知識和其他不相關的語言,但幾乎沒有任何關於Java的內容。不明白你的意思。這可以解釋爲什麼我有一個問題。 。 。 – zeel