2

My problem: I have JDK 1.7 version on my machine. The jar I created with this does not run on my Unix machine as it has JRE 1.4 installed (I don't have admin rights to this machine).

So, is there a way to compile my code with version 1.4 w/o uninstalling 1.7 on my machine. Can it be done online?

0

3 Answers 3

1

You may use -target version option to perform cross-compilation.

Example as per javadoc

% javac -target 1.4 -bootclasspath jdk1.4.2/lib/classes.zip \              -extdirs "" OldCode.java

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

Comments

0

According to the javac documentation, you can set the JDK source using -source parameter:

javac -source 1.4 MyClass

Comments

0

This ,this and this are very good sites where you can run all your java code online and get the results, without having JDK installed in your machine

1 Comment

this doesn't answer the question.

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.