The ArtOfBI.com Newsletter

Is stupid new and freshly informative on BI and EPM.

Save one little gremlin by not pouring water on its head.

Or, sign up for killer tips, tricks and other BI / EPM goodness delivered right to your inbox.

Hell just do both. Enter your email below.

Oh no what happened?
I already signed up.

BTW, Signing up gets rid of this annoying banner.

Cheers,
Christian & The ArtOfBi.com Team

Art of Business Intelligence > Business Intelligencetitle_li=Linuxtitle_li=NetBeans

Archive | NetBeans

Obsfucating or Preventing Decompiling of Your Java Code

So, when creating a non open source Java application or library where you do not want the uncompiled code assessable, there seems to only be one way to truly achieve this.  That is through obsfucating your code at compile time. Preferably this is done using an obfuscation tool and integrating it into the ANT build process (build.xml). There are a few pay, free, and open-source solutions that will help a developer accomplish this.

I wanted to focus on the free/OSS solution for this and since NetBeans is my Java IDE of choice I stayed close to that combined solution.  What I found was that the main solutions to obsfucate are proguard, yGuard, and RetroGuard.

I like the idea of going with the open-source concept of proguard (or some mod) as this seems like what a lot of vendors such as Oracle are using within several of their applications/tools.

There are a few tutorials such as this one from Geertjan at Oracle a few years back.  Clearly, if Oracle is pushing this strategy it is probably a good way to go.  Check the comments on that blog post to see that some people have even attempted to use deobfsfucator/decompilers tools such as JD to no avail.  I like it!

References:

Posted in Business Intelligence, Linux, NetBeansComments (2)

Deploy to two different application servers in real-time using Build.xml

Working on a JEE application, I had a situation where I was using NetBeans as my Java IDE and GlassFish Server as the application server.  Testing in GlassFish was easy but I needed to also test the same application in a WebLogic Server instance at the same time in real time.  Real-time here meaning that as soon as I made a change to a file in my NetBeans IDE that it would be reflected in my development app server connected already to Netbeans, GlassFish, and then updating a deployed Web Application in WebLogic Server.

This is where ANT comes in.  ANT of course is like Make but written for Java.

Anyway, in NetBeans you can simply update the build.xml file which ultimately can add or override existing target settings for the ANT build process.  The script below perfectly takes the compiled build directory files I required for this scenario from the application’s build directory and copies them to the WebLogic Server deployed application reference directory.   By right-clicking the NetBeans project and selecting the “Build” option, the build immediately hits these overridding target nodes in the ANT build.xml file and copies compiled application files where I need them.  This completely eliminates any manual copy and pasting. Sweet!


<target name="-post-compile">
<copy todir="C:\\oracle\\WLS\\DeployedAppDir\\">
<fileset dir="${build.web.dir}"/>
</copy>

</target>
<target name="-post-dist">
<copy todir="C:\\oracle\\WLS\\DeployedAppDir_WAR\\">
<fileset dir="${dist.jar.dir}"/>
</copy>
</target>

Resources:

http://blogs.oracle.com/roumen/entry/netbeans_quick_tip_4_extending

Posted in NetBeans, WebLogicComments (0)

My name is Christian Screen, a Business Intelligence mastermind working with mainly Oracle and Microsoft technologies. The views expressed here are my own and do not reflect the views of Oracle, Microsoft, or my employer. RSS