如何在Borland JBuilder 2005/2006中增加javac进程的最大堆大小

时间:2022-07-11 07:19:30

In most modern IDEs there is a parameter that you can set to ensure javac gets enough heap memory to do its compilation. For reasons that are not worth going into here, we are tied for the time being to JBuilder 2005/2006, and it appears the amount of source code has exceeded what can be handled by javac.

在大多数现代IDE中,您可以设置一个参数来确保javac获得足够的堆内存来进行编译。由于不值得进入的原因,我们暂时与JBuilder 2005/2006并列,看起来源代码的数量超过了javac可以处理的数量。

Please keep the answer specific to JBuilder 2005/2006 javac (we cannot migrate away right now, and the Borland Make compiler does not correctly support Java 1.6)

请保留JBuilder 2005/2006 javac的具体答案(我们现在无法迁移,Borland Make编译器不能正确支持Java 1.6)

I realize how and what parameters should be passed to javac, the problem is the IDE doesn't seem to allow these to be set anywhere. A lot of configuration is hidden down in the Jbuilder Install\bin*.config files, I feel the answer may be in there somewhere, but have not found it.

我知道应该如何以及将什么参数传递给javac,问题是IDE似乎不允许在任何地方设置这些参数。很多配置都隐藏在Jbuilder Install \ bin * .config文件中,我觉得答案可能在某处,但还没有找到。

6 个解决方案

#1


6  

did you find a good solution for that problem?

你找到了解决这个问题的好方法吗?

I have the same problem and the only solution I found is the following: The environment variable JAVA_TOOL_OPTIONS can be used to provide parameters for the JVM.

我遇到了同样的问题,我找到的唯一解决方案如下:环境变量JAVA_TOOL_OPTIONS可用于为JVM提供参数。

http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html#tooloptions

I have created a batch file "JBuilderw.bat" with the following content:

我创建了一个批处理文件“JBuilderw.bat”,其中包含以下内容:


set JAVA_TOOL_OPTIONS=-Xmx256m

JBuilderw.exe


Each time I start JBuilder using this batch file the env.var. JAVA_TOOL_OPTIONS will be set and javac.exe will receive the setting. The JVM displays at the end the following message: "Picked up JAVA_TOOL_OPTIONS: -Xmx256m"

每次我使用这个批处理文件env.var启动JBuilder。将设置JAVA_TOOL_OPTIONS并且javac.exe将接收该设置。 JVM最后显示以下消息:“拾起JAVA_TOOL_OPTIONS:-Xmx256m”

Drawback: all virtual machines started by JBuilder will get that setting. :(

缺点:JBuilder启动的所有虚拟机都将获得该设置。 :(

Thanks, JB

#2


0  

Have a look at http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html

看看http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html

The arguments that you need to pass to JBuilder's javac is "-J-Xms256m -J-Xmx256m". Replace the 256m with whatever is appropriate in your case. Also, remove the quotes.

您需要传递给JBuilder的javac的参数是“-J-Xms256m -J-Xmx256m”。在你的情况下用适当的东西替换256米。另外,删除引号。

This should work for java 1.4, java 1.5 and forward.

这适用于java 1.4,java 1.5和forward。

BR, ~A

#3


0  

"I realize how and what parameters should be passed to javac, the problem is the IDE doesn't seem to allow these to be set anywhere."

“我意识到应该如何以及将什么参数传递给javac,问题是IDE似乎不允许在任何地方设置这些参数。”

I realized now that you know how to pass the right arguments ONLY not where/how to pass those arguments :-(

我现在意识到你知道如何传递正确的参数而不是传递这些参数的地方/如何:-(

How about this : Can you locate where is the JAVA_HOME/bin directory that borland uses ? If yes, then you can rename the javac.exe(to say javacnew.exe) with a javac.bat which in turn will call the javacnew.exe (as well as pass the required arguments) ?

怎么样:你能找到borland使用的JAVA_HOME / bin目录吗?如果是,那么您可以使用javac.bat重命名javac.exe(比如说javacnew.exe),而javac.bat又会调用javacnew.exe(以及传递所需的参数)?

#4


0  

I don't know if this will help since I don't use Borland but in Eclipse, this is a setting that you attach to the program you're going to run. Each program you run in the IDE has configuration specific to it, including arguments to the VM. Is there something like that?

我不知道这是否有用,因为我不使用Borland,但在Eclipse中,这是一个你附加到你将要运行的程序的设置。您在IDE中运行的每个程序都具有特定于其的配置,包括VM的参数。有类似的东西吗?

#5


0  

Do you have a jdk.config file located in JBuilder2005/bin/?

你有一个位于JBuilder2005 / bin /中的jdk.config文件吗?

You should be able to modify vm parameters in that file like:

您应该能够修改该文件中的vm参数,如:

vmparam -Xms256m 
vmparam -Xmx256m

Let me know if this works, I found it on a page talking about editing related settings in JBuilder 2005.

让我知道如果这有效,我在一个页面上发现它在JBuilder 2005中编辑相关设置。

#6


0  

Edit the jbuilder.config file. Put in comment those two lines:

编辑jbuilder.config文件。评论这两行:

  • vmmemmax 75%

  • vmmemmin 32m

has they ought to be <1Gb and with a > 1Gb PC , 75% is too big?

他们应该<1Gb并且使用> 1Gb PC,75%是太大了吗?

#1


6  

did you find a good solution for that problem?

你找到了解决这个问题的好方法吗?

I have the same problem and the only solution I found is the following: The environment variable JAVA_TOOL_OPTIONS can be used to provide parameters for the JVM.

我遇到了同样的问题,我找到的唯一解决方案如下:环境变量JAVA_TOOL_OPTIONS可用于为JVM提供参数。

http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html#tooloptions

I have created a batch file "JBuilderw.bat" with the following content:

我创建了一个批处理文件“JBuilderw.bat”,其中包含以下内容:


set JAVA_TOOL_OPTIONS=-Xmx256m

JBuilderw.exe


Each time I start JBuilder using this batch file the env.var. JAVA_TOOL_OPTIONS will be set and javac.exe will receive the setting. The JVM displays at the end the following message: "Picked up JAVA_TOOL_OPTIONS: -Xmx256m"

每次我使用这个批处理文件env.var启动JBuilder。将设置JAVA_TOOL_OPTIONS并且javac.exe将接收该设置。 JVM最后显示以下消息:“拾起JAVA_TOOL_OPTIONS:-Xmx256m”

Drawback: all virtual machines started by JBuilder will get that setting. :(

缺点:JBuilder启动的所有虚拟机都将获得该设置。 :(

Thanks, JB

#2


0  

Have a look at http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html

看看http://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html

The arguments that you need to pass to JBuilder's javac is "-J-Xms256m -J-Xmx256m". Replace the 256m with whatever is appropriate in your case. Also, remove the quotes.

您需要传递给JBuilder的javac的参数是“-J-Xms256m -J-Xmx256m”。在你的情况下用适当的东西替换256米。另外,删除引号。

This should work for java 1.4, java 1.5 and forward.

这适用于java 1.4,java 1.5和forward。

BR, ~A

#3


0  

"I realize how and what parameters should be passed to javac, the problem is the IDE doesn't seem to allow these to be set anywhere."

“我意识到应该如何以及将什么参数传递给javac,问题是IDE似乎不允许在任何地方设置这些参数。”

I realized now that you know how to pass the right arguments ONLY not where/how to pass those arguments :-(

我现在意识到你知道如何传递正确的参数而不是传递这些参数的地方/如何:-(

How about this : Can you locate where is the JAVA_HOME/bin directory that borland uses ? If yes, then you can rename the javac.exe(to say javacnew.exe) with a javac.bat which in turn will call the javacnew.exe (as well as pass the required arguments) ?

怎么样:你能找到borland使用的JAVA_HOME / bin目录吗?如果是,那么您可以使用javac.bat重命名javac.exe(比如说javacnew.exe),而javac.bat又会调用javacnew.exe(以及传递所需的参数)?

#4


0  

I don't know if this will help since I don't use Borland but in Eclipse, this is a setting that you attach to the program you're going to run. Each program you run in the IDE has configuration specific to it, including arguments to the VM. Is there something like that?

我不知道这是否有用,因为我不使用Borland,但在Eclipse中,这是一个你附加到你将要运行的程序的设置。您在IDE中运行的每个程序都具有特定于其的配置,包括VM的参数。有类似的东西吗?

#5


0  

Do you have a jdk.config file located in JBuilder2005/bin/?

你有一个位于JBuilder2005 / bin /中的jdk.config文件吗?

You should be able to modify vm parameters in that file like:

您应该能够修改该文件中的vm参数,如:

vmparam -Xms256m 
vmparam -Xmx256m

Let me know if this works, I found it on a page talking about editing related settings in JBuilder 2005.

让我知道如果这有效,我在一个页面上发现它在JBuilder 2005中编辑相关设置。

#6


0  

Edit the jbuilder.config file. Put in comment those two lines:

编辑jbuilder.config文件。评论这两行:

  • vmmemmax 75%

  • vmmemmin 32m

has they ought to be <1Gb and with a > 1Gb PC , 75% is too big?

他们应该<1Gb并且使用> 1Gb PC,75%是太大了吗?