Jump to content
Excelsior Forums
sampah03

Compile Netbeans

Recommended Posts

How to compile Netbeans (5.0 beta preferred)?

I tried to compile using 3 classpaths: platform6/lib/*.jar but it cannot run, the error message is:

Exception in thread "main" java.lang.ClassNotFoundException: org.netbeans.core.s

tartup.Main

       at java.lang.Void.<unknown>(Unknown Source)

       at java.lang.Void.<unknown>(Unknown Source)

       at java.lang.Void.<unknown>(Unknown Source)

       at java.lang.Void.<unknown>(Unknown Source)

Seems like it has dynamic class loading etc.

Can anyone help me? I think it's very good to have compiled Netbeans, since it's very slow and sluggish.

Share this post


Link to post
Share on other sites

Before using Excelsior JET for compiling NetBeans, try to determine its command line and run it under HotSpot through the "java.exe" launcher

Share this post


Link to post
Share on other sites

OK, done.

The command line is:

java "-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade" "-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense" "-Xms32m" "-Xmx128m" "-XX:PermSize=32m" "-XX:MaxPermSize=96m" "-ea" "-Dapple.laf.useScreenMenuBar=true" "-Dnetbeans.osenv=d:\syuh\nbenv2" "-Dnetbeans.osenv.nullsep=true" "-Djdk.home=D:\prog\jdk" "-Dnetbeans.home=D:\prog\netbeans5\platform6" "-Dnetbeans.dirs=D:\prog\netbeans5\nb5.0;D:\prog\netbeans5\ide6;D:\prog\netbeans5\enterprise2;D:\prog\netbeans5\harness" "-Dnetbeans.user=C:\Documents and Settings\Owner\.netbeans\5.0beta" "-Dsun.awt.keepWorkingSetOnMinimize=true" -cp "D:\prog\netbeans5\platform6\lib\boot.jar;D:\prog\netbeans5\platform6\lib\org-openide-modules.jar;D:\prog\netbeans5\platform6\lib\org-openide-util.jar;D:\prog\jdk\lib\dt.jar;D:\prog\jdk\lib\tools.jar" org/netbeans/Main "--branding" "nb"

where D:\prog\netbeans5 is where I installed netbeans to.

The next step?

Share this post


Link to post
Share on other sites

After I tried using xjava, Netbeans runs (the splash screen shows), but after having about 90 MB of files in the jitcache directory, nothing is happened. The splash screen still repaints, saying "Loading modules". But the CPU usage is 0% and nothing can be done.

Any other method? or something to do?

Share this post


Link to post
Share on other sites

I had tried both 5.0 beta and 4.1.

The one I described above is for 5.0beta.

I tried once again using 4.1, after some minutes, the CPU stays at 100% but no new files at jitcache is produced. Using filemon, I found that xjava is writing to $(netbeans home dir)/var/log/messages.log, a lot of message like this:

java.lang.InternalError: JIT ERROR: (RT) couldn't generate DLL name

     at java.lang.Void.<unknown>(Unknown Source)

     at java.lang.Void.<unknown>(Unknown Source)

     at java.lang.Void.<unknown>(Unknown Source)

     at java.lang.Void.<unknown>(Unknown Source)

, and it repeats even after I waited 15 minutes with 100% CPU.

What can I do about that?

Share this post


Link to post
Share on other sites

We have reproduced the defect on our end and now we are looking into it.

The problem appears only if NetBeans runs on a box with HyperThread CPU.

It escaped our QA testing when releasing JET 4.0 because we tested NetBeans on a machine with an ordinary CPU (Intel Celeron.)

Thanks a lot for your help. We  will keep you posted on our analysis of the problem.

Take care,

ZZTop

B)

Share this post


Link to post
Share on other sites

We have isolated the problem. NetBeans runs into a deadlock during intensive custom classloading performed concurrently in multiple threads.

The conditions of its appearance are very subtle so it does not appear on other applications that heavily use custom class loaders, such as Eclipse, Tomcat, and JBoss even though they run on HyperThread or SMP hardware.

We have started fixing the defect.

Thanks again for your help.

Share this post


Link to post
Share on other sites

Thanks very much for your investigation, I hope you can fix the problem soon.

BTW, my processor is a single Pentium 4 mobile without Hyperthreading.

Please let me know if you have been successful in compiling NetBeans and please let me know how to do it correctly.

Thanks again!

Share this post


Link to post
Share on other sites
BTW, my processor is a single Pentium 4 mobile without Hyperthreading

It seems that probability of reproducing the problem on parallel harware is much higher

Thanks very much for your investigation, I hope you can fix the problem soon.

It may take some time because fixing this sort of problems requires refactoring and thourough testing.

Please let me know if you have been successful in compiling NetBeans and please let me know how to do it correctly.

Sure.

--ZZ Top

Share this post


Link to post
Share on other sites

Hi, I was very happy yesterday when I opened this forum and found that you have released a new version that fixes the problem.

Today I eagerly tried to compile netbeans 5.0 FINAL (not beta anymore) using xjava, with command line:

xjava -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xms32m -Xmx128m -Dnetbeans.osenv=d:\syuh\nbenv2 -Dnetbeans.osenv.nullsep=true -Djdk.home=d:\prog\jdk -Dnetbeans.home=D:\prog\netbeans5\platform6 -Dnetbeans.dirs=D:\prog\netbeans5\nb5.0;D:\prog\netbeans5\ide6;D:\prog\netbeans5\enterprise2;D:\prog\netbeans5\harness -Dnetbeans.user="C:\Documents and Settings\Owner\.netbeans\5.0" -Dnetbeans.system_http_proxy=DIRECT -Dsun.awt.keepWorkingSetOnMinimize=true -cp D:\prog\netbeans5\platform6\lib\boot.jar;D:\prog\netbeans5\platform6\lib\org-openide-modules.jar;D:\prog\netbeans5\platform6\lib\org-openide-util.jar;d:\prog\jdk\lib\dt.jar;d:\prog\jdk\lib\tools.jar org/netbeans/Main --branding nb

Netbeans splash screen showed, then I waited about one hour before I realized that the CPU usage had dropped to 0%, and there were about 10500 files in jitcache directory. I pressed ctrl+c to end the program.

Then I ran it using -Xcompile, and I got an error. The last lines of the output was:

9464/10409: org.netbeans.editor.ext.html.dtd.DTDParser$1__0.class

9465/10409: org.netbeans.editor.ext.html.dtd.DTDParser$MultiContentNodeImpl__0.class

* [ *** F432 ]

*? file close error: .\sym/org.netbeans.editor.ext.html.dtd.DTDParser$MultiContentNodeImpl__0.sym

Compilation failed.

My CPU is Pentium 4 M (single threading), Windows XP Home without any SP,

java version "1.5.0_01"

Java 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)

Java HotSpot Client VM (build 1.5.0_01-b08, mixed mode).

I would greatly appreciate it if you could make a tutorial on compiling Netbeans in addition of compiling Eclipse which you already had.

Thank you.

Share this post


Link to post
Share on other sites

Hello,

Usually, the file close error means that you are running out of disk space.

We have tested the Netbeans 4.1 and it works fine with JET.

I'll check the Netbeans 5.0 in the near future and will post the results.

-AlexM

Share this post


Link to post
Share on other sites

Hello,

I've downloaded Netbeans 5.0 and tested it with JET 4.1.

I've introduced several substitutions into your command line, so that anybody could try it with its own placements of Netbeans and JDK.

set netbeans_home=D:\JavaProg\netbeans-5.0
set jdk_dir=D:\Lang\jdk1.5.0_04
xjava -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xms32m -Xmx128m -Dnetbeans.osenv=%netbeans_home%\nbenv2 -Dnetbeans.osenv.nullsep=true -Djdk.home=%jdk_dir% -Dnetbeans.home=%netbeans_home%\platform6 -Dnetbeans.dirs=%netbeans_home%\nb5.0;%netbeans_home%\ide6;%netbeans_home%\enterprise2;%netbeans_home%\harness -Dnetbeans.user="%USERPROFILE%\.netbeans\5.0" -Dnetbeans.system_http_proxy=DIRECT -Dsun.awt.keepWorkingSetOnMinimize=true -cp %netbeans_home%\platform6\lib\boot.jar;%netbeans_home%\platform6\lib\org-openide-modules.jar;%netbeans_home%\platform6\lib\org-openide-util.jar;%jdk_dir%\lib\dt.jar;%jdk_dir%\lib\tools.jar org.netbeans.Main --branding nb

Running this command line results in start of Netbeans after about 20 minutes of the full CPU load (P4 1,5 GHz). It didn't hang, the IDE is opened and worked flawlessly. I've played with Netbeans a little, and closed it.

After that, I've run the same command line, adding "-Xcompile" switch.

The compilation took a while (several hours), and no errors were issued.

After the recompilation Netbeans starts quite fast and works flawlessly.

Also, consider using JET project file to recompile JIT cache of Netbeans.

As an example, you can use the project file EclipseCache.prj from the articles "HOWTO: Compile Eclipse Platform with Excelsior JET", available at http://www.excelsior-usa.com/kb/000010.html

Note, that your system does not meet the system requirements, as it hasn't Windows service packs installed. JET supports Windows XP SP1 and SP2, and Netbeans requires Windows XP SP2 (see http://www.netbeans.org/community/releases/50/relnotes.html#SystemRequirements)

Also, please, ensure that you are using the latest version of JET by issuing the following command:

xjava -version

-AlexM.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×