Do not change property jna.nounpack if it did have value#792
Conversation
|
In general I agree with this change, but I'm interested in the reasoning and I don't understand your description: "android can also run normal java application" AFAIK this is only true, if you run a complete JRE build for the bionic C library. Dalvik can (again AFAIK) only run DEX and fails to interpret java class files. So what is it you are trying to do? |
|
see my project, link have pasted , export CLASSPATH="xxxxxx.dex"
dalvikvm Hellojust like do this on pc, export CLASSPATH="xxxxxx.jar"
java Hello |
|
Thanks - I did not realize that, but in hindsight it is logical. Could you please adjust the change to use braces for the if-then block? |
|
jna.nounpack should always be true on android, since that system does not
support loading of arbitrary jars or native libraries (unless something has
changed recently). All jars and native libraries must be declared and
explicitly included as part of your project.
…On Mon, Apr 17, 2017 at 12:56 AM, 啊o额iu鱼 ***@***.***> wrote:
android can also run normal java application,
if always set the property true,I should do so,
try{
Class.forName(Platform.class.getName());
}catch(Exception ignore){
}
System.setProperty("jna.nounpack","false");
https://github.com/AoEiuV020/RunJavaOnAndroid/blob/master/
jna/src/main/java/aoeiuv020/Main.java
It's stupid,
if there is a check befor set in class Platform,
I should only set the property with single line,
------------------------------
You can view, comment on, or merge this pull request online at:
#792
Commit Summary
- Do not change property jna.nounpack if it did have value
File Changes
- *M* src/com/sun/jna/Platform.java
<https://github.com/java-native-access/jna/pull/792/files#diff-0> (3)
Patch Links:
- https://github.com/java-native-access/jna/pull/792.patch
- https://github.com/java-native-access/jna/pull/792.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#792>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAuMrfXUoJZF5Xj8D9saBh0PUJt5WI1oks5rwvEBgaJpZM4M-3wT>
.
|
|
@twall no,no,no, |
|
@AoEiuV020 it is not nearly as simple as you make it. I build a sample application and "dexed" it. But then the dalvikvm still refuses to load the file:
So google seems to have decided to make it even harder to load native libraries (in fact this is documentent). This is what I did: |
|
@matthiasblaesing I don't know why, |
|
It still does not work (chaging tmp does not help)
|
|
I'll close this here. Android seems to lock down what can be done with regard to loading arbitrary libraries from the system. I don't see an indication the google will step back from that. In principal I'm ok with this change, but I'd like to see it in action first. I'm willing to test this in other constallations, but my phone is the easiest (and only) option for me. |
android can also run normal java application,
if always set the property true,I should do so,
https://github.com/AoEiuV020/RunJavaOnAndroid/blob/master/jna/src/main/java/aoeiuv020/Main.java
It's stupid,
if there is a check befor set in class Platform,
I should only set the property with single line,