User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Java .jar file question Page [1]  
JCash
All American
988 Posts
user info
edit post

I just finished a little java program for a homework assignment and I'm having trouble creating the jar file to bring to class.

I usually do my work in the lab (at UNCA) on their computers that use Linux, so I haven't encountered this problem before. Right now I'm on my home computer which uses Windows XP.

Anyways, here is my syntax using the command prompt, please let me know what you think is wrong. I can't figure it out:

C:\Documents and Settings\Owner>jar cf Homework3.jar My Documents\NetBeansProjects\Homework3

'jar' is not recognized as an internal or external command, operable program or batch file.

2/6/2008 10:19:47 PM

evan
All American
27701 Posts
user info
edit post

make sure the path to the java binaries is in the PATH= environment variable

control panel > system > advanced > environment variables



it makes baby jesus sad that you don't know something as simple as this, yet you're programming in java

2/6/2008 10:21:50 PM

JCash
All American
988 Posts
user info
edit post

Thanks for the reply.

I'm a little confused what should be where...

Under the Environmental Variables I have the following:

CLASSPATH
.;C:\Program Files\Java\j2re1.4.2_09\lib\ext\QTJava.zip

and

PATH
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Adaptec Shared\System;C:\Program Files\QuickTime\QTSystem\

I'm assuming I need to edit the CLASSPATH??

And if so, do I put the folder with all my NetBeans Projects at the CLASSPATH?

2/6/2008 10:34:40 PM

evan
All American
27701 Posts
user info
edit post

no

add this to the end of the PATH variable:

;C:\Program Files\Java\j2re1.4.2_09\bin\

(yes, include the semicolon)

2/6/2008 10:37:37 PM

evan
All American
27701 Posts
user info
edit post

does the jar binary even come with the j2re btw?

2/6/2008 10:40:28 PM

JCash
All American
988 Posts
user info
edit post

I'm not sure...I downloaded the recommended version, so I would think it includes everything I needed.

I added that line to the PATH, but I got the same error from the command prompt.

I appreciate the help, but honestly, it'll probably take more trouble than it's worth to help me out because I don't know what I'm doing. I'm going to just copy and paste the code from the program into an e-mail and redo it quickly tomorrow. And I think I'm going to try and bring my laptop to class to have a professor explain how to set this up.

Thanks anyways though.

2/6/2008 10:53:57 PM

hydro290
All American
1703 Posts
user info
edit post

The directory containing jar.exe has to be in your PATH. The JRE does not include jar.exe. You have to download the JDK. Then add ;C:\Program Files\Java\jdk1.4.2_09\bin to your path (if that is where it installs to).

2/7/2008 12:43:47 PM

pureplayan
All American
1684 Posts
user info
edit post

what happened to javac?

2/7/2008 3:33:08 PM

David0603
All American
12762 Posts
user info
edit post

That's for compiling the code

2/7/2008 3:44:16 PM

Rat
Suspended
5724 Posts
user info
edit post

random question insert...

i'm a c# programmer (.net and asp) are jars the same thing basically as dll's? (not exactly, but that they serve the same purpose?)

i've used java like once in my life

[Edited on February 8, 2008 at 9:15 PM. Reason : .]

2/8/2008 9:14:32 PM

evan
All American
27701 Posts
user info
edit post

no.

jar = java archive that contains code, among other things

dll = compiled code

2/9/2008 12:07:14 AM

Rat
Suspended
5724 Posts
user info
edit post

huh. well thats gay

java is for losers

2/10/2008 9:36:29 PM

evan
All American
27701 Posts
user info
edit post

Quote :
"java is for losers"


welcome to the computer science department at ncsu

2/10/2008 10:40:28 PM

 Message Boards » Tech Talk » Java .jar file question Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.