run a java file on UNIX?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers run a java file on UNIX?
# 1  
Old 07-17-2003
Computer run a java file on UNIX?

HI, I want to run my .java file on a SunOS 5.8 Unix machine. The java file is writen with Ready to Program (Similar to Jbuilder) on a PC.
Thanks!!
# 2  
Old 07-17-2003
anyone knows how to do?
# 3  
Old 07-17-2003
In general,

javac <MainClassName>.java
java <MainClassName>

Replace <MainClassName> with the name of the starting class (with main()).

Of course, you need to install JDK for this to work.
# 4  
Old 07-18-2003
thanx cbkihong!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with writing a script to run java commands in sequence in UNIX

Hi, Brand new to these forums, and I hope that someone can help me out. I'm trying to run the following command in UNIX java -jar GenomeAnalysisTK.jar -T SplitSamFile -dt NONE -R reference.fa -I my.bam --outputRoot /my/path/SampleFiles/Sample_ It executes the SplitSamFile from GATK, but I... (3 Replies)
Discussion started by: Wixaros
3 Replies

2. Shell Programming and Scripting

Cannot run this .java file from the home directory??

I wrote a simple test.java program in vi. I know it compiles correctly because I went into the directory where test.java was and compiled it and it created a java.class. I then ran test.java by staying in the same directory where it was and it worked great. However, when i backed out of the... (3 Replies)
Discussion started by: syregnar86
3 Replies

3. UNIX for Advanced & Expert Users

Command to check java file in UNIX

Guys, i need to check whether java file can be executed in my current unix system or not. Can anyone please help me to get the correct command to check this. My Unix system is HP-UX. Thanks, (1 Reply)
Discussion started by: AraR87
1 Replies

4. UNIX for Dummies Questions & Answers

How to compile and run java in UNIX?

Hi Im using MobaXterm Unix on my windows XP.I want to compile java in unix.I have installed java to the following path C:\Program Files\Java\jdk1.7.0_09\bin In order to compile the java prog im typing the following command after entering into the bin directory: C:\Program... (2 Replies)
Discussion started by: ak3141
2 Replies

5. Shell Programming and Scripting

How to run java from shell

Hi All, I am trying to run a grep command which creates an output file. Then I will run a java file which take that file and process that. My java file uses other java files and library jars. I have tried below code but I am getting compilation error,it can not find other java files in same... (1 Reply)
Discussion started by: kmajumder
1 Replies

6. Programming

Run Unix commands from Java

Greeings all Im trying to excute a command from Java and direct the output to the main output screen or to another file .... can you please help with this ? can I use filewriter for this ? Here is my code.... import java.io.BufferedReader; import java.io.File; import java.io.FileWriter;... (3 Replies)
Discussion started by: yahyaaa
3 Replies

7. Programming

Uncompress a gzip and bzip file using java on unix solaris environment

Hi, I need to uncompress a gzip and bzip file using java on unix solaris environment. I also need to retreive the header information of the file inorder to differentiate between gzip and bzip file. Please help Pooja (0 Replies)
Discussion started by: wadhwa.pooja
0 Replies

8. UNIX for Dummies Questions & Answers

how to run a C file in unix??

Hi, can anyone let me know how to compile and run a C program in UNIX window? I just tried CC filename.c in ksh it is showing that "ksh: cc: not found" error and ./a.out is also not found. can anyone let me know what should i do. thanks in advance.:b: (4 Replies)
Discussion started by: janani_kalyan
4 Replies

9. UNIX for Dummies Questions & Answers

Trying to run java file in crontab

Hi. I have a java program that create reports, and I would like to run it at each hour using crontab. The main file is crome.jar located at /WebApps/Crome folder. When I want to execute the program I use the next script (name crome): #!/bin/sh if ; then ... (1 Reply)
Discussion started by: karmariv
1 Replies

10. UNIX for Dummies Questions & Answers

newbie need help to run java in UNIX

I need to run .java from a directory. i.e. c:\aaa\bbb\ccc.java first I compile all the java using javac *.java under the c:\aaa\bbb directory, now I want to run this command under cd .. , Here is the command that I need to type.. java -classpath... (5 Replies)
Discussion started by: uci
5 Replies
Login or Register to Ask a Question