attempting to build netbeans

View: New views
5 Messages — Rating Filter:   Alert me  

attempting to build netbeans

by Sergio Lopes-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm attempting to build netbeans in order to be able to debug the
application I'm developing on top of the Netbeans platform. After a
little adventure on windows, I decided to boot my ubuntu and attempt
to build the IDE there.
I had  a few other errors but the current is proving to be strange to solve.
This is the last part of my output, it has the errors and the failure reason:

-----------------------------------
compile:
    [mkdir] Created dir:
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/jumpto/build/classes
    [javac] Compiling 19 source files to
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/jumpto/build/classes
   [repeat] /home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/jumpto/src/org/netbeans/spi/jumpto/type/TypeProvider.java:216:
reference to addAll is ambiguous, both method
addAll(java.util.Collection<? extends E>) in
java.util.Collection<capture#89 of ? super
org.netbeans.spi.jumpto.type.TypeDescriptor> and method
addAll(java.util.Collection<? extends E>) in java.util.List<capture#89
of ? super org.netbeans.spi.jumpto.type.TypeDescriptor> match
   [repeat]             result.addAll(typeDescriptor);
   [repeat]                   ^
   [repeat] 1 error
  [nbmerge] Failed to build target: all-jumpto

BUILD FAILED
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/nbbuild/build.xml:709:
The following error occurred while executing this line:
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/nbbuild/build.xml:704:
The following error occurred while executing this line:
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/nbbuild/build.xml:754:
The following error occurred while executing this line:
/home/knitter/Tools/CustomNB/netbeans-6.1-200805300101-src/nbbuild/templates/common.xml:110:
Compile failed; see the compiler error output for details.
-----------------------------------

From the compiler error, it looks like an error in the code, so, what
am I doing wrong?
I downloaded the zip containing the sources from
http://download.netbeans.org/netbeans/6.1/final/zip/

--
Sem mais e com os melhores cumprimentos,

Sérgio Lopes

Re: attempting to build netbeans

by tomwheel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 6/25/08, Sergio Lopes <knitter.is@...> wrote:

> I'm attempting to build netbeans ...
> I had  a few other errors but the current is proving to be strange to solve.
> This is the last part of my output, it has the errors and the failure reason:
> ....
> org.netbeans.spi.jumpto.type.TypeDescriptor> and method
> addAll(java.util.Collection<? extends E>) in java.util.List<capture#89
> of ? super org.netbeans.spi.jumpto.type.TypeDescriptor> match
>   [repeat]             result.addAll(typeDescriptor);
>   [repeat]                   ^
>   [repeat] 1 error
The source was written under Java 5 and there is a bug in the compiler
which prevents it from being compiled under JDK 6.  There is an issue
filed about it already, but there are two solutions:

Only compilation under 1.5 is guaranteed:

  http://wiki.netbeans.org/WorkingWithNetBeansSources

so you can compile using a command line like this:

     ant build -Dnbjdk.home=/path/to/jdk5

or you can apply the attached patch so you can compile under JDK 6.

Hope that helps.

--
Tom Wheeler
http://www.tomwheeler.com/

diff -r 0fd93149ca18 java.source/src/org/netbeans/api/java/source/ClassIndex.java
--- a/java.source/src/org/netbeans/api/java/source/ClassIndex.java Fri Feb 29 11:32:22 2008 -0800
+++ b/java.source/src/org/netbeans/api/java/source/ClassIndex.java Fri Feb 29 12:04:55 2008 -0800
@@ -602,7 +602,9 @@ public final class ClassIndex {
                 }
             }
             result |= !roots.isEmpty();
-            removedRoots.addAll(roots);;
+            // Workaround for JDK6 - see issue 128102
+            //removedRoots.addAll(roots);;
+            ((List)removedRoots).addAll(roots);;
             return result;
         }
         
diff -r 0fd93149ca18 jumpto/src/org/netbeans/spi/jumpto/type/TypeProvider.java
--- a/jumpto/src/org/netbeans/spi/jumpto/type/TypeProvider.java Fri Feb 29 11:32:22 2008 -0800
+++ b/jumpto/src/org/netbeans/spi/jumpto/type/TypeProvider.java Fri Feb 29 12:04:55 2008 -0800
@@ -213,8 +213,9 @@ public interface TypeProvider {
           * @param  typeDescriptor  type descriptor to be added to result
           */
         public void addResult(List<? extends TypeDescriptor> typeDescriptor) {
-            result.addAll(typeDescriptor);
+            // Workaround for JDK6 - see issue 128102
+            //result.addAll(typeDescriptor);
+            ((List)result).addAll(typeDescriptor);
         }
     }
-
 }

Re: attempting to build netbeans

by Sergio Lopes-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the help.
I'm now trying to compile it with Java5, lets see if it succeeds

--
Sem mais e com os melhores cumprimentos,

Sérgio Lopes

Re: attempting to build netbeans

by Sergio Lopes-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Another build failed.
This time, after compiling the IDE, the build process could not copy
the launchers, I honestly don't know where they should have been put.

I got the linux one from another installation and got netbeans to
execute properly but I still can't debug into the platform.
Is there anything I should do to make debugging possible?

The wiki doesn't provide any information that helps, I've done all the
steps listed there and still can't debug a module I write.

--
Sem mais e com os melhores cumprimentos,

Sérgio Lopes

Re: attempting to build netbeans

by tomwheel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 6/26/08, Sergio Lopes <knitter.is@...> wrote:
> Another build failed.
> This time, after compiling the IDE, the build process could not copy
> the launchers, I honestly don't know where they should have been put.

I found that a couple of weeks ago and reported it:

    http://www.netbeans.org/issues/show_bug.cgi?id=137057

It has been fixed in the trunk and is being backported for 6.1.  Until
that is done, you ought to be able to take the "ide" directory (which
contains subdirectories named "allmodules", "launcher" and
"projectopener") from recent trunk sources and copy it into the same
place within your 6.1 sources.  At least that worked for me.

--
Tom Wheeler
http://www.tomwheeler.com/
LightInTheBox - Buy quality products at wholesale price