我更好地從一開始就解釋情況。我想換一個.jar文件的分辨率,所以我Java Decompiler反編譯,然後我去了記事本+ +和做了一個小編輯,在2號線爲.java
文件:java - 如何用Eclipse或NetBeans編譯一個沒有錯誤的java文件?
paramGraphics.setClip(0, 0, 176, 208);
這樣:
paramGraphics.setClip(0, 0, 320, 240);
和:
paramGraphics.setClip(0, 0, 176, 208);
這樣:
paramGraphics.setClip(0, 0, 320, 240);
然後保存。之後,我想將該文件編譯到一個類中。我嘗試使用javac命令,沒有工作,並顯示100錯誤。它沒有編譯。十個使用的NetBeans。相同的結果,它沒有編譯。
這是NetBeans中的編譯器輸出:
ant -f "C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4" -Dnb.internal.action.name=rebuild clean jar init: deps-clean: Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build Updating property file: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\built-clean.properties Deleting directory C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build clean: init: deps-jar: Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build Updating property file: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\built-jar.properties Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\classes Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\empty Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\generated-sources\ap-source-output Compiling 1 source file to C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\build\classes C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:4: error: cannot find symbol public Image jdField_int; symbol: class Image location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:18: error: cannot find symbol public a(InputStream paramInputStream) symbol: class InputStream location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:61: error: cannot find symbol public void jdField_if(Graphics paramGraphics) symbol: class Graphics location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:70: error: cannot find symbol public void a(Graphics paramGraphics) symbol: class Graphics location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:47: error: cannot find symbol this.jdField_int = Image.createImage(this.jdField_do, 0, this.jdField_do.length); symbol: variable Image location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:76: error: cannot find symbol int k = j + b.bD + this.jdField_new[this.jdField_else] + 16; symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:77: error: cannot find symbol int m = i + b.bF + 16; symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:78: error: cannot find symbol int n = i + b.bF + this.jdField_try[this.jdField_else] + 16; symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:79: error: cannot find symbol int i1 = e.jdField_if(m, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:80: error: cannot find symbol int i2 = e.jdField_if(n, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:83: error: cannot find symbol i3 = e.jdField_if(n, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:85: error: cannot find symbol i3 = e.jdField_if(m + 16, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:88: error: cannot find symbol i4 = e.jdField_if(m, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:90: error: cannot find symbol i4 = e.jdField_if(n - 16, k); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:91: error: cannot find symbol int i5 = e.jdField_if(m, k - 16); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:92: error: cannot find symbol int i6 = e.jdField_if(n, k - 16); symbol: variable e location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:100: error: cannot find symbol paramGraphics.setClip(i, j, this.jdField_try[this.jdField_else], this.jdField_new[this.jdField_else] - i7 - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF)); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:107: error: cannot find symbol paramGraphics.setClip(i + 16 + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 32 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:107: error: cannot find symbol paramGraphics.setClip(i + 16 + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 32 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:107: error: cannot find symbol paramGraphics.setClip(i + 16 + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 32 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:107: error: cannot find symbol paramGraphics.setClip(i + 16 + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 32 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:112: error: cannot find symbol paramGraphics.setClip(i + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:112: error: cannot find symbol paramGraphics.setClip(i + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:112: error: cannot find symbol paramGraphics.setClip(i + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:112: error: cannot find symbol paramGraphics.setClip(i + (16 - (i + b.bF & 0xF)), j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 + (i + b.bF & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:119: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:119: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:119: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - 16 - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:124: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:124: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\src\javaapplication4\a.java:124: error: cannot find symbol paramGraphics.setClip(i, j + this.jdField_new[this.jdField_else] - (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) - i7, this.jdField_try[this.jdField_else] - (i + b.bF + this.jdField_try[this.jdField_else] & 0xF), (j + b.bD + this.jdField_new[this.jdField_else] & 0xF) + i7); symbol: variable b location: class a 31 errors C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\nbproject\build-impl.xml:920: The following error occurred while executing this line: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication4\nbproject\build-impl.xml:260: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 2 seconds)
我怎樣才能重新編譯我的文件上課嗎?我對Java不太瞭解,所以我是一個新手。誰能幫我?
在此先感謝
更新!
這是現在的輸出日誌...
ant -f "C:\\Users\\USER\\Mis documentos\\NetBeansProjects\\JavaApplication5" -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\built-clean.properties
Deleting directory C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build
clean:
init:
deps-jar:
Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build
Updating property file: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\built-jar.properties
Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\classes
Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\empty
Created dir: C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\generated-sources\ap-source-output
Compiling 8 source files to C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\build\classes
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\src\javaapplication5\Dun.java:22: error: <identifier> expected
a.char = true;
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\src\javaapplication5\Dun.java:22: error: not a statement
a.char = true;
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\src\javaapplication5\Dun.java:22: error: illegal start of expression
a.char = true;
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\src\javaapplication5\Dun.java:22: error: ';' expected
a.char = true;
4 errors
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\nbproject\build-impl.xml:920: The following error occurred while executing this line:
C:\Users\USER\Mis documentos\NetBeansProjects\JavaApplication5\nbproject\build-impl.xml:260: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
刪除所有錯誤。添加所有依賴項。 –
你必須給所有依賴於它,或者它會更清楚,我當u發表您的錯誤,有 – Tenacious
我打賭,所有的(大部分)你的錯誤是由於缺少資源。至少,您需要讓您的'javac'命令訪問任何其他需要可用的JAR和資源才能構建它。如果你的反編譯器爲你提供了導入名稱,這些包應該給你一個線索。這是一個完整的自定義構建,並且超出了本網站的範圍。 –