GithubHelp home page GithubHelp logo

Capsule uses wrong jvm about capsule HOT 6 CLOSED

draenor avatar draenor commented on August 18, 2024
Capsule uses wrong jvm

from capsule.

Comments (6)

pron avatar pron commented on August 18, 2024

Which is the JVM used to launch the capsule (when you type java)? Is it perhaps C:\Program Files (x86)\Java\jre7?

from capsule.

draenor avatar draenor commented on August 18, 2024

Incidentally, yes

$ java -version
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

Although setting the correct JAVA_HOME would solve issue the I was under the impression that the JDK-Required property would override that.

from capsule.

pron avatar pron commented on August 18, 2024

Well, it should work even if you set your JAVA_HOME to C:\Program Files\Java\jre7.

The thing is that Capsule's Java installation detection is limited. It can't search the whole filesystem, or it would take too long. Instead, it uses a heuristic: it already knows of one Java installation -- the one used to launch the capsule itself -- so it looks for other installations in the same directory. On your machine, you have Java installations in two different directories: C:\Program Files (x86)\Java\ and C:\Program Files\Java\. If you launch the capsule using an installation in one directory, it won't find installations in the other.

Perhaps it's worth adding a special case for Windows's C:\Program Files (x86)\/C:\Program Files\

from capsule.

draenor avatar draenor commented on August 18, 2024

I think that would be a great idea and should resolve probably the most common reason for this problem. Also it's still a bit odd that -Dcapsule.jvms didn't even print the JVM it was run with. Thanks for the quick response :)

from capsule.

pron avatar pron commented on August 18, 2024

Yes, that is strange. I will look into that. Can you confirm that Capsule behaves properly (i.e. respects JDK-Required) when JAVA_HOME is C:\Program Files\Java\jre7?

from capsule.

draenor avatar draenor commented on August 18, 2024

So two things going on here. The java binary run was apparently run from c:/windows/system32, no wonder no java installation was detected ..

Secondly

$ c:/Program\ Files/Java/jre7/bin/java -Dcapsule.jvms -jar foo.jar
CAPSULE: Detected Java installations:
1.7.0_45        c:\Program Files\Java\jdk1.7.0_45\jre
1.7.0_09        c:\Program Files\Java\jdk1.7.0_09\jre
CAPSULE: selected null

Starting the application with the above command, with the JDK-Required flag, doesn't seem to work either. The following two variants however does

$ java -jar -Dcapsule.java.home="c:/Program\ Files/Java/jdk1.7.0_45/" -jar foo.jar
$ "c:/Program Files/Java/jdk1.7.0_45/bin/java" -jar foo.jar

For reference, JAVA_HOME set to c:/Program Files/Java/jdk1.7.0_45/.

from capsule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.