Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » Compiling from the command line fails
Compiling from the command line fails [message #1084178] Sun, 11 August 2013 01:02 Go to next message
Steve Mayer is currently offline Steve Mayer
Messages: 22
Registered: December 2012
Junior Member
Hello,


I want to compile and run a small OT example from the command line.
My example works in Eclipse, however I cannot compile the example from the command line.


In the shell I execute:
java -jar otre/ecotj-R-2.2.0-201306071800.jar -cp otre/org.eclipse.objectteams.runtime_2.2.0.201305210612.jar Example.java


I get the following error:
----------
1. ERROR in /home/stephan/arbeit/paper_sac/code/Example.java (at line 7)
	public team class Colored {
	                  ^^^^^^
Name clash: The method restoreRole(Class<?>, Object) of type Example.Colored has the same erasure as restoreRole(Class, Object) of type Team but does not override it
----------
1 problem (1 error)



The example works fine in Eclipse!

Here is my code:

public team class Example {

    public class BEdge {
    	public void print() { System.out.println("I am basic.");}
    }
        
    public team class Colored {
	
	public class ColoredEdge playedBy BEdge {
	    public void print() { System.out.println("I am colored.");}
	}

	public void test() {
		BEdge edge = new BEdge();
		edge.print();
	}
	
    }
    
    public void test() {
    	new Colored().test();
    }
    
    public static void main(String[] args) {
		new Example().test();
    }
}


My Java version is:
java version "1.7.0_40"
OpenJDK Runtime Environment (IcedTea 2.4.1) (ArchLinux build 7.u40_2.4.1-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)



Thanks for any suggestions
Stephan



Re: Compiling from the command line fails [message #1084554 is a reply to message #1084178] Sun, 11 August 2013 15:15 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 997
Registered: July 2009
Senior Member
Considering that the problem relates to generics and looking at your commandline you may have to add s.t. like "-1.7" to the command line. I don't recall off-hand what compliance level is the default, ecj may still have 1.4 as its default, which doesn't make sense for OT/J which always uses generics in internal code.

HTH,
Stephan
Re: Compiling from the command line fails [message #1165058 is a reply to message #1084554] Thu, 31 October 2013 23:29 Go to previous message
Steve Mayer is currently offline Steve Mayer
Messages: 22
Registered: December 2012
Junior Member
Thank for your fast reply, this fix the problem at once. I went to a conference afterwards and forgot about posting my reply here.
Previous Topic:Lifting and Roles - Graph Product Line example
Next Topic:OT/Equinox changes for Eclipse Luna
Goto Forum:
  


Current Time: Thu Aug 28 05:13:43 EDT 2014

Powered by FUDForum. Page generated in 0.01744 seconds