Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java runtime

Reply
Thread Tools

java runtime

 
 
TK
Guest
Posts: n/a
 
      04-05-2012
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
 
Reply With Quote
 
 
 
 
Steven Simpson
Guest
Posts: n/a
 
      04-05-2012
On 05/04/12 12:43, TK wrote:
> 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.

--
ss at comp dot lancs dot ac dot uk

 
Reply With Quote
 
 
 
 
Volker Mueller
Guest
Posts: n/a
 
      04-05-2012
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
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      04-06-2012
On Thu, 5 Apr 2012 04:43:21 -0700 (PDT), TK <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>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..
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      04-06-2012
On Thu, 05 Apr 2012 17:57:58 -0700, Roedy Green
<(E-Mail Removed)> wrote, quoted or indirectly quoted
someone who said :

>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..
 
Reply With Quote
 
gauravu gauravu is offline
Junior Member
Join Date: Apr 2012
Posts: 1
 
      04-13-2012
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to generate Java Code from XML at runtime? Lucia Java 7 08-19-2011 09:38 AM
Runtime.exec(String[]) Doesn't Always Work, bBut Runtime.exec(String) Does Hal Vaughan Java 11 05-22-2006 04:49 PM
Automate program execution problem (Runtime.exec("java" + " Hello.java"); seenuvas Java 7 01-24-2006 07:04 PM
Automate program execution problem (Runtime.exec("java" + " Hello.java"); seenuvas Java 0 01-24-2006 01:01 PM
Java Runtime Problem (to say the elast) Jay Firefox 2 12-11-2003 07:37 PM



Advertisments