While building a JAR file (successfully) in Netbeans 7.1.1, I encountered this warning:
...
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
...
What does this mean? Also, does the Java runtime affect the compatibility of the JAR (application)?
When I run the JAR in XP and Ubuntu, the application seems fine, but when I try to run it on Fedora, it doesn’t use the full screen and has no context menu when I right click on a JTable. What should I do about this?
Some code snippets:
This code calls a JFrame a setting it to fullscreen when loaded but this doesn’t work in Fedora.
this.setVisible(false);
frmMain xForm = new frmMain();
xForm.setLocationRelativeTo(null);
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
xForm.setMaximizedBounds(e.getMaximumWindowBounds());
xForm.setExtendedState(xForm.getExtendedState()|JFrame.MAXIMIZED_BOTH );
xForm.setVisible(true);
When I right click the JTable to show a contextmenu works fine in Windows but not in fedora and Ubuntu.
private void tableItemMouseReleased(java.awt.event.MouseEvent evt) {
if ( SwingUtilities.isRightMouseButton( evt ))
{
int r = tableItem.rowAtPoint(evt.getPoint());
if (r >= 0 && r < tableItem.getRowCount())
{
tableItem.setRowSelectionInterval(r, r);
}
else
{
tableItem.clearSelection();
}
int rowindex = tableItem.getSelectedRow();
if (rowindex < 0)
return;
if (evt.isPopupTrigger() && evt.getComponent() instanceof JTable )
{
pmItem.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
}
UPDATE 1
by adding -Xlint:unchecked in Compile options, I got this warnings:
warning: [options] bootstrap class path not set in conjunction with -source 1.6
C:\Documents and Settings\Totet\My Documents\NetBeansProjects\DCWD_DepreciationMonitoringSystem\src\DCWDDMS\frmItemDepreciation.java:432:
warning: [unchecked] unchecked call to addElement(E) as a member of the raw type Vector
newRow.addElement(rs.getObject(i));
where E is a type-variable:
E extends Object declared in class Vector
C:\Documents and Settings\Totet\My Documents\NetBeansProjects\DCWD_DepreciationMonitoringSystem\src\DCWDDMS\frmMain.java:351:
warning: [unchecked] unchecked call to addElement(E) as a member of the raw type Vector
newRow.addElement(rs.getObject(i));
where E is a type-variable:
E extends Object declared in class Vector
C:\Documents and Settings\Totet\My Documents\NetBeansProjects\DCWD_DepreciationMonitoringSystem\src\DCWDDMS\frmNewItem.java:831:
warning: [unchecked] unchecked call to addElement(E) as a member of the raw type DefaultComboBoxModel
model.addElement(resultList.getString(1));
where E is a type-variable:
E extends Object declared in class DefaultComboBoxModel
C:\Documents and Settings\Totet\My Documents\NetBeansProjects\DCWD_DepreciationMonitoringSystem\src\DCWDDMS\frmNewItem.java:833:
warning: [unchecked] unchecked call to setModel(ComboBoxModel<E>) as a member of the raw type JComboBox
cmbAccount.setModel(model);
where E is a type-variable:
E extends Object declared in class JComboBox
5 warnings
Source/Binary format setting
Here is explicit way to set source and target of your project explicitly. Most of the time, you do not need to fiddle with this, once you set up your project specific Java platform in netbeans.
Unsafe operations warning
I generally ignore the “unsafe operation warning”. But if you want to know why it is shown, do recompile with
-Xlint:uncheckedoption (at step 5 above) and it will explain what and why is reported as unsafe.UI issues in Fedora
On Fedora check your path to make sure you are not running the default GNU Java run time.
go to command line and type
java -versionto see what it returns. It must return Oracle’s (sun) java information. Otherwise you will face issues especially with Swing/UI stuff.