this is how the java compiler knows about the compilation error in the class.
public static void main(string paramarrayofstring)
throw new error("unresolved compilation problem: \n\ttype mismatch: cannot convert from long to int.\n");
if you decompile your class file, you can see the above
main() method of the class file, which the compiler has generated. this is because of the compiler which eclipse uses (eclipse compiler for java) is not the same as the standard java compiler!
yes, eclipse uses its own special compiler; known as "ecj". from stack overflow question what is the difference between javac and the eclipse compiler?:
one notable difference is that the eclipse compiler lets you run code that didn't actually properly compile. if the block of code with the error is never ran, your program will run fine. otherwise it will throw an exception indicating that you tried to run code that doesn't compile.
eclipse uses the ibm compiler which has an option of creating classes which do not compile, replacing errors with
throw new error();
imho, this is very bad practice and i have seen some very poor quality projects use this. the project didn't compile completely for weeks at a time.
unlike fail fast strategies, which try to minimise the cost of bugs, discovering bugs as late as possible also maximises the cost of fixing them.
this strategy only works if you are writing prototype code quickly, i.e. code you know will never get into production. (it is hard to be sure this will be the case)
- How can Eclipse create a class with unresolved compilation problems?
- How can I create a subclass of an abstract class automatically in Eclipse in Java?
- How can I get eclipse to create Run Configurations for junit with extra parameters?
- How can i solve the problem with creating a class in java using Eclipse
- How can i create code generator in eclipse that can generate code regarding the class atributes
- How can I take a class out of a namespace automatically with Eclipse CDT?
- How to create the pom.xml for a Java project with Eclipse
- How can I tell Eclipse to warn me when I compare Strings with == instead of .equals()
- How can I create a custom Eclipse Syntax Highlighter
- How can I create Spring web project with Maven in Eclipse?
- How can I add current Eclipse project to git with EGit?
- How can I find an anonymous inner class in Eclipse given only its synthetic name (Class$N)?
- How to create a generic list with Eclipse EMF?
- How can I create a self-consistent .jar file with Eclipse?
- how to create an eclipse workspace with command line without actually launching eclipse?
- How Can I Tell Eclipse to Compile and Build a Project with a Different JRE Version than it Normally Does?
- How can I download Java Servlet documentation and attach with eclipse
- How to create a Maven project in Eclipse with AspectJ support?
- How Can I insert System.out.println() in Eclipse with ctrl + space
- How do I create a Spring Boot Starter Project in Eclipse that is properly configured with a Run Configuration?
- How to do standalone on-the-fly in-memory compilation with the eclipse compiler?
- how to create a not runnable/not executable jar with other external jar dependencies in Eclipse
- How can I get Eclipse work with Maven and SVN correctly?
- How can use mingw-w64 and MSYS2 with any IDE like eclipse or codeblocks?
- When you get a stack trace in Eclipse with SDK classes in the stack, how can you see the SDK sources?
- How to use eclipse with ssh, so that the remote projects can be edited by local eclipse?
- How can i integrate MATLAB with Eclipse
- How can you set-up PHP + xDebug + (x)Unit + Eclipse to work with breakpoints in unit tests?
- How can I use Java 7 with Eclipse Indigo 3.7.1
- How can I get Eclipse CDT to generate a C++ class constructor from data members?
More Query from same tag
- Set eclipse hyperlink color under KDE
- Why does Eclipse show multiple application configurations when I try to run my application?
- How do I make Eclipse and mvn appengine:devserver talk to each other?
- Enabling Shortcut Keys in Eclipse
- What eclipse API should I use to access the dom tree of a jsp file?
- How to create a folder to further create .csv files in?
- Eclipse EGit/JGit with LFS : commit looks ok but it doesn't work
- No items are displayed in the Palette in Eclipse oxygen
- Open in default browser exception
- Building reverse engineered project
- Modbus4J 2.0.2 and Maven, How it works?
- How to browse file systems in Eclipse?
- Eclipse annotation processing not finding class on classpath
- How to checkout a file into previous revision in egit
- Using Java with modules
- Exporting atollic project as makefile based project
- Android: Restart Timer
- jQuery Mobile & PhoneGap deviceReady() not fired
- How to capture console output in eclipse
- cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins
- How do I view Java strings in the Eclipse debugger?
- Eclipse Kepler crashes when I open Marketplace
- How to change the color of modified files/packages in the Eclipse Package Explorer?
- Exception in thread "main" java.lang.IllegalAccessError in com.jrefinery.chart.JFreeChartInfo
- Java Virtual Machine Launcher : A JNI Error with Spring
- Device Chooser Offine
- Why does Cobertura seem to switch my Eclipse's Java version?
- Specifying .class files as resources and make them copied to output (bin) folder - Eclipse
- Mac eclipse set workspace to dropxbox causes startup crash
- How to 'link' Apache Axis2 1.7.0 to Eclipse Kepler