..running java in linux!!!
hai java-landers,
i actually want to see java running in "linux" system...
the procedure, they've given in linux manual is very lenghthy
and tedious....
could any of u give me a good procedure for that....
(actually i don't know where my message should go to which category...
so, i pasted here...
hope..u won't fire me next time!!!!)
Download the linux self-extracting file (not RPM).
If you are going to install as root, then log in as root now. You will need to be root if you want to install in any directory outside of your home directory -- such as a system directory (/usr/local in the example below).
Move to the directory where you wish to install Java:
$ cd /usr/local
Make sure the file is set to "executable":
$ chmod +x /home/waldo/j2sdk-1_4_1_02-linux-i586.bin
Execute the file:
$ /home/waldo/j2sdk-1_4_1_02-linux-i586.bin
Now log out of root. You're done.
Test your installation by typing something like:
$ /usr/local/j2sdk-1.4.1_02/bin/java -version
If you want to run java without typing the full path, you must put Java's bin directory in your path:
$ echo path
$ export PATH=$PATH:/usr/local/j2sdk-1.4.1_02/bin
$ echo path
(the "echo path" is not necessary; it's so that you can see what's going on)
Now you should be able to type:
$ java -version
You will need to put the "export PATH=..." line in your .bash_profile script file for it to be permanent.
Similar Messages
-
Suppose to package all necessary *.class in example.jar in following way,
bin.start.class
business.bus.class
and the class file that contain main is bin.start.class.
There is no problem to run following under linux shell prompt. java VM is under PATH searching path. i.e.
$java -classpath example.jar bin.start
However, there is some problem to run a script which contains 'java -classpath example.jar bin.start' under linux shell prompt.
May I have any clue to identify this problem?
Thanks in advance.For case 1: Does any case work? When I see "[un]able to locate the main method" then I think that that the class was found but that the main method is not declared properly.
Of course, main must be declared with exactly these keywords:
static public void main( String arg[]) {
...For case 2: you still have some kind of classpath problem.
If your script really has the line
java -classpath example.jar bin.start
then I still think your current working directory at the time that this line is run not that same directory as where the jar file is.
If you have JAVA_HOME defined, you might want to try:
pwd
$JAVA_HOME/bin/java -classpath example.jar bin.start
Another suggestion: If your $PATH variable is long, try to shorten it to a short list of directories. You can test with just /bin:/usr/bin .
Also, is your shell Bash or C-shell? Is your script Bourne shell (/bin/sh) or Bourne? -
Pls help (running java on linux)
Hello freinds,,
I am in deep need..can anyone pls help me...
I want to run my java programs on linux server.. Below are the steps I went thru to install jdk
*** Download and copy j2sdk-1_3_1_10-linux-i586.rpm.bin to /usr/local/src.
% su -
# cd /usr/local/src
# chmod +x j2sdk-1_3_1_10-linux-i586.rpm.bin
# ./j2sdk-1_3_1_10-linux-i586.rpm.bin
# rpm -ivh j2sdk-1_3_1_10-linux-i586.rpm
Now test Java:
# /usr/java/jdk1.3.1_10/bin/java -version
Set the PATH environent variable.
PATH="$PATH:/usr/java/jdk1.3.1_10/bin:."
export PATH
I went thru all above commands uninterruptedly.. Then I copied the folder containing programs in jdk1.3.1_10/bin folder
Now when I am trying to complile or run an existing class it's gving following error message :
java: command not found
OR
javac: command not found
Can any one pls tell me where I am going wrong???
Thanks in advance..From your query i understand you've installed java at "/usr/java/jdk1.3.1_10" location on your Linux box. I've a couple of queries -
when u try to run "/usr/java/jdk1.3.1_10/bin/java -version" what do u see. Do u see the Java version information displayed on your screen ?
and when you try export -ing the PATH variable with the following location added "/usr/java/jdk1.3.1_10/bin" and in the same shell type "which java" what do you see ? You should be seeing "/usr/java/jdk1.3.1_10/bin/java"
If the above works then make changes to your profile file in order to ensure changes are saved for subsequent sessions. -
Hello everyone,
I am familiar with programming in Java on the Windows environment.
However, I have recently installed Mandrake 10 on my desktop, and downloaded Sun's J2SDK 1.4.2_05 for Linux GTK2 systems.
I have setup the environment variables for JAVA_HOME and CLASSPATH, and everything seems to be in order (I manage to call java and javac from the command line). The problem is that, whenever I try to run a java program, I get the following message:
"Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object"
How may I solve this?
Thanks in advance for the helpWhat did you set CLASSPATH to? Until you understand how Java's "package" construct works and how classes are found it's best not to set it, it often causes more problems than it solves.
It sounds like you have got a very old version of java installed and it is getting used instead of your newly installed 1.4.2. I know that some Redhat distributions have this problem but I'm not sure about Mandrake 10. What is the output of "java -version" ? -
Run java as a different process name in Linux
I have multiple java applications running on a linux platform. When I look at the process list, they all say java. I want them to have a unique process name. The closest I have gotten is starting the java app in a script, and that script name shows up as well as the java app. This could be all fine and dandy, but if someone kills the script, the java process continues on. It would be nice if I could say run this process as this name in Linux, but I know of no such thing. I asked this on LinuxQuestions.org and got a response to use Launch4J...which creates executables for Windows...so that wasn't very helpful. I was hoping the Java community might have a little more insight.
rename the java binaryOr instead of renaming, you could do a symlink... I
don't have a machine to test on, but I think creating
a symlink to the java executable and running that
symlink would change the executable's name in the
process table.nah, the process would still be called 'java' -
How to run .jar on linux & how to create .jar file using java?
hi, may i know how to run .jar on linux & how to create .jar file using java? Can u provide the steps on doing it.
thanks in advance.Look at the manual page for jar:
# man jar
Also you can run them by doing:
# java -jar Prog.jar -
How to run Java program as Daemon Server in linux
How to run Java program as Daemon Server in linux
i would like to run the java program on system start up in a redhat linux system
can any one provide rc.status filehttp://wrapper.tanukisoftware.org/
-
How to run Java Swing GUI on embedded ARM Linux platform?
The object is:
A touch panel, running Java Swing GUI, with a 25 fps 320x320 mono JPEG image animation and other control buttons.
What I have now:
A Developing Board with: ARM926 CPU at 266MHz, 128M RAM, 64M ROM, ported with arm-linux and MiniGUI.
My plan is:
1. installing a X-window system to the platform, discarding the MiniGUI.
2. install j2re-1.3.1-RC1-linux-arm.tar.bz2 to the platform.
3. run my program developed on a PC.
My concerns are:
1. Both X and Java is resource consuming, can a 266MHz ARM CPU meet my requirement?
2. Is the X a must to run Java Swing GUI? If yes, how can I configure it to minimize the footprint, I mean, install only necessary modules.
3. Can J2RE 1.3.1, the only port for arm linux, support Swing classes?
4. Are there other options, such as CDC + PP(AGUI?), how to do it?
Thanks alot!3. Can J2RE 1.3.1, the only port for arm linux, support Swing classes?I'm not entirely sure from your post: is this a J2SE port? If so it will support Swing, but probably needs Qt.
-
How to work with java in linux system
Hi,
java 1.5.0_04 program is not running in linux o.s.But the same program is working fine windows .
can any body let me know what environment should i set to run it in linux system.
test.java:19: error:Cannot find class "JLabel" [JLS 8]
thanks.Hi,
java 1.5.0_04 program is not running in linux o.s.But the same program is working fine windows .
can any body let me know what environment should i set to run it in linux system.
test.java:19: error:Cannot find class "JLabel" [JLS 8]
thanks. -
I want to run java program on windows environment as background process
Hi all
I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
for example look this programe
import java.io.*;
import java.util.*;
public class TestClass {
class ravi extends Thread{
public void run(){
try {
String target_file = "ravind.txt";
File targetfile = new File(target_file);
PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
for (int i =0 ; i < 100 ;i++ ){
Thread.sleep(10000);
writer.println(" ravindra shukla ");
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
TestClass test1 = new TestClass();
TestClass.ravi r1 = test1.new ravi();
r1.start();
System.out.println(" return from main ");
first i compile this
javac TestClass.java
then i run this by using this command
java TestClass
but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java commandThanks dude
This solution �start java TestClass� works fine �. But it does not solve my problem
It opens another black window and that black window persist till the life time of my program
Is it possible application run on complete background without opening another black window �as in Linux -
Error running Java after first time installation on shared server
Hello, I have just installed jre1.6.0_21 for the first time in my home folder on a shared Linux server. I am logged onto the server, so I am acting as the localhost. I get the following error when running java -version:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I am a newbie to Java. Would appreciate any advice.You are using OA?
Post in this forum: OA Framework
Timo -
How to run java application without having java environment in a machine
can i run java application without having java environment(JVM) in a machine.I mean i dont have installed j2se or jdk in my machine.And i have an j2ee application running on another host which is built in swings.I want to access that application in my machine
can any one help regarding my problemIf you only need to access the program from one machine and you are running a Unix-like operating system (e.g., Linux, Solaris), you can use the remote display capabilities of X11. In this case you have to choose the host where the app will be displayed when you start it:
$ DISPLAY=<hostname>:0.0
$ export DISPLAY
$ java ...
If you want to be able to display it on both machines at the same time, or if you are using windows, then try something like VNC (http;//www.realvnc.com). Or if you are running windows and your version supports it, you can use windows remote desktop. -
Set Date Time Computer with Java in Linux OS
Dear All,
How to set date time computer with Java in linux OS?
Rgds,
TheoThere is no API for this you'd have to run an external command using Process.exec.
This is the wrong forum for general Java "how to" questions. -
Hi. I want to develop a java application that can be run from a CD... No installation required. The idea is to distribute an application that users will be able to use by just running the java app in a CD. Can this be done? Can this java app in CD run on windows, linux, and mac?
Please help... I am new to java and some sample codes or procedures/steps will be a big help.
Thanks!No the dbf route doesn't have SQL (unless you're willing to pay for propitiatory database drivers), but you read it in row by row and then pull out the columns you want. You could create several dbf files on the CD which would be like different select statements. I only mention this because .dbf is probably easier than an embedded database. Take a look at the API. (I highly suggest going this route if possible it will simply development) .dbf files are just a spec, so they would work on linux.
http://www.svcon.com/jdbf/docs/index.html
If you feel you really need to be able to create select statements take a look at :
http://www.oracle.com/database/berkeley-db/je/index.html
Message was edited by:
ZimmerS1337 -
Running JVM in Linux with execl
Why if I run JVM under Linux and with execl the first argument is lost?
For example if I want to run java -version I have to do:
execl("/usr/lib/java5/bin/java","nothing","-version");
If I do execl("/usr/lib/java5/bin/java","-version"); it doesn't works and appears the help message that appears when you are wrong with the parameters.
This is an innocent thing when you know it, but that has caused me a lot of headaches and debug time and now I'm curios about it ;)
PD: I use jdk-1_5_0_01 and Suse 9.1
A lot of thanks in advance,/* a.c */
#include <stdio.h>
#include <stdlib.h>
int main() {
int r=execl("./b","nothing","-version",NULL);
printf("%d\n",r);
/* b.c */
#include <stdio.h>
int main(int argc,char *argv[]) {
int i;
for(i=0;i<argc;i++) printf("%d %s\n",i,argv);
$ gcc a.c -o a
$ gcc b.c- o b
$ ./a
0 nothing
1 -version
Maybe you are looking for
-
I'm sure there is a simple fix...but I'm stuck!
I'm sure there has to be a simple fix to this, but I can't for the life of me figure out what it is. I am trying to use an Accordian Widget to make a navigation bar. So far, all is going well EXCEPT ... For my last three tabs, I want to have tab labe
-
Dear Sir/madam I can't run iTunes affer Setup. Error messeger is ( The file" i Tunes library.itl" cannot be read because it was createrd by a newer vesion of iTunes. How can i repair it. Tks
-
Inbound IDoc error with status 51 : No unique SA could be determined
Hello, when I would like to create AAU by EDI info; ORDERS05, DELORD type how can I set mandatory item for AAU? Please help Edited by: Hiroko Numano on Apr 9, 2008 7:13 AM
-
Adobe PDF forms - Nested table where conditions
Hi all, Kindly help me out... In the context I have a outertable and an innertable I had defined the where conditions so that my output should look like below item 1 (outer table values) (no entries to match item1) so it is blank item 2 (outertable
-
Copying records from MS Access to Oracle ODBC
I have a linked table from Oracle to an MS Access DB table. I am trying to "upsize" many records from the original MS Access DB table to one mirrored in Oracle. All is well save for the currency field in the original MS Access table. If I change the