Solved

jre/jar/class and win2k/nt

Posted on 2001-08-14
12
318 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

615 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