2

I need to use some c++ things in a java project, can i do it?

public static void main(String[] args) {
    System.out.println(getCpuTemp());
}

private static native int getCpuTemp();
Filippo
  • 274
  • 1
  • 4
  • 13
  • Have you tried doing it? – UnholySheep Mar 14 '18 at 14:21
  • Have you seen https://stackoverflow.com/questions/7593334/how-to-call-c-from-java. ? – mdo123 Mar 14 '18 at 14:33
  • I've just done it one time in Android Studio that is at least the same of Intellij IDEA but Android Studio automatically creates the java method and the cpp file. I don't know the folder where i've to put the cpp file and then call System.loadLibrary("") – Filippo Mar 14 '18 at 14:41
  • 1
    IntelliJ IDEA does not have any support for C++. You can edit .cpp files as plain text, but that's it - you won't get any additional assistance. – yole Mar 14 '18 at 16:45
  • Where i've to place the .cpp? @yole – Filippo Mar 14 '18 at 20:07

0 Answers0