JDK 7将自身报告为JRE(通过“java.home”系统属性)(JDK 7 reports itself as a JRE (via “java.home” system property))
我刚刚安装了最新的JDK 7 Update 21并编写了以下单行程序(在Windows 7上):
public static void main(String[] args) { System.out.println("java.home = " + System.getProperty("java.home")); }
输出(令人惊讶):
java.home = D:\Java\jdk1.7.0_21\jre
我相信我解决了所有常见原因:
- JAVA_HOME设置为“D:\ Java \ jdk1.7.0_21”
- 我已将“D:\ Java \ jdk1.7.0_21 \ bin”设置为系统PATH设置中的第一个路径。
- Windows \ System32中没有java.exe
- 我正在使用“新鲜”的命令行
- 我已广泛搜索此网站和其他网站
- 我的注册表不包含“HKEY_LOCAL_MACHINE \ SOFTWARE \ JavaSoft \ Java运行时环境”键。 “HKEY_LOCAL_MACHINE \ SOFTWARE \ JavaSoft \ Java Development Kit \ 1.7”的值包含正确的“JavaHome”值。
- 在java.exe调用中添加“-server”选项不会更改输出
以下是您的信息的更多输出
D:\Temp>echo %PATH% d:\Java\jdk1.7.0_21\bin D:\Temp>echo %JAVA_HOME% D:\Java\jdk1.7.0_21 D:\Temp>type SystemInfo.java public class SystemInfo { public static void main(String[] args) { System.out.println("java.home = " + System.getProperty("java.home")); } } D:\Temp>java -verbose SystemInfo [Opened d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.lang.Object from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.io.Serializable from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] ... [Loaded java.lang.Void from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] java.home = d:\Java\jdk1.7.0_21\jre [Loaded java.lang.Shutdown from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.lang.Shutdown$Lock from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
(更新:) 基本上我需要知道,如何运行我的Java应用程序,以便它可以访问java编译器(在JDK的tools.jar中找到),而无需将JAR复制到其他地方。
顺便说一下,这背后的主要问题是我的码头无法编译JSP,因为缺少java编译器。 我知道我可以将“tools.jar”添加到JRE \ lib \ ext,但这不是一个长期的解决方案。
I just installed the latest JDK 7 Update 21 and wrote the following one-liner (on Windows 7):
public static void main(String[] args) { System.out.println("java.home = " + System.getProperty("java.home")); }
the output is (surprisingly):
java.home = D:\Java\jdk1.7.0_21\jre
I believe I fixed all the common causes:
- JAVA_HOME is set to "D:\Java\jdk1.7.0_21"
- I have set "D:\Java\jdk1.7.0_21\bin" as the first path in the system PATH setting.
- There is no java.exe in Windows\System32
- I am using a "fresh" command-line
- I have searched this and other sites extensively
- My registry does not contain a "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" key. The value of "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7" contains a correct "JavaHome" value.
- Adding "-server" option to the java.exe call does not change the output
Here is some more output for your information
D:\Temp>echo %PATH% d:\Java\jdk1.7.0_21\bin D:\Temp>echo %JAVA_HOME% D:\Java\jdk1.7.0_21 D:\Temp>type SystemInfo.java public class SystemInfo { public static void main(String[] args) { System.out.println("java.home = " + System.getProperty("java.home")); } } D:\Temp>java -verbose SystemInfo [Opened d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.lang.Object from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.io.Serializable from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] ... [Loaded java.lang.Void from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] java.home = d:\Java\jdk1.7.0_21\jre [Loaded java.lang.Shutdown from d:\Java\jdk1.7.0_21\jre\lib\rt.jar] [Loaded java.lang.Shutdown$Lock from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
(Updated:) Basically I need to know, how to run my java application so that it has access to the java-compiler (found in the JDK's tools.jar) without copying that JAR to some other place.
BTW the main problem behind this is that my jetty can't compile a JSP since the java-compiler is missing. I know I can add "tools.jar" to JRE\lib\ext but thats not a long-term solution.
原文:https://stackoverflow.com/questions/17061482
最满意答案
不,它在CSS和Stylus中是不可能的,因为它只是编译成CSS。
但是,在某些情况下,当你想要改变父看起来的样子时,你可以在某种程度上模仿它:你可以在类的一个元素后使用另一个元素,然后伸展到父类,看看这个演示: http:// dabblet的.com /要旨/ 7638112
您需要的HTML:
<ul> <li><span class="correct">Ja</span><span class="helper"></span></li> <li><span class="inCorrect">Nee</span><span class="helper"></span></li> <li><span class="inCorrect">Mss</span><span class="helper"></span></li> </ul>
和CSS:
li { position: relative; z-index: 1; } .helper { position: absolute; z-index: -1; top: 0; left: 0; right: 0; bottom: 0; } .correct + .helper { background: lime; } .inCorrect + .helper { background: red; }
No, it is not possible in CSS, and in Stylus as it is just compiled into CSS.
However, you could somewhat emulate it in some cases, when you want to change just how the parent looks: you can use another element after the one with the class, and stretch in onto the parent, see this demo: http://dabblet.com/gist/7638112
The HTML you'd need there:
<ul> <li><span class="correct">Ja</span><span class="helper"></span></li> <li><span class="inCorrect">Nee</span><span class="helper"></span></li> <li><span class="inCorrect">Mss</span><span class="helper"></span></li> </ul>
and CSS:
li { position: relative; z-index: 1; } .helper { position: absolute; z-index: -1; top: 0; left: 0; right: 0; bottom: 0; } .correct + .helper { background: lime; } .inCorrect + .helper { background: red; }
相关问答
更多-
另一种实现此目的的方法: mymixin(myval = 0) width (myval)% .myclass mymixin(20) Another way to achieve this: mymixin(myval = 0) width (myval)% .myclass mymixin(20)
-
根据我的理解,你正在寻找的最终选择器是.post-news:hover .post-news-image ,如果这是正确的,你可以像下面的代码片段那样做。 .post-news &-image display: none &:hover & ^[0]-image display: block 说到Stylus,我自己是初学者,但根据我的理解, ^[0]-image和../-image不能按预期工作的原因是因为Stylus编译器将它们视为某种移动一级向上命令,因此它实际上 ...
-
SASS像手写笔一样抬头(SASS look up like in stylus)[2022-09-25]
在SASS中没有像Partial Reference这样的东西,但你可以这样做: .block $root:& @at-root #{$root}--mod #{$root}__elem color: red 它并不像你在Stylus中那样干净但是很有效。 There isn't something like Partial Reference in SASS but you can do this: .block $root:& @at-root ... -
您可以在部分引用中使用范围来仅获取所需树中的选择器: 唱针 .app--light & .longblockname &__element color #333 &--modifier & ^[1..1]__element color #444 产量 .app--light .longblockname__element { color: #333; } .app--light .longblockname--modifier .longbl ...
-
我认为你需要一个围绕你试图设置宽度的元素的包裹div。 这样可以确保元素具有百分比的设置起点,如果您也将此包裹设置为高度。 我在这个片段中演示了它。 .ht-wrap { padding-top:20px; display;inline-block; height:280px; background-color:blue; } .ht-full-70 { padding:6px; display;inline-block; height: calc(100% ...
-
编码器会忽略以_开头的文件。 这意味着,你可以做到 @import _first @import _second @import _third 在你的主手写笔文件和_first等只会添加一次到结果。 Files that start with _ are ignored by compilers. Which means, you can do @import _first @import _second @import _third in your main stylus file and _firs ...
-
只要您的客户端将使用的设备支持使用触控笔的触摸输入,这是完全可能的。 您可以参阅本教程来了解如何使用
-
这是一种方法: filter s('progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorstr=%s, EndColorstr=%s)', color1, color2)) 但我恳请你查看笔尖 ,也是TJ。 特别是,他构建了一个mixin,可以在png中自动生成渐变图像,base64将其编码到样式表中。 唯一需要注意的是,您需要指定高度(或宽度,水平渐变),但对于您的td:s应该没问题。 更新:一点清洁: filter ...
-
在手写笔中选择父元素(Select parent element in stylus)[2023-02-20]
不,它在CSS和Stylus中是不可能的,因为它只是编译成CSS。 但是,在某些情况下,当你想要改变父看起来的样子时,你可以在某种程度上模仿它:你可以在类的一个元素后使用另一个元素,然后伸展到父类,看看这个演示: http:// dabblet的.com /要旨/ 7638112 您需要的HTML:- Ja
- Nee ...
-
带有Stylus的嵌套CSS类(Nested CSS Classes with Stylus)[2023-04-03]
这有效吗? .test-animation-class &.ng-hide-remove &.ng-hide-add.ng-hide-add-active opacity 0 Is this works? .test-animation-class &.ng-hide-remove &.ng-hide-add.ng-hide-add-active opacity 0