Results 1 to 10 of 10
Installed jdk-1_5_0_06 from sun website(Not the Netbeans)
Install went fine but i'm getting the javac command not found error when
I try to complie a .jar file I made.
tried ...
- 02-02-2006 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 13
jacac comand not found.
Installed jdk-1_5_0_06 from sun website(Not the Netbeans)
Install went fine but i'm getting the javac command not found error when
I try to complie a .jar file I made.
tried as root and normal user, tried after a reboot as well.
Using Slack 10.2, XFCE 4.2.
Do I need to set the path???
If so could some one give me an example?
- 02-02-2006 #2
Yes, you're probably having a path problem. Did you install it as root or regular user? Did you use an RPM or a shell script? Do you know where the JVM installed itself? What is the exact command you're typing when you try to run your .JAR?
Registered Linux user #270181
TechieMoe's Tech Rants
- 02-02-2006 #3Just Joined!
- Join Date
- Dec 2005
- Posts
- 13
I installed it using the self extracting file from the sun website.
I installed as root.
I have no idea where the jvm is installed, I'm sure there is a way to find out though.
I just don't know it.
javac filename .jar
- 02-02-2006 #4Type java --version in a console and see if it finds anything. I do not run JAR files using "javac", I run them like this:
Originally Posted by sunking
Code:java -jar nameOfSomeJarFile.jar
Registered Linux user #270181
TechieMoe's Tech Rants
- 02-02-2006 #5Just Joined!
- Join Date
- Dec 2005
- Posts
- 13
java -version gives me: java version 1.5.0.04
Java 2 Runtime Enviroment Standard Edition.
Dosen't give me the JDK version
I tried java -jar filenam.jar I get 'unable to acess filename.jar
But don't you have to compile the jar file first>>jacac filename.jar to make it run???
- 02-02-2006 #6No. Java is an interpreted language rather than a compiled one. JAR files are just a collection of compressed .java source code (like a .ZIP file), which the Java virtual machine interprets into bytecode.
Originally Posted by sunking
Try giving java an absolute path to the jar file like this:
Code:java -jar /home/user/javafiles/jarfile.jar
Registered Linux user #270181
TechieMoe's Tech Rants
- 02-03-2006 #7Just Joined!
- Join Date
- Dec 2005
- Posts
- 13
Yes I 've tried that I get a compile error: 'unable to acces jar file'
- 02-03-2006 #8
How did you build this jar file? Did you download it from somewhere? Have you tried unzipping the JAR file into a directory and running the main class directly?
Registered Linux user #270181
TechieMoe's Tech Rants
- 02-03-2006 #9Just Joined!
- Join Date
- Dec 2005
- Posts
- 13
Damn I'm not on my slack box right now.
I made the file myself, use jedit i think.
It's just a simple 'Hello World' type jar file.
Any way I found a version a of jdk-1_5 on one of the 'slackpkg' mirrors
downloaded and installed it
slackpkg install jdk-1_5_0_04
That seems to fix most things, I no Longer get the 'javac not found' error.
However javac now gives me the help menu when I try to complie a jar file.
javac FileName>>>Error 'option File Name not recognized'.
It seems to think the FileName is an option and not the .jar file.
So i try javac with the -g option, but still gives the same error.
Maybe my syntax is wrong:
javac -g FilName
After trying this for a while I simply just did java FileName.
It ran the program and it gave the output I was looking for---go figure?
I think most of the problmes were from using 'jedit' the Jcompiler plugin
wasn't loading correctly.
But javac stil gives the 'option FileName not recognized' error.
This I still like to find a fix for.
- 02-03-2006 #10
Jar files are really only useful for larger projects. HellowWorld apps you could quite easily just run straight from the .class files.
Registered Linux user #270181
TechieMoe's Tech Rants


Reply With Quote
