15 Replies - 7056 Views - Last Post: 09 August 2009 - 08:15 PM
#1
Force compile java files with errors?
Posted 08 August 2009 - 09:54 AM
Hi friends...
I am trying to compile J2SE source code. Compilation of some files give errors. Is there a way to force compile or partially compile such java files into .class files?
Also, I am surprised that J2SE source has so many compilation errors.
I am trying to compile J2SE source code. Compilation of some files give errors. Is there a way to force compile or partially compile such java files into .class files?
Also, I am surprised that J2SE source has so many compilation errors.
Replies To: Force compile java files with errors?
#2
Re: Force compile java files with errors?
Posted 08 August 2009 - 09:59 AM
chetanpatil1984, on 8 Aug, 2009 - 10:54 AM, said:
Hi friends...
I am trying to compile J2SE source code. Compilation of some files give errors. Is there a way to force compile or partially compile such java files into .class files?
Also, I am surprised that J2SE source has so many compilation errors.
I am trying to compile J2SE source code. Compilation of some files give errors. Is there a way to force compile or partially compile such java files into .class files?
Also, I am surprised that J2SE source has so many compilation errors.
Why would you want them to be .class files? None of them have a main method as far as I know.
#3
Re: Force compile java files with errors?
Posted 08 August 2009 - 10:00 AM
I don't think so. Evidently, the errors are syntax or cannot find something problems, which should be easily fixable.
Errors are there for a reason, in Netbeans you can force start even if the compile found errors, but it won't run properly (i.e. when it hits the line with the error(s)).
Errors are there for a reason, in Netbeans you can force start even if the compile found errors, but it won't run properly (i.e. when it hits the line with the error(s)).
#4
Re: Force compile java files with errors?
Posted 08 August 2009 - 10:13 AM
Thank you for your quick response..
I need to initially generate .class files from .java files. After loading .class files, I need to analyse each class using java reflection API.
My project is to automatically detect Composite design pattern in Java 1.4 source code.
So first I need to compile whole of java 1.4 source code and analyse all the class files. Currently, I am facing problem compiling java.awt.Container class, which has 12 errors in it. If I cannot compile it, I cannot analyse it. If I cannot analyse it, I will be missing few design pattern instances.
I need to initially generate .class files from .java files. After loading .class files, I need to analyse each class using java reflection API.
My project is to automatically detect Composite design pattern in Java 1.4 source code.
So first I need to compile whole of java 1.4 source code and analyse all the class files. Currently, I am facing problem compiling java.awt.Container class, which has 12 errors in it. If I cannot compile it, I cannot analyse it. If I cannot analyse it, I will be missing few design pattern instances.
#5
Re: Force compile java files with errors?
Posted 08 August 2009 - 10:16 AM
Are you trying to compile the actual java source? Navigate to your java install and open the src folder, you should then have all the dependencies needed to compile from source.
If it's something you're writing yourself (unclear from your post) then you could post it here (if its not too long) with the errors are we can help you out.
If it's something you're writing yourself (unclear from your post) then you could post it here (if its not too long) with the errors are we can help you out.
#6
Re: Force compile java files with errors?
Posted 08 August 2009 - 10:47 AM
KYA, on 8 Aug, 2009 - 09:16 AM, said:
Are you trying to compile the actual java source? Navigate to your java install and open the src folder, you should then have all the dependencies needed to compile from source.
If it's something you're writing yourself (unclear from your post) then you could post it here (if its not too long) with the errors are we can help you out.
If it's something you're writing yourself (unclear from your post) then you could post it here (if its not too long) with the errors are we can help you out.
Yes, I am try to compile actual java source (1.4 or 1.6).
There are many other class which donot compile, but for me important is java.awt.Container class. Following is the error message for java.awt.Container class
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:399: checkTreeLock() in java.awt.Container cannot override checkTreeLock() in java.awt.Component; overridden method is final
void checkTreeLock() {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:481: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:764: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1058: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1154: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1254: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1406: valid has private access in java.awt.Component
if (valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1480: valid has private access in java.awt.Component
if (!valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1483: valid has private access in java.awt.Component
if (!valid && peer != null) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1492: valid has private access in java.awt.Component
valid = true;
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1515: valid has private access in java.awt.Component
if (!valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1525: valid has private access in java.awt.Component
&& !comp.valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1535: valid has private access in java.awt.Component
valid = true;
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1550: valid has private access in java.awt.Component
if (comp.valid) {
^
C:\Program Files\Java\jdk1.6.0_07\src\java\awt\Container.java:1555: valid has private access in java.awt.Component
if (valid) {
valid is a boolean variable with default(package) access level in java.awt.Component class.
Any ideas why I get these error messages.
-Thanks
#7
Re: Force compile java files with errors?
Posted 08 August 2009 - 01:29 PM
Update:
Have you observed that Eclipse IDE generates .class file in bin directory even if there are java syntax error in file.
I want to do similar stuff, generate .class files, even when there are errors programmatically.
Have you observed that Eclipse IDE generates .class file in bin directory even if there are java syntax error in file.
I want to do similar stuff, generate .class files, even when there are errors programmatically.
#8
Re: Force compile java files with errors?
Posted 08 August 2009 - 01:55 PM
Problem Solved:
Used Eclipse Compiler instead of Sun Java Compiler
Enabled -Proceedonerrors compiler option to generate .class file even when there are errors in .java file.
Yaah Yaaaah... Thank you guys for all your advice.
Used Eclipse Compiler instead of Sun Java Compiler
Enabled -Proceedonerrors compiler option to generate .class file even when there are errors in .java file.
Yaah Yaaaah... Thank you guys for all your advice.
#9
Re: Force compile java files with errors?
Posted 09 August 2009 - 06:32 PM
chetanpatil1984, on 8 Aug, 2009 - 12:55 PM, said:
Problem Solved:
Used Eclipse Compiler instead of Sun Java Compiler
Enabled -Proceedonerrors compiler option to generate .class file even when there are errors in .java file.
Yaah Yaaaah... Thank you guys for all your advice.
Used Eclipse Compiler instead of Sun Java Compiler
Enabled -Proceedonerrors compiler option to generate .class file even when there are errors in .java file.
Yaah Yaaaah... Thank you guys for all your advice.
Wouldn't rely on a program genberated that way
hope it is for a game or something like that not for an ATM or a medical device
#10
Re: Force compile java files with errors?
Posted 09 August 2009 - 07:43 PM
#11
Re: Force compile java files with errors?
Posted 09 August 2009 - 07:52 PM
Don't be silly, all mission critical systems prone to failure are written in C++ with at least three pointer problems.
#12
Re: Force compile java files with errors?
Posted 09 August 2009 - 08:03 PM
KYA, on 9 Aug, 2009 - 08:52 PM, said:
Don't be silly, all mission critical systems prone to failure are written in C++ with at least three pointer problems. 
Oh right. I totally forgot. Damn incessant memory leaks.
Edit: Nah, I won't start an argument.
This post has been edited by Locke: 09 August 2009 - 08:04 PM
#13
#14
Re: Force compile java files with errors?
Posted 09 August 2009 - 08:11 PM
#15
Re: Force compile java files with errors?
Posted 09 August 2009 - 08:13 PM
No, I was hoping you'd put it back.
|
|

New Topic/Question
Reply



MultiQuote




|