I have this warning:
warning: Supported source version 'RELEASE_6' from annotation processor
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source
'1.7'
Note: Creating non-static metadata factory ...
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with
generation.
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with
generation.
warning: The following options were not recognized by any processor:
'[eclipselink.canonicalmodel.use_static_factory]'
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Copying 5 files to E:\NetBeansProjects\votaciones\build\classes
compile:
Created dir: E:\NetBeansProjects\votaciones\dist
Copying 1 file to E:\NetBeansProjects\votaciones\build
Copy libraries to E:\NetBeansProjects\votaciones\dist\lib.
Building jar: E:\NetBeansProjects\votaciones\dist\votaciones.jar
To run this application from the command line without Ant, try:
java -jar "E:\NetBeansProjects\votaciones\dist\votaciones.jar"
jar:
BUILD SUCCESSFUL (total time: 8 seconds)
what happen?
It says build was successful. The first warning is saying you use Java 7(1.7) where the source supports Java 6 (1.6). The second waring is a consequence of the first one. If your application works, i dont think there is any problem. If it doesnt work, try using java 1.6 or get the updated versions that support java 1.7.
Related
NOVICE HERE - I am trying to Execute a WSDL file in a remote ubuntu terminal. I have installed Java, Axis, and ant. I also specified the classpath and CLASSPATH (wasn't sure if case was a thing). But when I run it using this command:
$AXIS2_HOME/bin/wsdl2java.sh -uri ShippingService.wsdl -p pws.client.ShippingService.wsdl -d adb -s
I get this error:
Using AXIS2_HOME: /opt/axis2
Using JAVA_HOME: /usr/lib/jvm/jdk-13.0.1
Error: -classpath requires class path specification
AXIS2_HOME=/opt/axis2 is defined in the /etc/environment; as is JAVA_HOME.
The instructions specify to use axis2-1.4.1 I am using axis2-1.7.9 which is the latest version. The older one has this file in its classpath specification annogen-0.1.0.jar the newer axis2 doesn't. Is this a possible issue?
Here is the Readme.txt (only available for Windows XP):
Requires:
Basic understanding of Web Services with Java
Valid Development/Production Key and Password
Java SE Development Kit (JDK 6 Update 16)
AXIS2 from Apache
Ant from Apache
This example covers the creation of a proper SOAP Client to communicate with the Shipping Web Services. The solution file was built on a Windows XP system using the Java Development Kit and AXIS2. The generated sample stub files are located in folder ShippingServiceStub based on this system that generated them. You can gather the pre-compiled stubs by making sure the Stub class files are in your classpath, or you can generate the stubs on your own following all the steps below.
To Complete:
1. Download Shipping Service 2.0 WSDL File from Eship Web Services site (Login Required)
a) https://eship.purolator.com/SITE/en/resourcecentre/samplecode.aspx
Note: In this sample the file has been unzipped to C:\EWSSample\ShippingService-Create directory. There should now be ShippingService.wsdl in the directory C:\EWSSample\ShippingService-Create\Development. This is the file we will concentrate on in the next step.
2. Execute WSDL2JAVA to build the stub files (Run this in the C:\EWSSample\ShippingService-Create\Development directory)
a) Example for all WSDLs from Eship Web Services site
%AXIS2_HOME%\bin\wsdl2java -uri WSName.wsdl -p pws.client.WSName -d adb -s
where:
WSName is the name of the web service, for example: ShippingService
AXIS2_HOME is environment variable pointing to your Axis2 installation, for example C:\axis2\axis2-1.4.1
-d adb means that provided samples use Axis Data Binding. It generates one stub class per web service which extends org.apache.axis2.client.Stub.
b) Our current example
C:\AXIS2\axis2-1.4.1\bin\wsdl2java -uri ShippingService.wsdl -p pws.client.ShippingService -d adb -s
Note: If you receive an error 'The JAVA_HOME environment variable is not defined' refer to Installation and Environment Notes file.
Note: If you receive an error 'The AXIS2_HOME environment variable is not defined' refer to Installation and Environment Notes file.
Response received:
Using AXIS2_HOME: C:\AXIS2\axis2-1.4.1
Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_16
Retrieving document at 'ShippingService.wsdl'.
What happened? build.xml was created in local directory. 'src\pws\client\ShippingService' directory created with ShippingServiceCallbackHandler.java, ShippingServiceContract_Consolidate_ValidationFaultFault_FaultMessage.java, ShippingServiceContract_CreateShipment_ValidationFaultFault_FaultMessage, ShippingServiceContract_ValidateShipment_ValidationFaultFault_FaultMessage, ShippingServiceContract_VoidShipment_ValidationFaultFault_FaultMessage and ShippingServiceStub java files created.
3. Download Shipping Service 2.0 Create java sample code and extract ShipmentClientCreate.java to C:\EWSSample\ShippingService-Create\Development\src\pws\client\ShippingService directory.
4. Edit the file and modify the following code
a) Define the Production (or development) Key and Password
b) Define your Purolator Account Number ( Note the Test Account Number is 9999999999 )
c) Define your Postal Code. Make sure the sending postal code is the one you registered with when receiving the Development Key and Password.
5. Run ant to compile.
a) Type 'C:\ANT\apache-ant-1.7.1\bin\ant' from the C:\EWSSample\ShippingService-Create\Development directory.
Response received:
Buildfile: build.xml
init:
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build\classes
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build\lib
pre.compile.test:
[echo] Stax Availability= true
[echo] Axis2 Availability= true
compile.src:
[javac] Compiling 5 source files to C:\EWSSample\ShippingService-Create\Development\build\classes
[javac] Note: C:\EWSSample\ShippingService-Create\Development\src\pws\client\ShippingService\ShippingServiceStub.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
jar.client:
[jar] Building jar: C:\EWSSample\ShippingService-Create\Development\build\lib\ShippingService-test-client.jar
BUILD SUCCESSFUL
Total time: 13 seconds
b) Type 'C:\ANT\apache-ant-1.7.1\bin\ant' from the C:\EWSSample\ShippingService-Create\Development directory.
Response received:
Buildfile: build.xml
init:
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build\classes
[mkdir] Created dir: C:\EWSSample\ShippingService-Create\Development\build\lib
pre.compile.test:
[echo] Stax Availability= true
[echo] Axis2 Availability= true
compile.src:
[javac] Compiling 4 source files to C:\EWSSample\ShippingService-Create\Development\build\classes
[javac] C:\EWSSample\ShippingService-Create\Development\src\pws\client\ShippingService\ShippingServiceStub.java:34: error: incompatible types: java.lang.String cannot be converted to pws.client.ShippingService.ShippingServiceStub.String
[javac] return Long.toString(System.currentTimeMillis()) + "_" + counter;
[javac] ^
[javac] Note: C:\EWSSample\ShippingService-Create\Development\src\pws\client\ShippingService\ShippingServiceStub.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
BUILD FAILED
C:\EWSSample\ShippingService-Create\Development\build.xml:43: Compile failed; see the compiler error output for details.
Total time: 4 seconds
In case you see this error, update C:\EWSSample\ShippingService-Create\Development\src\pws\client\ShippingService\ShippingServiceStub.java by changing method signature of getUniqueSuffix to
private static synchronized java.lang.String getUniqueSuffix(){
6. Navigate to the C:\EWSSample\ShippingService-Create\Development\src\ directory and compile the client code by running the following
a) javac pws\client\ShippingService\ShipmentClientCreate.java
Possible Error 1: 'javac' is not recognized as an internal or external command, operable program or batch file.
Resolution 1: You need to add the Java path to the PATH Environment Variable. %JAVA_HOME%\bin. Refer to Installation and Environment Notes file for additional information.
Possible Error 2: package org.apache.axis2 does not exist throws org.apache.axis2.AxisFault
Resolution 2: Classpath variable needs to be set. Refer to Installation and Environment Notes file for additional information.
Response Received:
C:\EWSSample\ShippingService-Create\Development\src>javac pws\client\ShippingService\ShipmentClientCreate.java
Note: .\pws\client\ShippingService\ShippingServiceStub.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7. Running the code after valid compile above.
a) C:\EWSSample\ShippingService-Create\Development\src>java pws.client.ShippingService.ShipmentClientCreate
Possible Error 1:
WARNING:
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
Resolution 1: http://logging.apache.org/log4j/1.2/manual.html. Refer to Installation and Environment Notes file for additional information.
Possible Error 2:
[main] INFO org.apache.axis2.transport.http.HTTPSender - Unable to sendViaPost to url[https://devwebservices.purolator.com/EWS/V2/Shipping/ShippingService.asmx]
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
Resolution 2: Make sure you are using your Development key and Password when connecting to the devwebservices instance.
Possible Error 3:
[main] INFO org.apache.commons.httpclient.HttpMethodDirector - No credentials available for BASIC 'Purolator'#devwebservices.purolator.com:
Resolution 3:
Make sure code has import procedures:
import org.apache.axis2.client.Options;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
Try the alternate way to send in credentials to web service. Make sure you remark the other credentials that you tried.
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername("your key here");
auth.setPassword("your password here");
options.setProperty(HTTPConstants.AUTHENTICATE,auth);
Response Received:
Here are the setup instructions (only available for Windows XP):
Applications to Install:
Java SE Development Kit (JDK 6 Update 16)
AXIS2 from Apache
Ant from Apache
This example covers the creation of a proper SOAP Client to communicate with the Shipping Web Services. The solution file was built on a Windows XP system using the Java Development Kit and AXIS2.
Installation Instructions for the Environment:
1. Download and install the Java Development Kit
a) In this document Java SE Development Kit 6 Update 16 was downloaded an installed
b) Location: http://java.sun.com/javase/downloads/index.jsp
c) run jdk-6u16-windows-i586.exe (Extracts Installation files)
d) Installed to C:\Program Files\Java\jdk1.6.0_16
2. Download and unpack AXIS 2 Standard Binary Distribution version 1.4.1
a) Location: http://ws.apache.org/axis2/download/1_4_1/download.cgi
b) Unzip to directory (C:\AXIS2\axis2-1.4.1)
Make sure you add JAVA_HOME environment variable pointing to your Java engine root folder (C:\Program Files\Java\jdk1.6.0_16).
This can be completed by right clicking My Computer. Select Properties. Select Advanced, select Environment variables. Select 'New' of JAVA_HOME is not listed under System Variables.
In our example C:\Program Files\Java\jdk1.6.0_16
Make sure you add AXIS2_HOME environment variable pointing to your Axis engine root folder (C:\AXIS2\axis2-1.4.1).
This can be completed by right clicking My Computer. Select Properties. Select Advanced, select Environment variables. Select 'New' of AXIS_HOME is not listed under System Variables.
In our example C:\AXIS2\axis2-1.4.1
Use the online tutorial from Apache for non Java programmers.
Note: Java sample code uses web service client stubs created with Wsdl2Java utility from Apache Axis2 Web services engine.
3. Download and unpack Apache Ant (1.7.1)
a) Location: http://ant.apache.org/bindownload.cgi
b) Unzip to directory (C:\Ant\apache-ant-1.7.1)
Note: Apache Ant is a Java-based build tool.
4. Set the Classpath for the jar files that are included in the AXIS directory.
a) run the following from command line
set classpath=C:\AXIS2\axis2-1.4.1\lib\activation-1.1.jar;
C:\AXIS2\axis2-1.4.1\lib\annogen-0.1.0.jar;
C:\AXIS2\axis2-1.4.1\lib\axiom-api-1.2.7.jar;
C:\AXIS2\axis2-1.4.1\lib\axiom-dom-1.2.7.jar;
C:\AXIS2\axis2-1.4.1\lib\axiom-impl-1.2.7.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-adb-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-adb-codegen-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-ant-plugin-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-clustering-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-codegen-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-corba-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-fastinfoset-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-java2wsdl-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-jaxbri-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-jaxws-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-jaxws-api-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-jibx-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-json-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-jws-api-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-kernel-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-metadata-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-mtompolicy-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-saaj-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-saaj-api-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-spring-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\axis2-xmlbeans-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\backport-util-concurrent-3.1.jar;
C:\AXIS2\axis2-1.4.1\lib\commons-codec-1.3.jar;
C:\AXIS2\axis2-1.4.1\lib\commons-fileupload-1.2.jar;
C:\AXIS2\axis2-1.4.1\lib\commons-httpclient-3.1.jar;
C:\AXIS2\axis2-1.4.1\lib\commons-io-1.4.jar;
C:\AXIS2\axis2-1.4.1\lib\commons-logging-1.1.1.jar;
C:\AXIS2\axis2-1.4.1\lib\geronimo-annotation_1.0_spec-1.1.jar;
C:\AXIS2\axis2-1.4.1\lib\geronimo-stax-api_1.0_spec-1.0.1.jar;
C:\AXIS2\axis2-1.4.1\lib\httpcore-4.0-beta1.jar;
C:\AXIS2\axis2-1.4.1\lib\httpcore-nio-4.0-beta1.jar;
C:\AXIS2\axis2-1.4.1\lib\jalopy-1.5rc3.jar;
C:\AXIS2\axis2-1.4.1\lib\jaxb-api-2.1.jar;
C:\AXIS2\axis2-1.4.1\lib\jaxb-impl-2.1.6.jar;
C:\AXIS2\axis2-1.4.1\lib\jaxb-xjc-2.1.6.jar;
C:\AXIS2\axis2-1.4.1\lib\jaxen-1.1.1.jar;
C:\AXIS2\axis2-1.4.1\lib\jettison-1.0-RC2.jar;
C:\AXIS2\axis2-1.4.1\lib\jibx-bind-1.1.5.jar;
C:\AXIS2\axis2-1.4.1\lib\jibx-run-1.1.5.jar;
C:\AXIS2\axis2-1.4.1\lib\log4j-1.2.15.jar;
C:\AXIS2\axis2-1.4.1\lib\mail-1.4.jar;
C:\AXIS2\axis2-1.4.1\lib\mex-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\neethi-2.0.4.jar;
C:\AXIS2\axis2-1.4.1\lib\soapmonitor-1.4.1.jar;
C:\AXIS2\axis2-1.4.1\lib\woden-api-1.0M8.jar;
C:\AXIS2\axis2-1.4.1\lib\woden-impl-dom-1.0M8.jar;
C:\AXIS2\axis2-1.4.1\lib\wsdl4j-1.6.2.jar;
C:\AXIS2\axis2-1.4.1\lib\wstx-asl-3.2.4.jar;
C:\AXIS2\axis2-1.4.1\lib\xalan-2.7.0.jar;
C:\AXIS2\axis2-1.4.1\lib\xercesImpl-2.8.1.jar;
C:\AXIS2\axis2-1.4.1\lib\xml-apis-1.3.04.jar;
C:\AXIS2\axis2-1.4.1\lib\xml-resolver-1.2.jar;
C:\AXIS2\axis2-1.4.1\lib\xmlbeans-2.3.0.jar;
C:\AXIS2\axis2-1.4.1\lib\XmlSchema-1.4.2.jar;
5. Set up the file log4j.properties which displays additional information when running code in command line.
a) Location of Information: http://logging.apache.org/log4j/1.2/manual.html
b) Create File named: 'log4j.properties' in C:\EWSSample\ShippingService-Create\Development\src directory with the following information.
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Please assist. Cheers!
I was trying to build OpenJDK 9 in Centos 5. I used
sh ./configure --disable-warnings-as-errors
make all
I am getting the following error.
Building target 'all' in configuration 'linux-x86_64-normal-server-release'
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
/usr/bin/objcopy: '/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so': No such file
gmake[3]: *** [/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so] Error 1
gmake[2]: *** [java.base-libs] Error 2
ERROR: Build failed for target 'all' in configuration 'linux-x86_64-normal-
server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_java.base_libjava_BUILD_LIBJAVA_link:
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
* All command lines available in /root/jdk9/build/linux-x86_64-normal-
server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See common/doc/building.html#troubleshooting for assistance.
make[1]: *** [main] Error 2
make: *** [all] Error 2
I also tried other make targets such as make images and make install. But still getting the same error. My GCC version is gcc (GCC) 4.4.7 which I manually installed because Centos 5 by default has an older version.
Building JDK requires at least GCC 5.0 (see Building the JDK: CC).
This seems to be a problem in the glibc version (see redhat-issue, util-linux). So, updating your glibc to the latest version might solve it.
If you don't want to update your system's glibc, here is another alternative:
By looking at the man page of fallocate, we find that the description mentions that posix_fallocate(3) is a portable, POSIX.1-specified version of it, in case the mode parameter has the default value (0). The same applies to fallocate64.
Since all the occurrences of the aforementioned error already use the default mode value, you can replace them with posix_fallocate64() (instead of commenting them out as you mentioned in another comment).
The denoted man page says that:
This default behavior [of fallocate with mode=0] closely resembles the
behavior of the posix_fallocate(3) library function, and is intended
as a method of optimally implementing that function.
[install4j] WARNING: Error on output: java.io.IOException: com/sun/codemodel/JCodeModel.build(L) contains a bytecode 00039: invokeinterface InterfaceMethodref:83 Con:256 with an unsupported constant reference; please use the pass-file option on this class.
I have started getting this error suddenly while running the installer build. I have not changed any configurations.
I am unable to figure out the root cause for this issue. Can someone help? Thanks!
This is a message from Pack200, which may not be able to pack all JAR files. Maybe you have changed the JRE version. You can switch off Pack200 compression on the "General Settings->Media file" options. Alternatively, if the JAR file has the name codemodel.jar, you can create an empty file codemodel.jar.nopack to disable Pack200 compression just for that JAR file.
If I run JNAerator using the header for my library, the process gobbles processor time and never seems to finish - after first issuing warnings:
adrian$ java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar /Users/adrian/DRAMSim2/DRAMSim.h -mode StandaloneJar
Warning: no -library option for file 'DRAMSim.h', using "DRAMSim".
Auto-configuring parser...
Parsing native headers...
/usr/include/sys/cdefs.h:74:25: warning: #warning "Unsupported compiler detected"
/usr/include/_types/_wctype_t.h:30:19: warning: No newline before end of file
So, I have also tried the -ScanSymbols option:
java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar -scanSymbols -mode StandaloneJar
Auto-configuring parser...
Parsing native headers...
Normalizing parsed code...
Generating libraries...
Compiling JNAerated files...
[....]
Copying runtime classes...
Generating out.jar
#
# SUCCESS: JNAeration completed !
# Output mode is 'StandaloneJar(JAR with bindings and runtime dependencies)
#
# => '/Users/adrian/groovy/simul/src/simul/./out.jar'
And out.jar has a great many .class files but no .java and I have no idea how to use it.
Using -noComp -noJar as suggested in the wiki generates no output at all ...
adrian$ java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar -scanSymbols -noComp -noJar
WARNING: option (?i)-noComp is deprecated and might be removed in future versions.
WARNING: option (?i)-noJar is deprecated and might be removed in future versions.
WARNING: legacy options (?i)-noJar and (?i)-noComp used, defaulting -mode to Directory
Auto-configuring parser...
Parsing native headers...
Normalizing parsed code...
Generating libraries...
#
# SUCCESS: JNAeration completed !
# Output mode is 'Directory(Bindings sources in simple file hierarchy)
#
# => '/Users/adrian/groovy/simul/src/simul/.'
What am I doing wrong? Or is this a hopeless case?
When I compile my below java code,
Window w = c instanceof Window ? (Window) c : SwingUtilities.getWindowAncestor(c);
WindowPeer peer = (WindowPeer) w.getPeer();
I'm getting below warning message:
warning: WindowPeer is internal proprietary API and may be removed in a future release
Any idea how to solve this issue?
I'm using JDK 1.6 and I tried 1.7 also.
Here are two ways to suppress the warning.
Suppressing the warning is not recommended, though, and the warning message text tells you why.
Approach #1 (the simplest) is to run
javac -XDignore.symbol.file ...
which will compile your program against Sun's internal rt.jar rather than the public-facing symbol file ct.sym.
Approach #2a is to run
javac -XDenableSunApiLintControl -Xlint:-sunapi ...
This still issues a "note" but not a warning.
Approach #2b is to suppress the warning and the note by writing
#SuppressWarnings("sunapi")
in the source code, but this still requires you to run javac as follows:
javac -XDenableSunApiLintControl ...