3

I have the following text in a BAT files so I java program in windows. I was wondering how you can do this in linux.

File 1:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\javac.exe" -sourcepath src -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar -d bin src/*.java

File 2:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe" -Xmx1536m -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar HelloWorld

Id really appreciate it if someone would convert those to linux commands.

Thanks :D

3 Answers 3

2
  • get rid of the quotations - spaces in linux are not a usual practice, so the quotes are not needed
  • change ; to : as classpath separator
  • change slashes to /
  • make the file .sh

that should be it.

Sign up to request clarification or add additional context in comments.

5 Comments

Folder names on OS X can have spaces.
They can in Linux as well -- they just need to be escaped properly. :)
@casablanca - ... and the person who puts them there needs to be sent for counselling :-)
@casablanca: yes, by putting the path in quotes for instance, which makes the advice given by this answer wrong.
@JeremyP - not quite. I rephrased the answer so that it is clear that on Linux it is not customary to use spaces. And by default java is installed on a no-space directory. (on distros I've used at least)
0

The options to java and javac are the same on all platforms. The only things that will change are the file path, for eg. deps\mail.jar might become deps/mail.jar; and the classpath separator, : (colon) instead of ; (semicolon).

Comments

0

check if java SDK (java-1.6.0-openjdk-devel or Sun) exists and in the PATH

which javac

Next put the same options
javac -sourcepath ..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.