0

I'm building a regular Java Application in Netbeans.

Suppose I want to compile the Main class like this "javac -target 1.1 Main.java" and other classes with the latest JDK version. How do I do this? Can I edit the build.xml file to make this happen?

I would like to do this so that the application can be started using any Java version and I can then notify the user that they have to update their Java if they are not using the latest JRE.

Reformulation of the problem: What I want is that Netbeans compiles Main.java with target 1.1 and the rest of the project files with the latest JDK into a single jar when I hit the build button.

atabek
  • 89
  • 1
  • 3
  • 12
  • possible duplicate of [Many versions of JDK, How do i compile / build specifying only one?](http://stackoverflow.com/questions/7071827/many-versions-of-jdk-how-do-i-compile-build-specifying-only-one) – martin clayton Apr 06 '13 at 07:53
  • See also: http://stackoverflow.com/questions/949678/ant-is-using-wrong-java-version?lq=1 – martin clayton Apr 06 '13 at 07:53
  • I've seen those posts, but they do not have the answer. What I want is that Netbeans compiles Main.java with target 1.1 and the rest of the project files with the latest JDK into a single jar when I hit the build button. I really do not have any idea on how to use Ant. The build.xml file in my Netbeans tells me I can override certain targets, but I don't know what commands I should put and which I should override to make this happen. – user2251138 Apr 06 '13 at 14:45

0 Answers0