netbeans and openjdk

huizhe wang huizhe.wang at oracle.com
Mon Mar 25 21:45:54 UTC 2013


Hi Lance,

On 3/25/2013 2:28 PM, Lance Andersen wrote:
> Hi Joe,
>
> On Mar 25, 2013, at 5:12 PM, huizhe wang <huizhe.wang at oracle.com 
> <mailto:huizhe.wang at oracle.com>> wrote:
>
>> Hi Lance,
>>
>> Are you setting it up as a free-form project?  In a free-form 
>> project, the custom build script is separate from those generated by 
>> the IDE.  Although you can map targets from the custom build script 
>> to project actions, you won't see properties such as source in the 
>> script reflected in the IDE. Your ide may be configured so that you 
>> may right-click and compile selected file using IDE generated 
>> scripts, but when you 'build' the whole project, you're using the 
>> target in your customer script.  In this case, your build script must 
>> have defined to compile to source 1.5 that seems to be in the shared.xml.
>
> Yes, I was looking at shared.xml and it has the following
>
> <macrodef name="jdk-javac">
>             <attribute name="srcdir"/>
>             <attribute name="includes" default="${includes}"/>
>             <attribute name="excludes" default="${excludes}"/>
>             <attribute name="classesdir" default="${classes.dir}"/>
>             <sequential>
>                 <mkdir dir="@{classesdir}"/>
>                 <javac srcdir="@{srcdir}" includes="@{includes}" 
> excludes="@{excludes}" sourcepath=""
>                     destdir="@{classesdir}" fork="true" 
> executable="${bootstrap.javac}"
>                     debug="${javac.debug}" 
> debuglevel="${javac.debuglevel}">
>                     <compilerarg value="-source"/>
>                     <compilerarg value="1.5"/>
>                     <compilerarg value="-target"/>
>                     <compilerarg value="1.6"/> <!-- for usability of 
> JDK 6 as snapshot; change to 1.7 when JSR 294 put back -->
>                     <!-- Mandatory for compiling partial JDK sources 
> against a snapshot; should NEVER be used for any other purpose: -->
>                     <compilerarg value="-XDignore.symbol.file=true"/>
>                     <compilerarg line="${javac.options}"/>
>                 </javac>
>
>
> So this seems to be the issue.
>
> So I changed the values above just now from  1.5 and 1.6 to both be 1.7
>
> Which worked much better.
>
>
> This works in a jdk7 repository.
>
> It looks like shared.xml was changed for jdk8  so it does not have the 
> values above.

That makes sense.  I mean we specify source/target levels for the 
standalone, endorsed technologies so that they may be used in older 
JDKs.  But for scripts doing that inside the JDK, that's kind of 
interesting :-)

>
>
> Also, do you know why if this is on osx  it is building in
>
> Copying 3 files to 
> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/build/windows-x86_64/classes
> Building jar: 
> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/dist/lib/jdb42.jar

I'm not familiar with the script. But it seems to me there's no support 
for OSX in the script that you're using.  Was windows-x86_64 the default 
value?

>
>
> Thank you for your time Joe

You're very welcome.

Best,
Joe

>
> Best
> Lance
>> -Joe
>>
>> On 3/25/2013 1:25 PM, Lance Andersen wrote:
>>> Hi all,
>>>
>>> I am trying to set up a netbeans project for JDBC within openjdk 
>>> leveraging the existing projects that are already in jdk/make/netbeans
>>>
>>> I have getting the following error and not sure why so wondered if 
>>> anyone has encountered this before:
>>>
>>> ------------------------------------------------------
>>>
>>>
>>> ant -f 
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/make/netbeans/jdbc 
>>> clean build
>>> Deleting directory 
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/build/windows-x86_64/depcache
>>> shared.clean:
>>> clean:
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/make/netbeans/common/shared.xml:128: 
>>> warning: 'includeantruntime' was not set, defaulting to 
>>> build.sysclasspath=last; set to false for repeatable builds
>>> Compiling 96 source files to 
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/build/windows-x86_64/classes
>>> warning: [options] bootstrap class path not set in conjunction with 
>>> -source 1.5
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java:148: 
>>> error: try-with-resources is not supported in -source 1.5
>>>         try (Reader charStream = clob.getCharacterStream()) {
>>>   (use -source 7 or higher to enable try-with-resources)
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java:370: 
>>> error: try-with-resources is not supported in -source 1.5
>>>                     try (FileInputStream fis = new 
>>> FileInputStream(ROWSET_PROPERTIES)) {
>>>   (use -source 7 or higher to enable try-with-resources)
>>> 2 errors
>>> 1 warning
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/make/netbeans/common/shared.xml:170: 
>>> The following error occurred while executing this line:
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/make/netbeans/common/shared.xml:155: 
>>> The following error occurred while executing this line:
>>> /Users/lance/Documents/hg-workspaces/jdk7/jdk7u-dev/jdk/make/netbeans/common/shared.xml:128: 
>>> Compile failed; see the compiler error output for details.
>>> BUILD FAILED (total time: 2 seconds)
>>>
>>> ----------------------------------------
>>>
>>> If I open the project properties in netbeans, it shows 1.7 source. 
>>>  This is with netbeans 7.3
>>>
>>> Best
>>> Lance
>>>
>>>
>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>> Oracle Java Engineering
>>> 1 Network Drive
>>> Burlington, MA 01803
>>> Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>
>>>
>>>
>>>
>>>
>>
>
>
>
> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance.Andersen at oracle.com 
> <mailto:Lance.Andersen at oracle.com>
>
>
>
>




More information about the build-dev mailing list