Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Empty Boot Classpath Using Toolchains + Java 7 on OS X?

There is a bug in the way Tycho detects jdt installation layout on OSX
(please open a bug report). You should be able to workaround it by
providing explicit includes/excludes patters in toolchain configuration
as explained in

http://eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html#useJDK

--
Regards,
Igor

On 2014-03-18, 20:26, James Gajnak wrote:
Hello all,

Has anyone had problems building Eclipse plugins with Oracle Java 7
(1.7.0_51) via Toolchains on OS X (10.9)? I'm getting some very strange
compilation messages, which seem to imply that the base rt.jar classes
can't be found. Building with Eclipse/PDT doesn't seem to have issues,
but command line mvn or Eclipse M2E fails with the following:

[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile)
on project org.test: Compilation failure: Compilation failure:
[ERROR] /Projects/Eclipse/work/org.test/src/org/test/HelloWorld.java:[1]
[ERROR] package org.test;
[ERROR] ^
[ERROR] The type java.lang.Object cannot be resolved. It is indirectly
referenced from required .class files
[ERROR] /Projects/Eclipse/work/org.test/src/org/test/HelloWorld.java:[1]
[ERROR] package org.test;
[ERROR] ^
[ERROR] The type java.lang.String cannot be resolved. It is indirectly
referenced from required .class files
[ERROR] /Projects/Eclipse/work/org.test/src/org/test/HelloWorld.java:[3]
[ERROR] public class HelloWorld {
[ERROR] ^^^^^^^^^^
[ERROR] Implicit super constructor Object() is undefined for default
constructor. Must define an explicit constructor
[ERROR] /Projects/Eclipse/work/org.test/src/org/test/HelloWorld.java:[5]
[ERROR] public static void main(String aArgs[]) {
[ERROR] ^^^^^^
[ERROR] String cannot be resolved to a type
[ERROR] /Projects/Eclipse/work/org.test/src/org/test/HelloWorld.java:[6]
[ERROR] System.out.println("Hello World!");
[ERROR] ^^^^^^
[ERROR] System cannot be resolved
[ERROR] 5 problems (5 errors)
[ERROR] -> [Help 1]

I believe the toolchains.xml entry is correct (I've tried including the
jre subdirectory in the jdkHome path - but there seemed to be no change
in behavior):

<?xmlversion=/"1.0"/encoding=/"UTF-8"/?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
<id>JavaSE-1.7</id>
</provides>
<configuration>
<jdkHome>/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home</jdkHome>
</configuration>
</toolchain>
</toolchains>

The Maven debug output looks mostly reasonable - except for the Boot
classpath entry near the end, which I would normally think should have
the rt.jar reference:

[DEBUG] Configuring mojo
'org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile' with basic
configurator -->
[DEBUG]   (f) basedir = /Projects/Eclipse/work/org.test
[DEBUG]   (f) buildDirectory = /Projects/Eclipse/work/org.test/target
[DEBUG]   (f) compilerId = jdt
[DEBUG]   (f) debug = true
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) fork = false
[DEBUG]   (f) generatedSourcesDirectory =
/Projects/Eclipse/work/org.test/target/generated-sources/annotations
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputFileName = org.test-0.0.1-SNAPSHOT
[DEBUG]   (f) project = MavenProject: org.test:org.test:0.0.1-SNAPSHOT @
/Projects/Eclipse/work/org.test/pom.xml
[DEBUG]   (f) requireJREPackageImports = false
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@42c3d37a
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) strictCompilerTarget = false
[DEBUG]   (f) useJDK = BREE
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Manifest minimal BREE: OSGi profile 'JavaSE-1.7' { source level:
1.7, target level: 1.7}
[DEBUG] Effective EE: OSGi profile 'JavaSE-1.7' { source level: 1.7,
target level: 1.7}
[DEBUG] Effective source/target: 1.7/1.7
[DEBUG] Using compiler 'jdt'.
[DEBUG] Source directories: [/Projects/Eclipse/work/org.test/src]
[DEBUG] Classpath: [/Projects/Eclipse/work/org.test/target/classes]
[DEBUG] Output directory: /Projects/Eclipse/work/org.test/target/classes
[DEBUG] Classpath:
[DEBUG]  /Projects/Eclipse/work/org.test/target/classes
[DEBUG] Source roots:
[DEBUG]  /Projects/Eclipse/work/org.test/src
[INFO] Compiling 1 source file to
/Projects/Eclipse/work/org.test/target/classes
[DEBUG] Using javaHome:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre
[DEBUG] Boot classpath access rules:
[+java/**:+javax/accessibility/*:+javax/activation/*:+javax/activity/*:+javax/annotation/*:+javax/annotation/processing/*:+javax/crypto/*:+javax/crypto/interfaces/*:+javax/crypto/spec/*:+javax/imageio/*:+javax/imageio/event/*:+javax/imageio/metadata/*:+javax/imageio/plugins/bmp/*:+javax/imageio/plugins/jpeg/*:+javax/imageio/spi/*:+javax/imageio/stream/*:+javax/jws/*:+javax/jws/soap/*:+javax/lang/model/*:+javax/lang/model/element/*:+javax/lang/model/type/*:+javax/lang/model/util/*:+javax/management/*:+javax/management/loading/*:+javax/management/modelmbean/*:+javax/management/monitor/*:+javax/management/openmbean/*:+javax/management/relation/*:+javax/management/remote/*:+javax/management/remote/rmi/*:+javax/management/timer/*:+javax/naming/*:+javax/naming/directory/*:+javax/naming/event/*:+javax/naming/ldap/*:+javax/naming/spi/*:+javax/net/*:+javax/net/ssl/*:+javax/print/*:+javax/print/attribute/*:+javax/print/attribute/standard/*:+javax/print/event/*:+javax/rmi/*:+javax/rmi
/CORBA/*:
+javax/rmi/ssl/*:+javax/script/*:+javax/security/auth/*:+javax/security/auth/callback/*:+javax/security/auth/kerberos/*:+javax/security/auth/login/*:+javax/security/auth/spi/*:+javax/security/auth/x500/*:+javax/security/cert/*:+javax/security/sasl/*:+javax/sound/midi/*:+javax/sound/midi/spi/*:+javax/sound/sampled/*:+javax/sound/sampled/spi/*:+javax/sql/*:+javax/sql/rowset/*:+javax/sql/rowset/serial/*:+javax/sql/rowset/spi/*:+javax/swing/*:+javax/swing/border/*:+javax/swing/colorchooser/*:+javax/swing/event/*:+javax/swing/filechooser/*:+javax/swing/plaf/*:+javax/swing/plaf/basic/*:+javax/swing/plaf/metal/*:+javax/swing/plaf/multi/*:+javax/swing/plaf/nimbus/*:+javax/swing/plaf/synth/*:+javax/swing/table/*:+javax/swing/text/*:+javax/swing/text/html/*:+javax/swing/text/html/parser/*:+javax/swing/text/rtf/*:+javax/swing/tree/*:+javax/swing/undo/*:+javax/tools/*:+javax/transaction/*:+javax/transaction/xa/*:+javax/xml/*:+javax/xml/bind/*:+javax/xml/bind/annotation/*:+javax/xml/bind/
annotatio
n/adapters/*:+javax/xml/bind/attachment/*:+javax/xml/bind/helpers/*:+javax/xml/bind/util/*:+javax/xml/crypto/*:+javax/xml/crypto/dom/*:+javax/xml/crypto/dsig/*:+javax/xml/crypto/dsig/dom/*:+javax/xml/crypto/dsig/keyinfo/*:+javax/xml/crypto/dsig/spec/*:+javax/xml/datatype/*:+javax/xml/namespace/*:+javax/xml/parsers/*:+javax/xml/soap/*:+javax/xml/stream/*:+javax/xml/stream/events/*:+javax/xml/stream/util/*:+javax/xml/transform/*:+javax/xml/transform/dom/*:+javax/xml/transform/sax/*:+javax/xml/transform/stax/*:+javax/xml/transform/stream/*:+javax/xml/validation/*:+javax/xml/ws/*:+javax/xml/ws/handler/*:+javax/xml/ws/handler/soap/*:+javax/xml/ws/http/*:+javax/xml/ws/soap/*:+javax/xml/ws/spi/*:+javax/xml/ws/spi/http/*:+javax/xml/ws/wsaddressing/*:+javax/xml/xpath/*:+org/ietf/jgss/*:+org/omg/CORBA/*:+org/omg/CORBA_2_3/*:+org/omg/CORBA_2_3/portable/*:+org/omg/CORBA/DynAnyPackage/*:+org/omg/CORBA/ORBPackage/*:+org/omg/CORBA/portable/*:+org/omg/CORBA/TypeCodePackage/*:+org/omg/CosNami
ng/*:+org
/omg/CosNaming/NamingContextExtPackage/*:+org/omg/CosNaming/NamingContextPackage/*:+org/omg/Dynamic/*:+org/omg/DynamicAny/*:+org/omg/DynamicAny/DynAnyFactoryPackage/*:+org/omg/DynamicAny/DynAnyPackage/*:+org/omg/IOP/*:+org/omg/IOP/CodecFactoryPackage/*:+org/omg/IOP/CodecPackage/*:+org/omg/Messaging/*:+org/omg/PortableInterceptor/*:+org/omg/PortableInterceptor/ORBInitInfoPackage/*:+org/omg/PortableServer/*:+org/omg/PortableServer/CurrentPackage/*:+org/omg/PortableServer/POAManagerPackage/*:+org/omg/PortableServer/POAPackage/*:+org/omg/PortableServer/portable/*:+org/omg/PortableServer/ServantLocatorPackage/*:+org/omg/SendingContext/*:+org/omg/stub/java/rmi/*:+org/w3c/dom/*:+org/w3c/dom/bootstrap/*:+org/w3c/dom/css/*:+org/w3c/dom/events/*:+org/w3c/dom/html/*:+org/w3c/dom/ls/*:+org/w3c/dom/ranges/*:+org/w3c/dom/stylesheets/*:+org/w3c/dom/traversal/*:+org/w3c/dom/views/*:+org/w3c/dom/xpath/*:+org/xml/sax/*:+org/xml/sax/ext/*:+org/xml/sax/helpers/*:?**/*]
[WARNING] No classpath entries for boot classpath found scanning java
home /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre
[DEBUG] Using boot classpath: []
[DEBUG] Using ext dirs: [Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/dnsns.jar,
Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/localedata.jar,
Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunec.jar,
Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar,
Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar,
Classpath for jar file
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/zipfs.jar]
[DEBUG] Using endorsed dirs: []

My sample project (which I think is a fairly basic Eclipse/PDT/Tycho setup)



Other notes:
  - Switching back to Tycho 0.19.0 doesn't change the behavior
  - Using Apple's JDK 6 previously for a JavaSE-1.6 profile didn't have
these problems, but I'm trying to update myself to a pure Java 7 setup

Anyone seen something like this before? I somewhat expect that I'm
missing a magic flag in my toolchains.xml, but I haven't yet been able
to find it after digging through the source code.

Thanks in advance for any pointers you can provide,

--Jim




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



Back to the top