Results 1 to 11 of 11
- 10-24-2011, 02:28 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Compile .java to .class, with all errors kept
So what i need.
Is to compile .java file (witch ofcourse contains lot of errors but all those errors ar expected and needed, cuz that .java file is from really big package)
And for example like :
This imports not exists (in eclipse project or in same folder if i compile with cmd) so I need them kept anyway I don't really care if java compiler sees it as error, and fixes it for me...
This was the original import, and while i compile with "Eclipse" using java-builder,Java Code:import gnu.trove.TIntIntHashMap; import gnu.trove.TIntObjectHashMap; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; import java.util.Arrays; import java.util.List; import java.util.Properties; import java.util.StringTokenizer; import java.util.logging.Logger; import javolution.util.FastList; import net.sf.l2j.gameserver.util.FloodProtectorConfig; import net.sf.l2j.util.StringUtil;
It gives me sharpen/cut out/fixed/replaced/recreated - f*** code...
I really wanna use eclipse in future cuz it's like home for me now. But this all compiling situation frustrating me really badly.Java Code:import FastList; import TIntIntHashMap; import TIntObjectHashMap; import java.io.File; import java.util.List; import java.util.Properties; import java.util.logging.Logger; import net.sf.l2j.gameserver.util.FloodProtectorConfig;
And the worst part, i can't find answer anywhere around the internet,
And I tried to change preferences In whole eclipse, tried to change preferences in Project menu,
Well I just didn't find any solution.
I'm using : jdk1.7.0_01
Classic Eclipse SDK without any custom plugins,
So is there anyway configure java compiler to skip errors or it's about eclipse (But i think it javac(compiler))
I'm sorry for my (hopefully good enough to understand) English.
- 10-24-2011, 02:35 PM #2
Re: Compile .java to .class, with all errors kept
I'm not sure what you mean. Are you saying that the compiler is removing the unused imports from your .java file? That shouldn't happen, the compiler shouldn't modify the source code at all. What happens when you compile from the command prompt?
If I understand you correctly, I believe your problem has less to do with the compiler and more to do with an eclipse setting somewhere. I would google something like "eclipse remove unused imports"- if you find out how to turn it on, you should know how to turn it off.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-24-2011, 02:42 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Re: Compile .java to .class, with all errors kept
Yep i found that. the option in eclipse with unused imports. Eclipse set up fine i'm sure i've been playing around it now for few days with the same problem.
Compile via cmd gives me this :
and keep going, I know that package doesn't exist, I realize that and I need that.Java Code:Config.java:3: error: package gnu.trove does not exist import gnu.trove.TIntIntHashMap; ^ Config.java:4: error: package gnu.trove does not exist import gnu.trove.TIntObjectHashMap; ^ Config.java:16: error: package javolution.util does not exist import javolution.util.FastList; ^ Config.java:17: error: package net.sf.l2j.gameserver.util does not exist import net.sf.l2j.gameserver.util.FloodProtectorConfig; ^ Config.java:18: error: package net.sf.l2j.util does not exist import net.sf.l2j.util.StringUtil;
Cuz when i get .class file, I'll just put it to .jar file, and everything will work.
So what i need is to make java compiler skip all errors and just make me .class identical to .java file, with all errors exceptions etc... (even if some not used variables)
So how to deal with that?
- 10-24-2011, 02:47 PM #4
Re: Compile .java to .class, with all errors kept
I'm not sure you can do what you're asking. An import simply tells the compiler which class you mean. For example, if you use a List, the compiler will look to your imports to see whether you mean java.util.List or java.awt.List. If it can't figure out an import, it doesn't know which classes it contains, so it can't go on with its job.
Why do you think you need to do this?How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-24-2011, 02:56 PM #5
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Re: Compile .java to .class, with all errors kept
Ok so here full story maybe u will understand me.
I have .jar files pack(and they connected with each other in .class files) its :
I need to edit only l2jserver.jarJava Code:c3p0-0.9.1.2.jar ecj-3.6.2.jar java-engine.jar javolution.jar jython.jar jython-engine.jar l2jserver.jar mmocore.jar mysql-connector-java-5.1.14-bin.jar trove-2.1.0.jar
I decompiled it from .class , to .java with JD-gui, (But ofcorse alone it will have alot of errors, But i really don't care about it cuz i know what i'm editing and doing in that file. Errors will be like : Missing import "import gnu.trove.TIntIntHashMap;" I know that it will work when i put edited class file back to l2jserver.jar)
so next
Imported as a project to eclipse, edit it there ant everything looks fine
I just can't get the source code to .class exactly the same as in .java (Because compiler/builder removes Imports variables which don't exist atm cuz it's taken out of package)
So what I need, Is to compile .java to .class with exactly the same source skipping error fixes, or any kind of modifications from compiler, i just wanna file same as .java
I hope this was clear
- 10-24-2011, 02:58 PM #6
Re: Compile .java to .class, with all errors kept
Yeah sorry, I don't think there's a good way to do that. Maybe somebody smarter than me can come up with a hack for you, but I'd say your best bet is to just recompile everything you need and make a new Jar.
Also, why are you decompiling? Don't you have access to the source?How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-24-2011, 03:00 PM #7
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Re: Compile .java to .class, with all errors kept
I'm completely new to java, (I know just fundamentals of language which allows me to edit game server modifications etc...)
So decompiling is the easiest way for me for now.
- 10-24-2011, 03:05 PM #8
Re: Compile .java to .class, with all errors kept
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-24-2011, 03:09 PM #9
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Re: Compile .java to .class, with all errors kept
So ok, one more question
I don't know alot but,
I can get source code example via SVN client right?
(Cuz i downloaded entire server files just from simple http, And if do that through SVN, i'll get source code? or I missed something?)
- 10-24-2011, 03:18 PM #10
Re: Compile .java to .class, with all errors kept
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-24-2011, 03:32 PM #11
Member
- Join Date
- Oct 2011
- Posts
- 9
- Rep Power
- 0
Re: Compile .java to .class, with all errors kept
yeah like i sad i know just fundamentals of object programming so, I'll try to learn java, Just my opinion is solving problems getting big source codes Is the next steps after basics, So you have to think on your self not just listen what others saying, So that's why now i'm trying to edit end setup game server,
Thank you for your time :) Was nice meeting you. Off for now :)
Similar Threads
-
help with compile errors
By bzupnick in forum New To JavaReplies: 1Last Post: 02-15-2011, 08:14 PM -
First Java Program-Compile Errors (errors are posted)-simple GUI
By cc11rocks in forum AWT / SwingReplies: 4Last Post: 01-04-2011, 12:36 AM -
compile errors (how do I fix)
By rhythmiccycle in forum New To JavaReplies: 4Last Post: 01-03-2011, 10:33 PM -
I can not compile servlets although normal java can... errors shown
By lse123 in forum Java ServletReplies: 12Last Post: 01-17-2010, 11:05 PM -
Help with Compile time errors
By bri1547 in forum New To JavaReplies: 2Last Post: 08-24-2008, 11:22 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks