- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我曾经在 Java 类中写过这一行。这在 Eclipse 中编译得很好,但在命令行上却不行。
已开启
有什么线索吗?
命令行给出的错误是:
Icons.java:16: code too large
public static final byte[] compileIcon = { 71, 73, 70, 56, 57, 97, 50,
^
有问题的代码行是:
public static final byte[] compileIcon = { 71, 73, 70, 56, 57, 97, 50,
0, 50, 0, -9, 0, 0, -1, -1, -1, -24, -72, -72, -24, -64, -64,
-8, -16, -24, -8, -24, -24, -16, -24, -32, -1, -8, -8, 48, 72,
-72, -24, -80, -80, 72, 96, -40, -24, -24, -8, 56, 88, -56,
-24, -40, -48, -24, -48, -64, 56, 80, -64, 64, 88, -48, -56,
-64, -64, -16, -24, -24, -32, -40, -40, -32, -88, -96, -72,
-72, -72, -48, -56, -56, -24, -32, -32, -8, -8, -1, -24, -40,
-56, -64, -72, -72, -16, -32, -40, 48, 80, -72, -40, -96, -104,
-40, -96, -96, -56, -104, -104, 120, 88, -104, -40, -64, -80,
-32, -88, -88, -32, -56, -72, -72, -80, -80, -32, -80, -88,
104, -96, -1, -40, -40, -40, -64, -104, -104, -32, -56, -64,
-112, 104, 112, -48, -104, -112, -128, -112, -24, -72, -80,
-88, -8, -8, -8, -64, -112, -120, 72, 104, -40, 120, 96, -96,
-112, -96, -24, -112, -120, -72, -40, -88, -88, -48, -64, -72,
-32, -72, -80, -48, -72, -88, -88, -72, -24, 64, 88, -56, -120,
96, 104, 88, -128, -72, 48, 56, 56, 104, 104, 120, 112, -120,
-16, -128, 104, -88, -40, -48, -48, 88, -120, -24, 104, 88,
-104, -40, -56, -72, -128, 112, -88, -128, 96, -88, -104, -88,
-24, -96, -120, 120, -88, -128, -80, -56, -56, -64, 96, 120,
-8, -96, -128, -88, -80, -96, -104, -32, -72, -72, 96, 104,
112, 96, -104, -8, -72, -112, -112, -64, -72, -80, 64, 64, 72,
-128, -120, -96, -128, 88, 88, -56, -72, -80, 88, 96, 120, -72,
-128, 112, 72, 112, -40, 96, 120, -56, 88, -112, -16, 64, 104,
-48, -64, -80, -88, -88, -120, -80, 88, 88, 96, -56, -96, -120,
-40, -56, -64, 96, 104, 120, -120, -80, -24, -104, -88, -40,
-48, -72, -80, -64, -56, -16, -88, -112, -128, -32, -48, -56,
-24, -16, -8, -64, -120, 120, -96, -96, -88, 80, -128, -24,
-56, -72, -88, -96, 120, 88, -72, -112, 120, -64, -104, 120,
-48, -56, -64, -120, -104, -32, -104, 120, -80, -96, -112,
-120, 56, 88, -64, -128, 96, 64, 88, 120, -40, -80, -104, -120,
-104, -128, 104, 96, -104, -24, -72, -120, -128, 56, 96, -56,
-128, 112, 104, -48, -88, -112, 96, 96, 104, -104, -88, -72,
-40, -88, -96, -72, -88, -96, -120, 120, 104, -80, -88, -96,
72, 72, 80, -120, 88, 96, 120, -120, -24, 96, -104, -16, 104,
80, 48, -56, -80, -96, -56, -88, -104, -104, 120, -88, -88,
120, 104, -72, -120, -120, -24, -32, -40, 112, 88, -104, 120,
96, -104, -32, -32, -32, -96, 96, 96, 80, 80, 88, 64, 88, 120,
72, 120, -40, 72, 88, 112, -88, -96, -104, -56, -80, -88, -72,
-88, -104, -56, -64, -72, -80, -120, 104, -80, -120, -80, -112,
112, -88, 120, 112, 112, 112, -96, -24, -120, -120, -64, -120,
120, -80, 64, 96, -128, 96, 64, 64, 96, -128, -32, 80, 112,
-24, 112, -120, -24, 104, -96, -8, 96, 120, -16, -88, 120, 120,
-72, -56, -16, -128, -128, -128, -104, -120, -72, -64, -96,
-120, -32, -64, -64, -40, -48, -56, -64, -88, -96, -64, -104,
-72, -96, -88, -24, -104, -96, -40, -96, -128, 96, -128, -128,
-96, 104, 88, 80, 112, -88, -8, -64, -104, -80, -96, -120, 112,
96, 120, -32, 56, 80, -72, -104, -88, -32, 104, -128, -24, -56,
-88, -120, -80, -72, -8, -96, -128, -128, -64, -128, 96, -72,
-96, -120, 72, 104, -32, -96, 96, 64, -72, -96, -112, -32, -40,
-48, -64, -88, -112, -88, -128, 96, -88, -128, -88, -64, -64,
-32, -128, -96, -32, -88, -104, -112, 32, 32, 64, -120, 104,
-88, 120, -120, -16, -104, 120, -72, -24, -48, -56, -96, -96,
-96, -64, 96, 96, 96, 64, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0,
50, 0, 50, 0, 0, 8, -1, 0, 1, 8, 28, 72, -80, -96, -63, -125,
8, 19, 42, 92, -120, 112, 0, 3, 6, 12, 23, 6, -104, 72, -79,
-94, -59, -117, 19, 39, -124, 64, -128, -128, 3, -121, 9, 19,
48, -118, -92, 24, 81, 33, -118, 8, 40, 7, -88, 84, -55, -64,
12, 6, 6, 45, 74, -54, 52, 8, 73, -60, 24, 22, 25, 92, 73, 40,
64, -96, -64, 74, -121, 24, 94, -58, -100, 25, -79, -59, 47,
17, 3, 52, -120, 88, -125, 105, 73, 6, 42, -102, -68, 96, -16,
-71, 18, 3, -118, 6, 13, 14, -114, -36, 26, -64, 69, 7, 18, 28,
-61, -110, -32, -32, -62, -54, -94, 72, -61, -48, -88, -40, 72,
34, -60, 4, 21, 23, -119, 14, -92, 80, -58, 6, -108, 10, 18,
44, 68, -8, 57, -96, -128, 16, 98, 70, -24, -48, 97, -45, 6, 4,
6, 16, 67, -27, 18, 52, -79, -52, -89, -46, 49, -105, -74, -32,
109, -45, -85, -63, -49, 2, 13, 88, -51, -62, 5, 40, 80, 31,
91, 103, 20, 11, -116, 32, -124, -81, -54, 2, 40, -58, -40,
-103, -59, -122, 13, 43, 51, 12, 122, 106, 96, -48, 0, -105,
40, 29, 106, 32, 17, 20, -64, -69, -73, -17, -33, -68, 25, 113,
13, 80, -125, 44, -102, 72, 108, -84, -88, 80, 49, -127, -61,
-94, 28, -97, -108, -4, -98, -103, 102, 9, -127, -21, -40, -81,
23, -32, 35, -126, 39, -10, 2, 32, -116, 29, -1, 27, -74, 37,
-40, 29, 60, 90, -60, -120, -90, 0, -122, -118, -23, -107, 54,
-36, -72, -15, 2, 66, -61, -23, -39, 24, -8, -36, -7, -108,
-27, -128, 44, -59, -112, -16, -64, 67, 3, -39, 21, 72, 0, 6,
34, 120, -31, -123, 124, 124, 52, 16, 84, 3, -119, -88, 82,
-62, 28, -2, 21, 4, -36, -123, -83, -92, -96, 97, 13, 20, 117,
112, 2, -121, 24, 77, -128, 6, 48, -64, 72, -93, -62, 31, 104,
-56, 48, 68, 16, 65, 112, 49, 29, 67, 82, 8, 24, 72, 118, 18,
84, 48, 66, 6, 63, 72, 96, 96, 1, 26, -128, 64, -97, 8, 50, 24,
114, -64, -112, -22, -51, -28, 7, 24, 77, 116, -15, 75, 1, 123,
53, 2, -63, 15, 22, 88, 0, 1, 5, 44, 72, 32, -127, 74, -78,
-47, -122, -62, 27, -90, -24, 49, -28, 1, 69, -106, -108, 76,
21, -99, 8, -127, -119, 29, -81, 60, 41, -63, 15, 16, -116, 80,
65, -114, 22, -44, 40, 72, 6, 111, 60, 4, 77, 3, 34, -124, 1,
-60, -105, 7, 40, 96, -31, -123, -68, 49, -111, 66, 30, 32,
102, -92, 66, 30, 86, 60, -47, -63, 12, 30, 42, 58, 67, 13, 51,
120, -32, 1, 35, 30, 112, 112, -62, 39, -114, -80, 24, -124,
116, 47, 30, 116, 6, 15, -120, 24, -104, 93, 3, -105, 44, -79,
12, 11, -103, -116, 112, 35, 20, 52, -96, 64, 3, 32, 91, -40,
-1, 114, 5, -97, 126, -106, 36, 5, 24, -106, -67, 103, 26, 3,
32, -68, -14, 10, 20, 44, 88, -78, -124, 37, 91, -124, -47,
-33, -105, 112, -56, -28, 7, -103, -70, -86, 116, -57, 29, 52,
80, 37, -101, 8, 54, 24, 99, -121, 17, 82, -108, -80, 0, -83,
7, 93, 56, 70, 14, 41, -96, -78, -107, 11, -117, -48, 97, -42,
12, 127, 32, 64, 66, 91, 19, -96, -88, -94, 35, -16, 110, 10,
-88, 65, 103, 76, -62, 67, 19, 114, -120, -102, 93, 49, 107,
-108, 65, -121, 29, -121, -36, 65, -116, 16, 24, -32, 121,
-125, 33, -70, 108, -96, 112, -97, 37, 5, -127, 100, 23, -128,
-4, 68, 65, 5, 123, -103, 102, -63, 24, 101, -20, 49, -51, 33,
-121, -40, 80, 65, 9, 122, 40, -84, 112, -78, 17, 73, 81, 69,
-110, -110, -28, -38, -105, 9, 84, -30, 69, 21, -106, 60, 106,
32, 68, 25, -127, -96, -96, -25, 6, 14, 56, -96, 112, -83, 90,
81, 116, 2, -72, 57, 16, 66, 8, 88, 28, 49, 26, 66, 8, 51, 60,
-15, -60, 9, 51, -128, -75, -82, 91, 19, 116, 96, -87, 12, 31,
84, 93, -75, 18, 91, 13, 100, -126, -67, 125, 72, 50, 72, 45,
63, 89, -112, 1, 5, 20, -104, 96, 65, 1, 38, -4, 48, 49, 4,
-82, 60, 84, 48, 13, -90, 92, -111, -13, -36, 60, 39, -44, 66,
40, 96, -12, -47, -59, 32, 81, -20, -1, -15, 19, 4, 18, 68, 80,
64, 5, 72, -80, 0, -127, 9, 17, 72, -112, 9, 20, -106, -48,
-48, -86, -79, 56, -49, 77, -14, 66, -76, -100, -68, 119, 20,
59, 44, -15, 19, -53, 20, 0, 30, 103, -101, 110, -66, 97, -122,
25, 52, 44, 33, -125, -74, 11, -92, -98, 115, -35, 90, -55, 1,
52, 33, 83, 76, 33, -118, 10, 97, 73, -70, 81, 7, 29, 44, -35,
1, -46, 29, 76, -22, 2, 7, 30, -84, 50, -60, 7, 48, 60, 114,
-11, 112, 0, -124, -95, 67, 21, -110, 96, -66, -61, 14, 12,
-84, 36, -27, 8, -99, -101, 80, -128, 5, 72, -36, -104, -55,
23, -92, 83, -95, -116, 19, 14, -92, 46, 62, -21, 8, 21, 1, 68,
9, -93, -124, -78, 3, 51, 59, -68, -84, 82, -30, 72, 84, 64, 1,
18, 121, 85, 0, -123, 32, -126, -80, -112, 6, -56, 11, -32, 32,
-2, -28, 10, -71, -64, 5, -80, 48, 7, 74, 56, -63, 16, 58, -40,
65, 45, -28, -16, 5, -108, 56, 16, 37, -112, -80, 17, 5, 70,
-16, 6, 87, 124, -127, 5, -98, 0, -126, 3, 30, -128, -125, 14,
-30, 64, 1, 2, 12, -95, 8, 67, 8, 0, -118, 108, -126, 8, 31,
-16, 1, 40, 100, -96, -120, 20, 76, 33, 18, 121, -104, 64, 88,
102, 24, 2, -78, 48, 66, 5, -101, -96, 26, 12, 118, -72, 67,
100, 12, 103, 34, 4, 89, 65, 18, -1, 72, -127, -125, 2, 30, 80,
7, -107, -24, -37, 22, 26, -15, -66, 2, 20, -96, 17, 12, 64,
65, 52, -30, -74, -128, 7, 88, -47, -118, -28, 99, -120, 2,
122, -112, -124, 36, -100, 34, 1, 14, -48, -126, 26, 74, -128,
-121, 80, 68, 33, 10, -127, -80, -127, 6, 98, -122, 1, 42, 120,
34, 11, 27, -72, -94, 21, 1, 56, 19, 50, 116, -47, -117, -89,
32, -59, 3, 28, 112, 5, 39, -108, 0, -119, 81, 16, -123, 17,
108, 96, 6, 42, -8, 65, 91, 15, 72, -128, 28, -77, -120, 16,
-116, -64, -30, 25, 113, -120, 100, 36, -101, -15, 8, 24, -84,
80, 6, 46, -116, 93, 36, -124, -9, 1, 34, 120, -46, -109, 71,
-8, 33, 73, 16, 66, -122, 21, -12, -32, -108, 61, 40, 5, 47,
18, 48, -121, 62, -2, 113, 18, 58, 112, -62, 6, 18, 64, -53,
90, 50, 82, 49, 10, 40, -62, 41, 11, -63, 75, 94, -68, 32, 117,
106, -16, -93, 30, 18, 89, -53, 4, -60, 64, 52, 10, 81, -128,
47, 86, -64, 76, 102, -106, 34, 23, 47, -48, -126, 22, 28, 80,
76, 90, -34, 82, 32, 6, -56, -90, 54, 69, 25, 0, 38, -64, -126,
11, 71, 8, -89, 56, -107, -96, 8, 31, -104, -45, 7, 68, -32, 2,
55, -127, 72, -108, 11, -112, -95, 8, 49, -120, -89, 60, 71,
-15, -126, 122, 38, -32, -102, -56, 60, -120, 2, 110, 80, 51,
-124, 126, -58, -94, 8, -62, -88, -25, 49, -13, 41, 23, 5,
-112, -31, 6, 8, 93, 65, 64, -15, -39, -56, 117, 98, -124, 9,
51, -72, -59, 45, 56, -95, 78, -121, 6, -128, -96, 5, -39, 39,
67, 49, -54, -47, -114, 122, -44, 32, 1, 1, 0, 59 };
最佳答案
取自this forum on Sun's support site ,任何方法的长度都不能超过 64 KB:
当您有如下代码(伪)时...
class MyClass
{
private String[] s = { "a", "b", "c"}
public MyClass()
{
}
编译器最终生成的代码基本上如下所示。
class MyClass
{
private String[] s;
private void FunnyName$Method()
{
s[0] = "a";
s[1] = "b";
s[2] = "c";
}
public MyClass()
{
FunnyName$Method();
}
如前所述,java 将所有方法限制为 64k,甚至是编译器创建的方法。
可能 Eclipse 正在做一些偷偷摸摸的事情来解决这个问题,但我向您保证这在 Eclipse 中仍然是可能的,因为我已经看到了相同的错误消息。更好的解决方案是只从静态文件中读取,如下所示:
public class Icons
{
public static final byte[] compileIcon;
static
{
compileIcon = readFileToBytes("compileIcon.gif");
}
//... (I assume there are several other icons)
private static byte[] readFileToBytes(String filename)
{
try {
File file = new File(filename);
byte[] bytes = new byte[(int)file.length()];
FileInputStream fin = new FileInputStream(file);
fin.read(bytes);
fin.close();
}
catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}
关于java - 代码在 eclipse 中编译,但不在命令行中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/115685/
我想在文件系统上手动创建文件夹/文件,以便在 eclipse 的工作区中创建新项目,并在启动 eclipse 并选择工作区时显示在项目资源管理器中。 执行此操作需要创建哪些文件,它们需要位于何处? 请
我正在关注these instructions ,但在运行 mvn eclipse:eclipse 等命令时遇到问题。 我应该如何以及在哪里运行该命令? 我的设置: Windows 7 32 位 面向
是否有任何命令可以在不实际启动 eclipse 的情况下创建 eclipse 工作区?我希望该命令成为脚本的一部分。创建工作区后,将对其进行配置(例如文本编码),然后用于将项目导入到 RTC。我知道下
我想为 Eclipse 插件创建一个自动安装程序(即不通过“更新管理器”)。我的场景很简单:用户关闭 Eclipse,将下载的 JAR 放入 dropins 文件夹,启动 Eclipse,其余的过程是
每当我们想要使用现有源位置创建 Eclipse 项目时,我们将选择现有源位置(根)作为项目位置。 Eclipse 将在该源的根目录中创建所有项目特定文件。 现在,出于某种原因,如果我们想用不同的设置重
可能被问过多次; 有没有办法从控制台(Linux 或 Windows)刷新 Eclipse 工作区文件夹。 我知道有 Ant 任务可以做到这一点。但很想知道是否有命令行技巧。 最佳答案 不,您能做的最
我说的是工具栏上的小图标。 网络上似乎没有任何这样的问题,它们都指的是 android 或自定义应用程序,而不是与 eclipse 捆绑在一起的图标。 我想知道是否有人尝试过这个,或者可以告诉我它不值
如何使用 Eclipse 比较两个文件? (目前我正在使用 WinMerge 。) 最佳答案 要在 Eclipse 中比较两个文件,请首先在 Project Explorer/Package Expl
我正在尝试将我在一个带有数据库的 Eclipse JEE6 项目中所做的所有工作转移到另一个 Eclipse 程序。我知道我将不得不重新配置很多并重建很多库文件,但是尽可能多地传输的最简单方法是什么?
在 Eclipse 中加载我的工作台并启用 TFS 插件时,它挂起。与此类似: http://social.msdn.microsoft.com/Forums/vstudio/en-US/85c1d3
Eclipse 可以通过插件包含许多不同的功能集。您是否在一个 Eclipse 中安装所有插件?或者您是否从 spring 安装 STS,从 adobe 安装 Flex eclipse,甚至从 ecl
我错误地单击了“在 Eclipse 首选项中将目标运行标记为忽略在 Eclipse 构建中(实验)”: 在哪里/如何撤消此操作? 最佳答案 m2e 使用文件 YOUR_WORKSPACE/.metad
我是 Maven 新手。我尝试执行 >mvn eclipse:eclipse -Dwtpversion=2.0。但我收到以下错误: D:\test\CounterWebApp>mvn eclips
当我运行多个 Eclipse 实例时,操作系统不断请求上述权限。 我已经授予了该权限,并且我尝试了多次禁用和启用该权限。 我正在使用, macOS Catalina(版本:10.15.3 (19D76
我有一个 Maven 项目,其中我在项目构建期间使用 wsimport 作为目标来使用 Web 服务。 org.codehaus.mojo
当尝试使用 eclipse 新软件功能安装 eclipse 时,出现此错误: Cannot complete the install because one or more required item
我已经下载了整个 Eclipse Helios/Indigo 版本的源代码。现在我想对它进行一些修改等等。所以我导入了整个源代码,但现在我在编译时遇到了 n 个错误。此外,我正在尝试 RunAs> 插
我已经安装了 eclipse Oxygen 并且正在尝试连接到 Eclipse 市场,以安装插件,它给出了以下异常 - org.eclipse.equinox.p2.core.ProvisionExc
我的 IDE 中安装了来自 Sonatype 的 m2Eclipse 插件。它允许我通过右键单击 pom.xml 文件并导航到“运行方式”菜单来运行各种 Maven 命令(打包、安装等)。 但是,我还
我在 Windows7 64 位上运行 Maven 3 时遇到问题。当我执行maven eclipse:eclipse(我使用maven-eclipse-plugin 2.8)时,maven不会创建任
我是一名优秀的程序员,十分优秀!