On 9/18/05, Yongqian Li <yongqli at hotmail.com> wrote:
> Java 5 is very diffrent from previous versions (4, 3, 2) etc., so you cannot
> compile the code for previous JREs. If some of the warnings look like
>
> Note: [java file].java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> you can safely ignore it. It's a new protective feature added in Java 5 that
> programmers can take advantage of to write safer code (specifically it can
> help get rid of ClassCastExceptions from using the Collections framework).
> As for the warnings, did you put the jar files that Freenet requires into
> the CLASSPATH? (try C:\Program Files\Java\jdk1.5.0_04\lib ) As for the
> smaller jar size, the Java 5 compiler add new optimizations to the bytecode,
> making it smaller. I have noticed this with my own programs, so it is
> normal.
>
> I hope I have been helpful.
Thanks for answering so quickly! I hope my newbie coder questions
aren't too retarded. This is what I get with the default build.bat
Building Freenet Java implementation (Fred)
Building the Freenet node and servlets...
javac: target release 1.1 conflicts with default source release 1.5
Built node and servlets
Building Freenet command-line client...
javac: target release 1.1 conflicts with default source release 1.5
Built command-line client.
Building FProxy...
javac: target release 1.1 conflicts with default source release 1.5
Built FProxy
Copying Templates
Building Tools...
javac: target release 1.1 conflicts with default source release 1.5
Built Tools
Creating freenet.jar...
Done
The jar didn't build (well, it did but it only 124KB). If I change
the target to 1.5 I get:
Building Freenet Java implementation (Fred)
Building the Freenet node and servlets...
src\freenet\node\NodeConfigUpdater.java:117: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Class for a varargs call
cast to java.lang.Class[] for a non-varargs call and to suppress this warning
null).invoke(
^
src\freenet\node\NodeConfigUpdater.java:119: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this warning
null);
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 warnings
Built node and servlets
Building Freenet command-line client...
src\freenet\client\FreenetURITest.java:5: package junit.framework does not exis
import junit.framework.TestCase;
^
src\freenet\client\FreenetURITest.java:10: cannot find symbol
symbol: class TestCase
public class FreenetURITest extends TestCase {
^
src\freenet\client\FreenetURITest.java:13: package junit.textui does not exist
junit.textui.TestRunner.run(FreenetURITest.class);
^
src\freenet\client\FreenetURITest.java:30: cannot find symbol
symbol : method assertTrue(java.lang.String,boolean)
location: class freenet.client.FreenetURITest
assertTrue("Error parsing freenet URI", false);
^
src\freenet\node\NodeConfigUpdater.java:117: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Class for a varargs call
cast to java.lang.Class[] for a non-varargs call and to suppress this warning
null).invoke(
^
src\freenet\node\NodeConfigUpdater.java:119: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this warning
null);
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
2 warnings
Built command-line client.
Building FProxy...
src\freenet\node\NodeConfigUpdater.java:117: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Class for a varargs call
cast to java.lang.Class[] for a non-varargs call and to suppress this warning
null).invoke(
^
src\freenet\node\NodeConfigUpdater.java:119: warning: non-varargs call of varar
s method with inexact argument type for last parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this warning
null);
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 warnings
Built FProxy
Copying Templates
Building Tools...
error: cannot read: src\freenet\fs\dir\FSConsole.java
1 error
Built Tools
Creating freenet.jar...
Done
The jar builds to 2110KB which is much closer to normal. I don't like
the looks of the "cannot find symbol" errors and FSConsole.java didn't
build at all...
Thanks in advance for any insight you may have.