Compilation error
Project: | JNode Core |
Component: | Code |
Category: | bug report |
Priority: | normal |
Assigned: | Unassigned |
Status: | closed |
Jump to:
I get the following error when I try to compile the lastest Jnode code from trunk.
My enviroment:
* Windows Vista
* javac 1.6.0_11
Error:
--------------------------------------
compile:
[jnode.compile] Compiling 108 source files to C:\jnode\builder\build\classes
[jnode.compile] C:\jnode\builder\build\src\org\jnode\jnasm\assembler\gen\JNAsm.j
ava:12: unmappable character for encoding US-ASCII
[jnode.compile] * @author Levente S?ntha (lsantha@users.sourceforge.net)
[jnode.compile] ^
[jnode.compile] C:\jnode\builder\build\src\org\jnode\jnasm\preprocessor\gen\JNAs
mPP.java:11: unmappable character for encoding US-ASCII
[jnode.compile] * @author Levente S?ntha (lsantha@users.sourceforge.net)
[jnode.compile] ^
[jnode.compile] 2 errors
BUILD FAILED
C:\jnode\all\build.xml:226: The following error occurred while executing this li
ne:
C:\jnode\all\lib\jnode.xml:69: The following error occurred while executing this
line:
C:\jnode\builder\build.xml:89: Compile failed; see the compiler error output for
details.
Total time: 1 minute 2 seconds
- Login to post comments
#1
I noticed this problem on linux and create a fix for it that I expcetd will work on windows too.
It looks like it doesn't work on windows.
I removed the unicode escape from the source.
Can you try it now to so if it works?
#2
First I did a "build clean", then a "build cd-x86-lite". Now I get the following error:
-----------------
native2ascii:
[native2ascii] Converting 1 file from C:\jnode\builder\build\src\org\jnode\jnasm
\preprocessor\gen to C:\jnode\builder\build\src\org\jnode\jnasm\preprocessor\gen
[move] Moving 1 file to C:\jnode\builder\build\src\org\jnode\jnasm\preproce
ssor\gen
BUILD FAILED
C:\jnode\all\build.xml:226: The following error occurred while executing this li
ne:
C:\jnode\all\lib\jnode.xml:69: The following error occurred while executing this
line:
C:\jnode\builder\build.xml:80: Unable to remove existing file C:\jnode\builder\b
uild\src\org\jnode\jnasm\preprocessor\gen\JNAsmPP.java
Total time: 5 minutes 44 seconds
#3
"Unable to remove existing file C:\jnode\builder\b
uild\src\org\jnode\jnasm\preprocessor\gen\JNAsmPP.java"
Unable to remove existing file?
I wonder why... what is not OK for windows there?
#4
Levente, that file is a generated file, right ?
Windows (at least until Windows XP. I don't know for Vista) is known to have problems with deleting files that are being used (it might also be due to file handling not properly closed ...).
Ask to the apache tomcat guys, that's a problem they know (I have seen that somewhere on their mailing lists)
So, I think that file is currently being used by your windows : close all applications, eventually close your session or if it's still doesn't work reboot windows. Ultimately, use Linux
#5
I think i am close to a solution.
#6
JNode ANT task didn't close file. Please update trunk.
Changes to file: \jnode\builder\src\builder\org\jnode\ant\taskdefs\Native2AsciiTask.java
#7
Are you sure this is the problem?
The finally at the end should close the stream in all cases:
....
} finally {
is.close();
}
#8
Yes I am sure. I don't think finally is executed - it make sense. Calling return is a normal executing path therefore you should clean up on your own.
A better way is to call return at the end of the method, that way finally will always get executed.
#9
This prints "2,1" for sun jdk 1.6 or "2,3" without the comment.
#10
Yes, your right. So this is not the issue. Strange error.
#11
What Levente and Peter said above corresponds to my understanding of try { ... } finally { ... }.
A 'finally' block will be executed for all execution paths that leave the statement, including:
If you don't believe me/us, read what the Java Language Specification says.
AFAIK, the only cases where a 'finally' block is not executed are when execution doesn't reach it due to:
(Actually with 3) and 4) there might be obscure scenarios where 'finally' block does get to execute; e.g. involving JVM shutdown hooks calling Thread.kill().)
#12
I think we can mark this as fixed now ...
#13
The method called in \jnode\builder\src\builder\org\jnode\ant\taskdefs\Native2AsciiTask.java is depricated:
getProject().copyFile(tmp, file);
Instead something like this could be used:
------
Project p = getProject();
org.apache.tools.ant.taskdefs.Copy ct = new org.apache.tools.ant.taskdefs.Copy();
ct.setProject(p);
ct.setFile(file);
ct.setTofile(tmp);
ct.execute();
------
I don't know if that is the cause of the strange error but it's proberly a good idea to use something else than the depricated method.
#14
Bluebit: please do the work to test your suggested fix and see if it fixes the strange problem. If it does (or even if it does not) please create a proper patch and submit it.
#15
Marking 'fixed' as per earlier comments.
#16
Automatically closed -- issue fixed for two weeks with no activity.