Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Hacking the NetBeans IDE

[BOF1338]
Mark Stephens
Talk structure
• About me

• NetBeans

• Technical aspects

• Code and feedback/lessons learned/tips

• Q & A

• 42 slides (answer to the ultimate question).


About me
• Started on Java 1.0 and wrote my first Java code in 1996

• Wrote some code for my University project which got a bit out of hand!

• Founder and CEO of IDRsolutions - develop Java software to display PDF

• Do not work for Oracle and my opinions are my own

• Used JBuilder, VisualCafe, Forte, Eclipse, NetBeans and Intellij

• 11 years I attended a talk at JavaOne on IDEs way over my head

• Degree in Mediaeval history….


NetBeans
• Started life as student project

• Purchased by Sun

• Moved to Oracle

• Donated to Apache by Oracle

• OpenSource most of its life

• Much easier to get involved under the Apache umbrella…


NetBeans owned by the Community

https://cwiki.apache.org/confluence/display/NETBEANS/Who%27s+Who
Technical aspects
Just extending NetBeans
Technical specs
• Code on github

• Documentation/Issues on Confluence/Jira

• Apache license and governance

• Builds under Ant

• Java8 and above

• Code level 1.6

• Disappointed I cannot yet use lambda/streams/etc…


Getting NetBeans up
and running
Download or fork

https://github.com/apache/netbeans
Source code
Running code

https://github.com/apache/netbeans
NetBeans code
• Lots of new domain knowledge

• Code is very modularised and features split across

• Code can be very abstract - ie actions

• Loose coupling - Lookup

• Swing app so not always easy to follow flow in debug with threads

• Choosing when to ‘fudge’


Time to dive in…
Scratching my itch
Code time
Local History
DataSystems API
Versioning UI
My todo list
• Tidy up my hacky code before the NetBeans team sees it

• Recursive selection of Nodes directories

• Some bugs to fix.

• Testing

• Request a code review…


Hints and tips
NetBeans Java version
Keeping your fork updated

git remote -v

git remote add upstream https://github.com/apache/netbeans.git

git remote -v

git fetch upstream

git checkout master

git merge upstream/master

git push
Always use latest version

java.lang.AssertionError: Already had dead JAR: /var/folders/9c/qqy6vtdn3m74hn92p73q373w0000gp/T/org-netbeans-modules-


project-ant5199247474261787800.jar

at org.netbeans.JarClassLoader$JarSource.destroy(JarClassLoader.java:675)

at org.netbeans.JarClassLoader.destroy(JarClassLoader.java:316)

at org.netbeans.StandardModule.classLoaderDown(StandardModule.java:556)

at org.netbeans.ModuleManager.enable(ModuleManager.java:1398)

at org.netbeans.ModuleManager.enable(ModuleManager.java:1254)

at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)

at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)

at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:298)

at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)

at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)

at org.netbeans.core.startup.Main.start(Main.java:282)

at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)

at java.lang.Thread.run(Thread.java:744)

/Users/markee/NetBeansProjects/incubator-netbeans/nbbuild/nbproject/nbjdk.xml:43: The following error occurred while executing


this line:

/Users/markee/NetBeansProjects/incubator-netbeans/nbbuild/build.xml:1115: exec returned: 2


Recommended Bedtime
reading

https://leanpub.com/nbp4beginners
Q and A
Thank-you
• https://netbeans.apache.org/

• https://github.com/apache/netbeans

• markstephens@idrsolutions.com / @markee174

• I will publish slides on blog.idrsolutions.com and upload to OracleWorld

• and a shameless plug for

You might also like