Solved

jre/jar/class and win2k/nt

Posted on 2001-08-14
12
317 Views
Last Modified: 2013-11-23
hi, I developed a small java program with jdk1.3.1 in my development machine. which runs my program nicely using c:>java myclass command.

now I have a win2k server. I want to move/deploy/run(whatever the term is) my program in that server.

the win2k server doesn't have any java development stuff installed. maybe the one with win2k, but that is it.

how do I run myclass in this server?

I have downloaded jre, but didn't install yet.

not to offend people, but I do prefer outline, step by step explanaition/instruction. easy to read and yes, understand.

thanks
0
Comment
Question by:chrislee8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
12 Comments
 
LVL 3

Expert Comment

by:black
ID: 6386498
1. well first you need to install the JRE
2. let's say you installed it into
C:\jre
then your PATH environment variable should have an entry into the bin directory:
PATH=%PATH%;C:\jre\bin
this let's you type in java command line.
3. Set the CLASSPATH variable to point to either the JAR file if you have your classes in a jar:
CLASSPATH=%CLASSPATH%;C:\myapp.jar
or if you have it in the directory structure
CLASSPATH=%CLASSPATH%;C:\myclasses
4. Go to command line and run it
C:>java myClass args
0
 

Author Comment

by:chrislee8
ID: 6386729
do I really need the jar file in the server or just the myclass.class file?

my program is just one class file, not multiple class files.

thanks
0
 
LVL 3

Expert Comment

by:black
ID: 6386773
you can have either, the jar file is just an archive containing the classes you just need one of them
if you have a single class file just copy that across.
point your classpath at you classes directory. For example if you have a class called MyClass in the my.app package. You would have
C:\classes\my\app\MyClass.class
and you CLASSPATH would point to the classes directory:
CLASSPATH=%CLASSPATH%;C:\classes
and you would run your class by:
C:>java my.app.MyClass args
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chrislee8
ID: 6386783
i forgot to tell:

i do c:>java myclass.class, it says not such internal command found.

does the java.exe(i guess) come with the jre?
or what is wrong?

thanks
0
 
LVL 3

Expert Comment

by:black
ID: 6386866
yes it does, type in
C:>set
and it will print out your environment variables, make sure the directory you have the java.exe file is an entry in the PATH variable.
0
 

Author Comment

by:chrislee8
ID: 6388258
I did a search on java.exe file, nothing came up, I downloaded the jre1.1.x for win32 version.
no it doesn't have the java.exe file anywhere.

0
 

Author Comment

by:chrislee8
ID: 6388287
i tried installing jre1.1.x for win32 on two servers, I did a search on java.exe file. nothing came up.

what is wrong???

aarrrhhhhhhhhhhhhhhh, frigging javasoft doesn't provide any help and ****!!!!!

sorry i need to vent a little bit.
0
 

Author Comment

by:chrislee8
ID: 6388380
i just found out that java.exe only comes with the jdk!!!
hey, what is going on?
again, my server doesn't have jdk installed, and i don't plan to neither because I won't do development work on my server. the development work is done on a workstation.

I need the server to run my java application though, so I think I need jre.

but i don't know the rest.
how do I run my java app(only one class) on my server? it is win2kAS.

I relied on your guys' advise, please don't give out incorrect information.
0
 
LVL 1

Accepted Solution

by:
ny971181 earned 50 total points
ID: 6388580
well, do this:

you have jre installed right, then you should have jre.exe command file.

c:>jre -cp (your class' path) (your class name)

the java.exe doesn't come with the jre, it comes with the jdk only.
jre comes with the jre(of course right?).

actually, javasoft does have the jre usage example. but I agree that they don't organize well(easy) enough for beginners.

good luck.
0
 

Author Comment

by:chrislee8
ID: 6388607
it works, thanks

thank you for your time too, black.
0
 
LVL 3

Expert Comment

by:black
ID: 6390615
I assumed you have a recent or at least Java 2, JRE and not a a 1.1.x version and my instructions were based on that that. And considering you said:
"I developed a small java program with jdk1.3.1"
I assumed you had jre 1.3 at least (the same one that I have) and I can assure you that it doesn't have a jre.exe.
If you developed in 1.3.1 I'm not sure why you would run in 1.1.x
here are some links to the jre 1.3 docs and downloads:
http://java.sun.com/j2se/1.3/runtime.html
http://java.sun.com/j2se/1.3/jre/download-windows.html
This is for 1.3.1, if you developed on it you should run on it too.
0
 

Author Comment

by:chrislee8
ID: 6391000
black,

i just downloaded the jre1.3.1, it does have java.exe.

it is my fault that I didn't mention the version of jre first, but if I knew it, I would have done it too.

hehe. sorry. Thanks for your time and effort, have a nice night.

sorry didn't award you the points. my bad.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java exception bubble up 2 26
Java: anonymous class 4 54
Where to place postgres JDBC driver jar on tomcat 8 70
Eclipse neon2 "Java build path" correctness 7 43
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question