简体   繁体   English

如何设置从控制台运行Java的亲和力

[英]How set affinity running java from console

Since I dont have hyper threading option in the BIOS I am gonna disable it by launching 由于我在BIOS中没有超线程选项,因此我将通过启动来禁用它

start /affinity 01010101 开始/亲和01010101

like here 这里

The problem is that I would like to run a java program with that option but I cant make it 问题是我想用该选项运行一个Java程序,但我做不到

C:\Users\gbarbieri>start /affinity 01010101 "C:\Program Files\Java\jdk1.7.0_71\j
re\bin\java.exe" -jar D:\Documents\NetBeansProjects\EC_400_BETA\dist\EC_400_BETA
.jar
Die Datei "-jar" kann nicht gefunden werden.(= -jar cannot be found)

I tried include -jar in the '' , include also the .jar, but nothing.. 我尝试在''包含-jar,还包括.jar,但什么也没有。

So how do I set affinity running a jar from console? 那么,如何设置从控制台运行jar的相似性?

This should be marked as a duplicate of Using the "start" command with parameters passed to the started program . 应将其标记为使用“ start”命令的复制品, 并将参数传递给已启动的程序 However, I only found out that there was a another question with the right solution after finding out why the OP's command line didn't work. 但是,在找出OP的命令行为什么不起作用之后,我才发现还有另一个问题,就是正确的解决方案。

The problem is that the Windows start command treats the first argument in double quotes specially. 问题是Windows start命令特别对待双引号中的第一个参数。 It treats it as the title to display in the command prompt window. 它将其作为标题显示在命令提示符窗口中。 (See the Microsoft documentation ) (请参阅Microsoft文档

The work around is to provide a title explicitly before providing a command name that needs double quotes (such as any command inside c:\\Program Files\\ because of the space in that path name) 解决方法是在提供需要双引号的命令名称之前(在c:\\Program Files\\任何命令,因为该路径名中有空格),先明确提供标题。

This could just be an empty title, like this: 这可能只是一个空标题,如下所示:

C:\Users\gbarbieri>start "" /affinity 01010101 "C:\Program Files\Java\jdk1.7.0_71\j
re\bin\java.exe" -jar D:\Documents\NetBeansProjects\EC_400_BETA\dist\EC_400_BETA
.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM