Skip to main content


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 05:02 Go to next message
Steve Mayer is currently offline Steve MayerFriend
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 19:15 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
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] Fri, 01 November 2013 03:29 Go to previous message
Steve Mayer is currently offline Steve MayerFriend
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:Cannot complete the install because of a conflicting dependency
Next Topic:OT/Equinox changes for Eclipse Luna
Goto Forum:
  


Current Time: Tue Apr 23 14:53:00 GMT 2024

Powered by FUDForum. Page generated in 0.03198 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top