|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#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 |
|
|
|
|
|
#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 |
|
|
|
|
|
#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) |
|
|
|
|
|
#4 |
|
Registered User
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?
|
|
|
|
|
|
#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? |
|
|
|
|
|
#6 |
|
Registered User
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 |
|
|
|
|
|
#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. |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
np
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|