Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 06-12-2003, 09:39 AM   #1
Member (10 bit)
 
Join Date: Apr 2002
Location: Belgium
Posts: 850
java compiler problems

i learn java in school. they gave us a cd with j2sdk1-3-1-win.exe and j2sdk1.3.1linuxi368.bin . i tried to isntall it first in my mandrake 9.1, but i get a checksum error when ./ the bin file.

under windows (98se) it installs fine, i set the correct path in my autoexe.bat. if i type java or javac at prompt it gives me a list with all the options, so to commands seem to work .

When i try to compile an exercise though, i always get the same error
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Exception in thread "main"

i use scite as editor, that's where i get this error.
when i try to compile from command prompt, i also get an error. cant remember if its the same though.

any help would be very welcome.

(ps in autoexe.bat is it path... or always SET PATH ....)
__________________
Been there, broke that
grasshopperbe is offline   Reply With Quote
Old 06-12-2003, 10:03 AM   #2
Member (9 bit)
 
Join Date: May 2002
Posts: 298
make sure you also have the following:

set JAVA_HOME=c:\j2sdk1.3.1 (example, make sure you have your own correct path)
PATH=c:\j2sdk1.3.1


how are you compiling. when you compile you have to state the entire filename:
javac FileName.java

when you run it, you
java FileName
bonzai is offline   Reply With Quote
Old 06-12-2003, 02:17 PM   #3
Member (10 bit)
 
Join Date: Apr 2002
Location: Belgium
Posts: 850
ill check on my set path, i remember i only typed path and not set path, and im not sure if its java_home or java in may path

i compile with javac filename.java and run with java filename.java yes, that 's the only way i know how to.
in scite there are built in links to these commands and a little window for output if all is set up correct, so you dont need command box open all the time

hope its a mistake in my path (typed it like they said at school, with correct pathnames off course, i have it in c:\programs/java)

thanks for the help.

does anyone know how to get it working in linux? (mainly use linux for work, it has c/c++ compiler and so much more on disc , saves me alot of time when i need something)
grasshopperbe is offline   Reply With Quote
Old 06-17-2003, 02:55 PM   #4
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
If you are getting a checksum error when trying to execute the installer under Linux, the file maybe corrupted, did you try to re-download it?
aym is offline   Reply With Quote
Old 06-17-2003, 03:24 PM   #5
Member (10 bit)
 
Join Date: Apr 2002
Location: Belgium
Posts: 850
i just redownloaded it, and the bin files installed correctly this time. guess the school cd isnt worth much.

But if i try javac or java commands, i get command not found. what do i have to do more to get it running?
Do i have to put em in a bin folder or so?
grasshopperbe is offline   Reply With Quote
Old 06-18-2003, 12:13 PM   #6
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
At the command line type:
PATH=$PATH:/path/to/javac ; export PATH
And then you can use javac and the others, but if you close the command line window, restart ... you'll need to do it again.
To keep javac permanently in you path edit the file:
/home/your username/.bash_profile
and add the previous commands to the end of it.
HTH
aym is offline   Reply With Quote
Old 06-18-2003, 12:23 PM   #7
Member (10 bit)
 
Join Date: Apr 2002
Location: Belgium
Posts: 850
Thanks aym_7, hope that does the trick.
Gonna try it tonight when i'm at my own machine.
grasshopperbe is offline   Reply With Quote
Old 06-18-2003, 12:37 PM   #8
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
np
aym is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:01 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2