Вы находитесь на странице: 1из 8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

Choosepagelanguage

NetBeansIDE NetBeansPlatform Enterprise Plugins Docs&Support


Community

Search

HOME/Docs&Support

UsingOracleJavaSEEmbedded
SupportinNetBeansIDE
WrittenbyTomasZezulaandAlyonaStashkova

Training

OracleJavaStandardEditionEmbedded(OracleJavaSEEmbedded)enables
userstodevelophighlyfunctional,reliableandportableapplicationsforpowerful
embeddedsystems.NetBeansIDEsupportsJavaSEEmbeddedfeatures,such

JavaProgramming
Language

asfootprint,memory,power,platformsupport,etc.
Inthistutorial,youwilllearnhowtogetstartedwithJavaSEEmbeddedin

Support

NetBeansIDEandhowtousetheIDEsupportforJavaSEEmbedded.
Contents
SettingUpaRemotePlatforminNetBeansIDE

OracleDevelopmentTools
SupportOfferingfor
NetBeansIDE

CreatingandRunningaProjectintheIDE
ConfiguringaProjecttoUseaRemotePlatform
RunningaProjectonaRemotePlatfrom
SeeAlso
Tocompletethistutorial,youneedthesoftwareandresourceslistedinthe
followingtable.
SoftwareorResource

VersionRequired

NetBeansIDE

version8.0

JavaDevelopmentKit(JDK) version7or8

SettingUpaRemotePlatforminNetBeansIDE
OnceOracleJavaSEEmbeddedruntimeisdownloadedandinstalledonyour

Documentation
GeneralJavaDevelopment
ExternalToolsand
Services
JavaGUIApplications
JavaEE&JavaWeb
Development
WebServicesApplications
NetBeansPlatform(RCP)
andModuleDevelopment
PHPandHTML5
Applications
C/C++Applications
MobileApplications

remotemachine(RaspberryPiisusedfordemonstrationpurposesinthis
tutorial),youneedtosetupNetBeansIDEwiththeremoteplatformasfollows:
activatetheJavaSEfeatureinNetBeansIDE

SampleApplications
DemosandScreencasts

installaremoteJavaSEplatforminNetBeansIDE
Note:TheremoteoperatingsystemmustbeUNIX.Windowsisnot
supported.

More
FAQs
ContributeDocumentation!

ToactivatetheJavaSEfeatureintheIDE:

DocsforEarlierReleases

1.ChooseTools>PluginsfromthemainIDE'stoolbar.
2.InthePluginsdialogbox,clicktheInstalledtabandselectJavaSEinthe
listofavailablefeatures.

https://netbeans.org/kb/docs/java/javaseembedded.html

1/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

3.ClickActivate.
4.AttheWelcomepaneloftheInstallerdialogbox,clickActivate.
5.Whentheactivationissuccessfullycompleted,clickFinish.
6.ClickClosetoclosethePluginsdialogbox.
ToinstallaremoteJavaSEplatforminNetBeansIDE:
1.ChooseTools>JavaPlatforms.
TheJavaPlatformManagerdialogboxdisplays.

2.ClickAddPlatform.
3.IntheSelectPlatformTypeoftheAddJavaPlatformwizard,select
RemoteJavaStandardEditionandclickNext.
TheIDEdisplaystheAddJavaPlatformdialogbox.

https://netbeans.org/kb/docs/java/javaseembedded.html

2/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

4.Specifytheremoteplatformdetailssuchasthename,theIPaddressor
DNSnameofthedevice,login,password,andthepathtotheJREonthe
remotedevice.
Note:ThetargetoperatingsystemmustbeUNIX(Windowsisnot
supported).
5.ClickFinish.TheIDEvalidatestheremoteJREbyexecutingaprobeand
downloadstheremoteJREsystemproperties.
AnewremoteJavaSEplatformdisplaysintheJavaPlatformManager
dialogbox.

NowyourNetBeansIDEissetupforremoteJavaSEdevelopment.

CreatingandRunningaProjectintheIDE
NowletuscreateaprojectthatisgoingtobefirstrunintheIDEandthenonthe
remoteplatform.
Tocreateaproject:
1.IntheIDE,chooseFile>NewProject.
https://netbeans.org/kb/docs/java/javaseembedded.html

3/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

2.IntheNewProjectwizard,choosetheJavacategoryandselectJava
ApplicationintheProjectslist.ClickNext.
3.IntheNameandLocationpageofthewizard,dothefollowing:
IntheProjectNamefield,typeEmbeddedCalculator.
LeavetheUseDedicatedFolderforStoringLibrariescheckbox
unselected.
IntheCreateMainClassfield,type

embeddedcalculator.EmbeddedCalculator.

4.ClickFinish.
TheIDEcreatesandopenstheJavaSEprojectintheProjectswindow.
5.Replacethe//TODOcodeapplicationlogicherelinewith
thefollowingcode:

inta=1
intb=2
intc=a+b
System.out.println(c)
6.SaveyourchangesbychoosingFile>Save.
Totestyourapplication,rightclicktheprojectnameandchooseRunfromthe
contextmenu.ThecalculatedoutputcanbeviewedintheOutputwindow
(Window>Output).

ConfiguringaProjecttoUseaRemotePlatform
TodevelopaJavaSEembeddedapplicationonaremoteplatformusing
compact1,compact2,orcompact3runtimeplatforms,JDK8needstobe
registeredintheIDE.

https://netbeans.org/kb/docs/java/javaseembedded.html

4/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

ToenableJDK8supportinNetBeansIDE:
1.IntheIDE,chooseTools>JavaPlatformsfromthemainmenu.
2.ClickAddPlatformintheJavaPlatformManagerdialog.
3.IntheAddJavaPlatformdialog,selectJavaStandardEditionandclick
Next.
4.SpecifythedirectorythatcontainstheJDKandclickNext.

5.VerifythatthedefaultlocationsoftheplatformsourceszipfileandAPI
documentationarevalid.ClickFinishtoclosetheAddJavaPlatform
dialogbox.
JDK8isregisteredasaplatformintheIDE.

6.ClickClose.
ToconfigureyourprojecttouseJDK8:
1.RightclicktheEmbeddedCalculatorprojectintheProjectswindowand
selectPropertiesfromthecontextmenu.
2.IntheProjectPropertiesdialogbox,choosetheLibrariescategoryandset
JDK1.8astheJavaPlatform.

https://netbeans.org/kb/docs/java/javaseembedded.html

5/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

3.SelecttheSourcescategoryandsetSource/BinaryFormattoJDK8.

4.Specifytheprofilethatisusedasruntimeonaremoteplatform(for
example,Compact2).

5.ClickOKtosavethechanges.
Yourprojectissettorecognizeaparticularruntimeonaremoteplatform.

RunningaProjectonaRemotePlatfrom
https://netbeans.org/kb/docs/java/javaseembedded.html

6/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

Youcanrunanddebugtheapplicationonaremotedeviceaftersettingthe
projectconfigurationtoaconfigurationdifferentfromthedefaultone.
Tocreateanewconfiguration:
1.RightclicktheprojectnameintheProjectswindowandselectProperties
fromthecontextmenu.
2.ChoosetheRuncategory.
3.ClickNewtotherightoftheConfigurationdropdownlist.
4.IntheCreateNewConfigurationdalogbox,specifythenameofanew
configurationandclickOK.
5.SelecttheruntimeplatformnameintheRuntimePlatformdropdownlist.

6.ClickOKtosaveyouredits.
Ifyouruntheprojectonaremoteplatform(Run>RunProject(projectname)),
theoutputwilllooksimilartowhatisshowninthefigurebelow.

Toswitchbetweenprojectconfigurations:
ChooseRun>SetProjectConfiguration>configurationnameorright
clicktheprojectnameandchooseSetConfiguration>configuration
namefromthecontextmenu.

SendFeedbackonThisTutorial
https://netbeans.org/kb/docs/java/javaseembedded.html

7/8

28/01/2017

UsingOracleJavaSEEmbeddedSupportinNetBeansIDE

SeeAlso
JavaSEEmbeddedDocumentation
JavaSEEmbeddedDevelopmentMadeEasyPart1of2
JavaSEEmbeddedDevelopmentMadeEasyPart2of2
GettingStartedwithJavaSEEmbeddedontheRaspberryPi

SiteMap

AboutUs

Contact

Legal&Licences
Byuseofthiswebsite,youagreetotheNetBeansPoliciesandTermsofUse.2017,OracleCorporationand/oritsaffiliates.
Sponsoredby

https://netbeans.org/kb/docs/java/javaseembedded.html

8/8

Вам также может понравиться