Changeset 370d2555


Ignore:
Timestamp:
Jul 31, 2014 2:42:51 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d3ea5d2
Parents:
5332cee
Message:

Notes and logging re: compiling with Java 8

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • build.properties

    r5332cee r370d2555  
    4747#javac.compilerargs=-warn:-unchecked,raw,unused,serial
    4848
     49#
     50# Note to packagers, embedders, distributors:
     51#
     52# Strictly speaking, you must either use the compiler for the minimum Java version you are
     53# targeting (default 1.6, see above), or specify a bootclasspath, which means you need
     54# the JRE for the target version installed as well.
     55#
     56# However, in practice, you can compile with 1.7 and target 1.6 without specifying a bootclasspath,
     57# and it all works fine.
     58#
     59# But you cannot compile with 1.8 and target 1.6 or 1.7 without bootclasspath,
     60# or your users will get runtime errors.
     61# Below is an example of a bootclasspath that works on Ubuntu.
     62#
     63# For more info:
     64#    http://zzz.i2p/topics/1668
     65#    https://gist.github.com/AlainODea/1375759b8720a3f9f094
     66#
     67#javac.compilerargs=-bootclasspath /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jce.jar
     68
     69
    4970### UnitTests ##
    5071# Location of the libraries required for the ScalaTest tests.
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    r5332cee r370d2555  
    286286    public void run() {
    287287        _isRunning = true;
     288        try {
     289            run2();
     290        } catch (NoSuchMethodError nsme) {
     291            // http://zzz.i2p/topics/1668
     292            // https://gist.github.com/AlainODea/1375759b8720a3f9f094
     293            // at ObjectCounter.objects()
     294            String s = "Fatal error:" +
     295                       "\nJava 8 compiler used with JRE version " + System.getProperty("java.version") +
     296                       " and no bootclasspath specified." +
     297                       "\nUpdate to Java 8 or contact packager." +
     298                       "\nStop I2P now, it will not build tunnels.";
     299            _log.log(Log.CRIT, s, nsme);
     300            System.out.println(s);
     301            throw nsme;
     302        } finally {
     303            _isRunning = false;
     304        }
     305    }
     306
     307    private void run2() {
    288308        List<TunnelPool> wanted = new ArrayList<TunnelPool>(MAX_CONCURRENT_BUILDS);
    289309        List<TunnelPool> pools = new ArrayList<TunnelPool>(8);
     
    424444        if (_log.shouldLog(Log.WARN))
    425445            _log.warn("Done building");
    426         _isRunning = false;
    427446    }
    428447   
Note: See TracChangeset for help on using the changeset viewer.