0

I am working on developing a java application which will be scheduled in control-m tool.

the program is configurable without modifying source code,meaning that has the ability to specify log file path, data input file for the program.

control-m or the windows shceduler may or may not have Jre or JDK installed on those machines. What I am thinking to do is to include jre related jars in my project jar(maven module) by specifying it as dependency in my pom.xml so that I don't need to worry whether java installed on those machines from which the program can run.

I am using jdk 1.6.

mahesh
  • 1,523
  • 4
  • 23
  • 39

1 Answers1

0

You can specify this plugin in pom.xml for java dependency.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<executable>${env.JAVA_HOME}/bin/javac</executable>
<fork>true</fork>
<encoding>UTF-8</encoding>
</configuration>
</plugin>  

For this JRE must be installed and JAVA_HOME path must be set on system machine.

unknown
  • 4,859
  • 10
  • 44
  • 62
  • thanks @Gautam jshi, but for running java application , we need javac or java? because executable tag in your post pointed to bin/javac? – mahesh Feb 22 '14 at 19:00
  • I dont have permission to set java_home path on my client machine. how can add it in another way? – mahesh Feb 22 '14 at 19:05
  • can you mention how you set JAVA_HOME and client machine information, e.g. OS ? – unknown Feb 22 '14 at 19:06
  • I thought of adding an environment variable by right click on my computer-> advanced settings. isn't the way? it is windows vista – mahesh Feb 22 '14 at 19:08
  • refer this question and follow that answer which has more than 150 upvotes - http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7 – unknown Feb 22 '14 at 19:10
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/48159/discussion-between-mahesh-and-gautam-joshi) – mahesh Feb 22 '14 at 19:16
  • Thanks,but other way doing it from control panel also does not help me as i don't have permissions to change it in my PC. So I am thinking to add it in pom.xml as property for now? – mahesh Feb 22 '14 at 19:17