Author Topic: How to Compile?  (Read 4483 times)

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #15 on: April 17, 2015, 01:42:58 pm »
UP

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #16 on: April 21, 2015, 11:42:34 pm »
HELP PLEASE!!!!!!!!!

I creatfile mainfest.txt:

Code: [Select]
Manifest-Version: 1.0
Class-Path: . lib/bcprov-jdk15on-148.jar lib/commons-collections-3.2.1.jar lib/commons-configuration-1.9.jar lib/commons-lang-2.6.jar lib/commons-logging-1.1.2.jar lib/mysql-connector-java-5.1.24-bin.jar
Main-Class: gcb.Main

I am run command:

Code: [Select]
javac -classpath "src/:bin/lib/*"  src/gcb/Main.java
Code: [Select]
java -classpath .:../bin/lib/* gcb.Main
Code: [Select]
jar cvfm gcb.jar manifest.txt *.class
Copy gcb.jar in /root/gcb/bin/
java -jar gcb.jar
no main manifest attribute, in gcb.jar

What am i doing wrong?


uakf.b

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
  • Karma: +86/-12
    • View Profile
Re: How to Compile?
« Reply #17 on: April 22, 2015, 09:29:15 am »
Pretty sure it has to be manifest.mf or something.

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #18 on: April 22, 2015, 12:03:33 pm »
Not works

uakf.b

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
  • Karma: +86/-12
    • View Profile
Re: How to Compile?
« Reply #19 on: April 22, 2015, 12:30:40 pm »
Code: [Select]
jar cvfm gcb.jar manifest.txt *.classThat might be the problem, that only gets classes in the current directory, and when you put them in they'll be in the wrong directory in the JAR file. Try this instead:

Code: [Select]
cd /path.../gcb/src
jar cvfm gcb.jar manifest.mf gcb/*.class gcb/*/*.class

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #20 on: April 22, 2015, 11:07:21 pm »
Not works.

My manifest.mf:

Code: [Select]
Manifest-Version: 1.0
Class-Path: . lib/bcprov-jdk15on-148.jar lib/commons-collections-3.2.1.jar lib/commons-configuration-1.9.jar lib/commons-lang-2.6.jar lib/commons-logging-1.1.2.jar lib/mysql-connector-java-5.1.24-bin.jar
Main-Class: gcb.Main

Catalog lib:

Code: [Select]
bcpkix-jdk15on-148.jar
bcprov-jdk15on-148.jar
commons-collections-3.2.1.jar
commons-configuration-1.9.jar
commons-lang-2.6.jar
commons-logging-1.1.2.jar
mysql-connector-java-5.1.24-bin.jar

uakf.b

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
  • Karma: +86/-12
    • View Profile
Re: How to Compile?
« Reply #21 on: April 22, 2015, 11:15:52 pm »
Try putting it in META-INF/MANIFEST.MF

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #22 on: April 23, 2015, 12:08:42 am »
How to?

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #23 on: April 26, 2015, 09:38:07 pm »
up

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: How to Compile?
« Reply #24 on: May 07, 2015, 12:57:35 am »
UP