java runtime

T

TK

Hallo Zusammen,

Hab unter UBuntu openjdj1.7 und 1.6 installiert. Wenn ich ein Programm
starte dann läuft es immer mit 1.6 (auf der Konsole). ES soll aber
mit 1.7 laufen. Wie mache ich das?

o-o

Thomas
 
S

Steven Simpson

Hab unter UBuntu openjdj1.7 und 1.6 installiert. Wenn ich ein Programm
starte dann läuft es immer mit 1.6 (auf der Konsole). ES soll aber
mit 1.7 laufen. Wie mache ich das?

Google translation:
'm On Ubuntu openjdj1.7 and 1.6 installed. If I have a program
then start it always runs at 1.6 (on the console). However, it should
run with 1.7. How do I do that?

I've had the same problem - javac is bound to 1.7, while java is bound
to 1.6. I tried removing the 1.6 packages, but 1.7 depends on them, and
that got me into a terrible mess.

IIRC, this worked for me:

sudo update-alternatives --config java

....and then choosing the 1.7 version. I found I had to do this for all
the commands in java-7-openjdk-*/bin that are symlinks:

* java
* keytool
* orbd
* pack200
* policytool
* rmid
* rmiregistry
* servertool
* tnameserv
* unpack200

Hmm, can't seem to find a javaws for 1.7.
 
V

Volker Mueller

Am 05.04.2012 13:43, schrieb TK:
Hab unter UBuntu openjdj1.7 und 1.6 installiert. Wenn ich ein Programm
starte dann läuft es immer mit 1.6 (auf der Konsole). ES soll aber
mit 1.7 laufen. Wie mache ich das?

Setze im Environment des Programmes, das mit dem JDK laufen soll die
Variable JAVA_HOME auf den Pfad zum jdk (vmtl. /usr/lib/jdk/jdk-1.7 oder
ähnlich - was "aktiv" ist erfährst Du mittels "which java" - die andere
jvm liegt meist "daneben".).

you@yourhost> export JAVA_HOME=/Pfad/zu/Deinem/JDK
you@yourhost> ./yourProgram

oder "flüchtig" nur für den Programmaufruf

you@yourhost> JAVA_HOME=/Pfad/zu/Deinem/JDK ./yourProgram

BTW: Group language seems to be english - you'd better change to that ...

Bye, Volker
 
R

Roedy Green

Hallo Zusammen,

Hab unter UBuntu openjdj1.7 und 1.6 installiert. Wenn ich ein Programm
starte dann l=E4uft es immer mit 1.6 (auf der Konsole). ES soll aber
mit 1.7 laufen. Wie mache ich das?

translation:

Hi I'm everyone,

I'm using Ubuntu openjdj1.7 with JDK 1.6 installed. When I start a
program with l = E4uft ??? it always uses Java 1.6 (on the console).
However, it should run with 1.7. How can I do that?

see http://mindprod.com/jgloss/javaexe.html#MULITIPLES

--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
R

Roedy Green

translation:

Hi I'm everyone,

I meant Hi everyone.
--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
Joined
Apr 13, 2012
Messages
1
Reaction score
0
hi,
I have tried writing a jni call for the simple c code. when i try to install this on the phone running 2.3.3 it doesnt install, sometimes even if it installs then it is being force closed.Please help me with this. the code details are as follows:

The java code of which i generate the header file.

package com.hosa;

public class edgejava{
static{
System.loadLibrary("edgejava");
}
public native int main();
}

the generated header file is as below

/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_hosa_edgejava */

#ifndef _Included_com_hosa_edgejava
#define _Included_com_hosa_edgejava
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_hosa_edgejava
* Method: main
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_hosa_edgejava_main
(JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif


the implementation of native function is as below

#include "com_hosa_edgejava.h"
#include <jni.h>
#include <cv.h>
#include <highgui.h>

using namespace cv;

JNIEXPORT jint JNICALL Java_com_pes_edgejava_main(JNIEnv *, jobject){
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;

Mat edges;
namedWindow("edges",CV_WINDOW_AUTOSIZE);
for()
{
Mat frame;
cap >> frame; // get a new frame from camera
cvtColor(frame, edges, CV_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("edges", edges);
if(waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;
}

the android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

include /home/srijith/android-opencv/OpenCV-2.3.1/share/OpenCV/OpenCV.mk

LOCAL_MODULE := edgejava
LOCAL_SRC_FILES := edgecpp.cpp
LOCAL_LDLIBS += -llog -ldl


include $(BUILD_SHARED_LIBRARY)


the application.mk


APP_MODULES := edgejava
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions


the activity file is as follows

package com.hosa;

import android.app.Activity;
import android.os.Bundle;

public class Andedge2Activity extends Activity {
edgejava nativelib;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

nativelib= new edgejava();
int i=nativelib.main();
System.out.println("value returned to andedgeactivity "+i);
}
}

All necessary changes to the manifest has been done like mention of use of camera and permissions has been set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top